forked from jrsoftware/issrc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCompOptions.pas
102 lines (87 loc) · 2.92 KB
/
CompOptions.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
unit CompOptions;
{
Inno Setup
Copyright (C) 1997-2010 Jordan Russell
Portions by Martijn Laan
For conditions of distribution and use, see LICENSE.TXT.
Compiler Options form
$jrsoftware: issrc/Projects/CompOptions.pas,v 1.26 2010/10/30 04:29:19 jr Exp $
}
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;
WordWrapCheck: TCheckBox;
AutoIndentCheck: TCheckBox;
IndentationGuidesCheck: TCheckBox;
UseTabCharacterCheck: TCheckBox;
AutoCompleteCheck: TCheckBox;
UnderlineErrorsCheck: TCheckBox;
GutterLineNumbersCheck: TCheckBox;
procedure AssocButtonClick(Sender: TObject);
procedure ChangeFontButtonClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure TabWidthEditChange(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
implementation
uses
CmnFunc, CmnFunc2, CompForm, CompFileAssoc;
{$R *.DFM}
procedure TOptionsForm.FormCreate(Sender: TObject);
begin
InitFormFont(Self);
{ On Windows Vista, you can only select administrator accounts in a "Run as"
dialog. On Windows 2000/XP/2003, you can select any account. Earlier
versions of Windows don't support "Run as" at all, so disable the check
box there. }
if Win32MajorVersion >= 6 then
RunAsDifferentUserCheck.Caption := 'Always &launch Setup/Uninstall as administrator'
else
RunAsDifferentUserCheck.Caption := 'Always &launch Setup/Uninstall as different user';
RunAsDifferentUserCheck.Enabled := (Win32MajorVersion >= 5);
end;
procedure TOptionsForm.AssocButtonClick(Sender: TObject);
begin
RegisterISSFileAssociation;
MsgBox('The .iss extension was successfully associated 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.