Skip to content

Options Dialog ​

TSynEditOptionsDialog (unit SynEdit.OptionsDialog) is a ready-made dialog that lets the user of your application configure an editor: options, gutter, fonts, colors and key bindings.

How it works ​

The dialog does not work directly on the editor, but on a container of settings, TSynEditorOptionsContainer (unit SynEdit.MiscClasses): you copy the settings of the editor into the container, run the dialog and, if the user confirms, copy them back.

pascal
uses
  SynEdit.OptionsDialog, SynEdit.MiscClasses;

procedure TForm1.ActionOptionsExecute(Sender: TObject);
var
  Options: TSynEditorOptionsContainer;
begin
  Options := TSynEditorOptionsContainer.Create(Self);
  try
    Options.Assign(SynEdit1);               // from the editor to the container
    if SynEditOptionsDialog1.Execute(Options) then
      SynEdit1.Assign(Options);             // from the container to the editor
  finally
    Options.Free;
  end;
end;

Properties ​

PropertyDescription
UseExtendedStringsShows the extended descriptions of the options.
GetUserCommandEvent to give the names of your own commands (ecUserFirst...), so that they can be bound to keys in the dialog.
GetAllUserCommandsEvent to give the list of your own commands.
UnitDialog
SynEdit.KeyCmdsEditorEditor of the key bindings (Keystrokes).
SynEdit.KeyCmdEditorEditor of a single key binding.
SynEdit.FHighlightPropEditor of the attributes of a highlighter (colors, styles) with a preview.
SynEdit.OmniSetupDialogSetup of the TSynOmniSyn highlighter.

Released under the MPL 1.1 / GPL 2 dual license.