123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133 |
- unit IDE.OptionsForm;
- {
- Inno Setup
- Copyright (C) 1997-2024 Jordan Russell
- Portions by Martijn Laan
- For conditions of distribution and use, see LICENSE.TXT.
- Compiler IDE Options form
- }
- interface
- uses
- Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
- UIStateForm, StdCtrls, ExtCtrls, NewStaticText;
- type
- TOptionsForm = class(TUIStateForm)
- OKButton: TButton;
- CancelButton: TButton;
- GroupBox1: TGroupBox;
- BackupCheck: TCheckBox;
- GroupBox2: TGroupBox;
- AssocButton: TButton;
- StartupCheck: TCheckBox;
- WizardCheck: TCheckBox;
- GroupBox3: TGroupBox;
- ChangeFontButton: TButton;
- FontPanel: TPanel;
- Label1: TNewStaticText;
- FontDialog: TFontDialog;
- UseSynHighCheck: TCheckBox;
- FullPathCheck: TCheckBox;
- CursorPastEOLCheck: TCheckBox;
- UndoAfterSaveCheck: TCheckBox;
- TabWidthEdit: TEdit;
- Label2: TNewStaticText;
- PauseOnDebuggerExceptionsCheck: TCheckBox;
- RunAsDifferentUserCheck: TCheckBox;
- AutosaveCheck: TCheckBox;
- UseFoldingCheck: TCheckBox;
- AutoIndentCheck: TCheckBox;
- IndentationGuidesCheck: TCheckBox;
- UseTabCharacterCheck: TCheckBox;
- AutoAutoCompleteCheck: TCheckBox;
- UnderlineErrorsCheck: TCheckBox;
- GutterLineNumbersCheck: TCheckBox;
- ColorizeCompilerOutputCheck: TCheckBox;
- Label3: TNewStaticText;
- KeyMappingComboBox: TComboBox;
- Label4: TNewStaticText;
- ThemeComboBox: TComboBox;
- OpenIncludedFilesCheck: TCheckBox;
- ShowPreprocessorOutputCheck: TCheckBox;
- HighlightWordAtCursorOccurrencesCheck: TCheckBox;
- HighlightSelTextOccurrencesCheck: TCheckBox;
- Label5: TNewStaticText;
- MemoKeyMappingComboBox: TComboBox;
- ShowWhiteSpaceCheck: TCheckBox;
- procedure AssocButtonClick(Sender: TObject);
- procedure ChangeFontButtonClick(Sender: TObject);
- procedure FormCreate(Sender: TObject);
- procedure TabWidthEditChange(Sender: TObject);
- procedure FormShow(Sender: TObject);
- private
- class var
- FDropDownMemoKeyMappingComboBoxOnNextShow: Boolean;
- var
- {}
- public
- class property DropDownMemoKeyMappingComboBoxOnNextShow: Boolean write FDropDownMemoKeyMappingComboBoxOnNextShow;
- end;
- implementation
- uses
- Shared.CommonFunc.Vcl, Shared.CommonFunc, IDE.HelperFunc, IDE.FileAssocFunc;
- {$R *.DFM}
- procedure TOptionsForm.FormCreate(Sender: TObject);
- begin
- InitFormFont(Self);
- InitFormTheme(Self);
- { Order must match CompFunc.TKeyMappingType }
- KeyMappingComboBox.Items.Add('Classic');
- KeyMappingComboBox.Items.Add('Visual Studio / Visual Studio Code');
- { Order must match TIDEScintKeyMappingType }
- MemoKeyMappingComboBox.Items.Add('Classic / Visual Studio');
- MemoKeyMappingComboBox.Items.Add('Visual Studio Code');
- { Order must match TThemeType }
- ThemeComboBox.Items.Add('Light');
- ThemeComboBox.Items.Add('Dark');
- ThemeComboBox.Items.Add('Classic');
- end;
- procedure TOptionsForm.FormShow(Sender: TObject);
- begin
- if FDropDownMemoKeyMappingComboBoxOnNextShow then begin
- ActiveControl := MemoKeyMappingComboBox;
- MemoKeyMappingComboBox.DroppedDown := True;
- FDropDownMemoKeyMappingComboBoxOnNextShow := False;
- end;
- end;
- procedure TOptionsForm.AssocButtonClick(Sender: TObject);
- const
- UserStrings: array [Boolean] of String = ('the current user', 'all users');
- var
- AllUsers: Boolean;
- begin
- if RegisterISSFileAssociation(True, AllUsers) then
- MsgBox('The .iss extension was successfully associated for ' + UserStrings[AllUsers] + ' with:'#13#10 + NewParamStr(0),
- 'Associate', mbInformation, MB_OK);
- end;
- procedure TOptionsForm.ChangeFontButtonClick(Sender: TObject);
- begin
- FontDialog.Font.Assign(FontPanel.Font);
- if FontDialog.Execute then
- FontPanel.Font.Assign(FontDialog.Font);
- end;
- procedure TOptionsForm.TabWidthEditChange(Sender: TObject);
- begin
- OKButton.Enabled := StrToIntDef(TabWidthEdit.Text, 0) > 0;
- end;
- end.
|