can anyone help me I am trying to do 2 commands in one space I trying to cut down on my menu space by moving 2 commands in to one can anyone help me fix my code below I am trying to get it so when a person clicks on the menu list is changes the title to Enable and it will call the enable code then if there click on it agen it will change the caption to disabled and set to disable mode can anyone help???
[code]
procedure TChatForm.Dontwrite1Click(Sender: TObject);
var
s:string;
begin
if ((DM.UserTyp='3')or(DM.UserTyp='2')or(owner))and((PopupType<>'3')and(PopupType<>'2')) then
if Dm.MainClient.Active then
begin
Dontwrite1.Caption := 'Enable [ '+PopupName+' ] textchat';
Dontwrite1.GroupIndex :=1;
if (PopupRDotText<>'1')and(PopupRDotText<>'0')then PopupRDotText:='0';
if (PopupRDotVideo<>'1')and(PopupRDotVideo<>'0')then PopupRDotVideo:='0';
if (PopupRDotAudio<>'1')and(PopupRDotAudio<>'0')then PopupRDotAudio:='0';
if (PopupRDotAll<>'1')and(PopupRDotAll<>'0')then PopupRDotAll:='0';
s:='1'+PopupRDotVideo+PopupRDotAudio+PopupRDotAll;
DM.MainClient.Socket.SendText(CodeStr('SetRDot'+PopupName+''+s+''));
end
else
begin
if Dontwrite1.GroupIndex = 1 then
begin
if Dm.MainClient.Active then
begin
if (PopupRDotText<>'1')and(PopupRDotText<>'0')then
PopupRDotText:='0';
if (PopupRDotVideo<>'1')and(PopupRDotVideo<>'0')then
PopupRDotVideo:='0';
if (PopupRDotAudio<>'1')and(PopupRDotAudio<>'0')then
PopupRDotAudio:='0';
if (PopupRDotAll<>'1')and(PopupRDotAll<>'0')then
PopupRDotAll:='0';
s:='0'+PopupRDotVideo+PopupRDotAudio+PopupRDotAll;
DM.MainClient.Socket.SendText(CodeStr('SetRDot'+PopupName+''+s+''));
Dontwrite1.Caption := 'Disable [ '+PopupName+' ] textchat';
Dontwrite1.GroupIndex :=0;
end;
end;
end;
end;
[/code]
thank you very much
Slewis
Comments
Sorry, I rarely reply but now I had to tell you your text is extremely hard to read. Tips:
-Use "." periods in your text to create sentences.
-Start new sentence with capital letter.
-That triple question mark suits your text better than the optimized one.
-Don't use
I will maybe answer later if you make your question more clear, so I can understand it. Though I am a bit busy with my job right now.
Slewis