-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSettingsForm.pas
56 lines (46 loc) · 1.22 KB
/
SettingsForm.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
unit SettingsForm;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants,
System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs,
Vcl.StdCtrls, Vcl.ExtCtrls;
type
TfrmSettings = class(TForm)
Label1: TLabel;
cbFontSize: TComboBox;
btnOK: TButton;
btnCancel: TButton;
btnRestoreDefaults: TButton;
btnIDEStructure: TButton;
cbFontName: TComboBox;
Label2: TLabel;
procedure FormCreate(Sender: TObject);
procedure btnIDEStructureClick(Sender: TObject);
end;
var
frmSettings: TfrmSettings;
implementation
{$R *.dfm}
uses System.Win.Registry, AdjustFonts, IDEStructureForm;
procedure TfrmSettings.btnIDEStructureClick(Sender: TObject);
begin
TfrmIDEStructure.Open;
end;
procedure TfrmSettings.FormCreate(Sender: TObject);
var
i, fontSize, currentIndex: integer;
fontName: string;
begin
GetCurrentFont(fontName, fontSize);
cbFontName.Items := Screen.Fonts;
cbFontName.ItemIndex := cbFontName.Items.IndexOf(fontName);
currentIndex := 1;
for i := 7 to 30 do
begin
cbFontSize.Items.Add(IntToStr(i));
if fontSize = i then
currentIndex := cbFontSize.Items.Count - 1;
end;
cbFontSize.ItemIndex := currentIndex;
end;
end.