at first it can be a pain setting up a RADIO BUTTON or MENU ITEM
that you want to 'check/uncheck' in that you can easily end up
with an infinite loop...
THIS IS THE LONG WAY TO DO IT
procedure TEditorForm.EditMenuWordWrapClick(Sender: TObject);
var
yesWeHaveWordWrap: Boolean;
begin
if (Editor.WordWrap = True) then yesWeHaveWordWrap := True
else yesWeHaveWordWrap := False;
if (yesWeHaveWordWrap = True) then
begin
Editor.WordWrap := False;
EditMenuWordWrap.Checked := False;
end
else
begin
Editor.WordWrap := True;
EditMenuWordWrap.Checked := True;
end;
end;
THIS IS THE SHORT WAY TO DO IT!
procedure TEditorForm.EditMenuWordWrapClick(Sender: TObject);
begin
EditMenuWordWrap.Checked := not EditMenuWordWrap.Checked;
end;