Inno-Setup-issrc/Projects/Src/IDE.OptionsForm.pas

133 lines
3.9 KiB
ObjectPascal
Raw Permalink Normal View History

unit IDE.OptionsForm;
2011-10-06 20:53:09 +02:00
{
Inno Setup
Copyright (C) 1997-2024 Jordan Russell
2011-10-06 20:53:09 +02:00
Portions by Martijn Laan
For conditions of distribution and use, see LICENSE.TXT.
Compiler IDE Options form
2011-10-06 20:53:09 +02:00
}
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
UIStateForm, StdCtrls, ExtCtrls, NewStaticText;
2011-10-06 20:53:09 +02:00
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;
2011-10-06 20:53:09 +02:00
AutoIndentCheck: TCheckBox;
IndentationGuidesCheck: TCheckBox;
UseTabCharacterCheck: TCheckBox;
AutoAutoCompleteCheck: TCheckBox;
2011-10-06 20:53:09 +02:00
UnderlineErrorsCheck: TCheckBox;
GutterLineNumbersCheck: TCheckBox;
ColorizeCompilerOutputCheck: TCheckBox;
Label3: TNewStaticText;
2024-05-17 14:20:58 +02:00
KeyMappingComboBox: TComboBox;
Label4: TNewStaticText;
ThemeComboBox: TComboBox;
2020-08-11 22:48:52 +02:00
OpenIncludedFilesCheck: TCheckBox;
2020-08-29 14:22:45 +02:00
ShowPreprocessorOutputCheck: TCheckBox;
2024-06-03 19:42:51 +02:00
HighlightWordAtCursorOccurrencesCheck: TCheckBox;
HighlightSelTextOccurrencesCheck: TCheckBox;
2024-06-26 08:36:49 +02:00
Label5: TNewStaticText;
MemoKeyMappingComboBox: TComboBox;
2024-11-20 15:43:41 +01:00
ShowWhiteSpaceCheck: TCheckBox;
2011-10-06 20:53:09 +02:00
procedure AssocButtonClick(Sender: TObject);
procedure ChangeFontButtonClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure TabWidthEditChange(Sender: TObject);
procedure FormShow(Sender: TObject);
2011-10-06 20:53:09 +02:00
private
class var
FDropDownMemoKeyMappingComboBoxOnNextShow: Boolean;
var
{}
2011-10-06 20:53:09 +02:00
public
class property DropDownMemoKeyMappingComboBoxOnNextShow: Boolean write FDropDownMemoKeyMappingComboBoxOnNextShow;
2011-10-06 20:53:09 +02:00
end;
implementation
uses
Shared.CommonFunc.Vcl, Shared.CommonFunc, IDE.HelperFunc, IDE.FileAssocFunc;
2011-10-06 20:53:09 +02:00
{$R *.DFM}
procedure TOptionsForm.FormCreate(Sender: TObject);
begin
InitFormFont(Self);
2024-06-26 08:36:49 +02:00
{ Order must match CompFunc.TKeyMappingType }
KeyMappingComboBox.Items.Add('Classic');
2024-06-26 08:36:49 +02:00
KeyMappingComboBox.Items.Add('Visual Studio / Visual Studio Code');
2024-08-06 18:28:41 +02:00
{ Order must match TIDEScintKeyMappingType }
2024-06-26 08:36:49 +02:00
MemoKeyMappingComboBox.Items.Add('Classic / Visual Studio');
MemoKeyMappingComboBox.Items.Add('Visual Studio Code');
2024-05-17 14:20:58 +02:00
{ Order must match TThemeType }
ThemeComboBox.Items.Add('Light');
ThemeComboBox.Items.Add('Dark');
ThemeComboBox.Items.Add('Classic');
2011-10-06 20:53:09 +02:00
end;
procedure TOptionsForm.FormShow(Sender: TObject);
begin
if FDropDownMemoKeyMappingComboBoxOnNextShow then begin
ActiveControl := MemoKeyMappingComboBox;
MemoKeyMappingComboBox.DroppedDown := True;
FDropDownMemoKeyMappingComboBoxOnNextShow := False;
end;
end;
2011-10-06 20:53:09 +02:00
procedure TOptionsForm.AssocButtonClick(Sender: TObject);
const
UserStrings: array [Boolean] of String = ('the current user', 'all users');
var
AllUsers: Boolean;
2011-10-06 20:53:09 +02:00
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);
2011-10-06 20:53:09 +02:00
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.