-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFormQuickNewSHP.pas
147 lines (135 loc) · 4.8 KB
/
FormQuickNewSHP.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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
unit FormQuickNewSHP;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ComCtrls, XPMan;
type
TFrmQuickNewSHP = class(TForm)
BtOK: TButton;
BtCancel: TButton;
GroupBox1: TGroupBox;
CbxGame: TComboBoxEx;
Label4: TLabel;
CbxType: TComboBoxEx;
Label5: TLabel;
XPManifest: TXPManifest;
procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
procedure BtOKClick(Sender: TObject);
procedure BtCancelClick(Sender: TObject);
procedure CbxGameChange(Sender: TObject);
procedure FormShow(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
Changed : Boolean;
end;
implementation
{$R *.dfm}
uses FormMain;
procedure TFrmQuickNewSHP.BtOKClick(Sender: TObject);
begin
Changed := true;
Close;
end;
procedure TFrmQuickNewSHP.BtCancelClick(Sender: TObject);
begin
Changed := false;
Close;
end;
procedure TFrmQuickNewSHP.CbxGameChange(Sender: TObject);
var
Index: integer;
begin
Index := CbxType.ItemIndex;
case (CbxGame.ItemIndex) of
0:
begin
CbxType.ItemsEx.Clear;
CbxType.ItemsEx.AddItem('Any (Auto)', -1, -1, -1, -1, nil);
CbxType.ItemsEx.AddItem('Unit', -1, -1, -1, -1, nil);
CbxType.ItemsEx.AddItem('Building', -1, -1, -1, -1, nil);
CbxType.ItemsEx.AddItem('Building Animation', -1, -1, -1, -1, nil);
CbxType.ItemsEx.AddItem('Animation', -1, -1, -1, -1, nil);
CbxType.ItemsEx.AddItem('Cameo', -1, -1, -1, -1, nil);
CbxType.ItemsEx.AddItem('Overlay (Desert)', -1, -1, -1, -1, nil);
CbxType.ItemsEx.AddItem('Overlay (Winter)', -1, -1, -1, -1, nil);
if Index < 8 then
CbxType.ItemIndex := Index
else
CbxType.ItemIndex := 0;
end;
1:
begin
CbxType.ItemsEx.Clear;
CbxType.ItemsEx.AddItem('Any (Auto)', -1, -1, -1, -1, nil);
CbxType.ItemsEx.AddItem('Unit', -1, -1, -1, -1, nil);
CbxType.ItemsEx.AddItem('Building', -1, -1, -1, -1, nil);
CbxType.ItemsEx.AddItem('Building Animation', -1, -1, -1, -1, nil);
CbxType.ItemsEx.AddItem('Animation', -1, -1, -1, -1, nil);
CbxType.ItemsEx.AddItem('Cameo', -1, -1, -1, -1, nil);
CbxType.ItemsEx.AddItem('Overlay (Temperate)', -1, -1, -1, -1, nil);
CbxType.ItemsEx.AddItem('Overlay (Snow)', -1, -1, -1, -1, nil);
CbxType.ItemsEx.AddItem('Overlay (Interior)', -1, -1, -1, -1, nil);
if Index < 8 then
CbxType.ItemIndex := Index
else
CbxType.ItemIndex := 0;
end;
2:
begin
CbxType.ItemsEx.Clear;
CbxType.ItemsEx.AddItem('Any (Auto)', -1, -1, -1, -1, nil);
CbxType.ItemsEx.AddItem('Unit', -1, -1, -1, -1, nil);
CbxType.ItemsEx.AddItem('Building', -1, -1, -1, -1, nil);
CbxType.ItemsEx.AddItem('Building Animation', -1, -1, -1, -1, nil);
CbxType.ItemsEx.AddItem('Animation', -1, -1, -1, -1, nil);
CbxType.ItemsEx.AddItem('Cameo', -1, -1, -1, -1, nil);
CbxType.ItemsEx.AddItem('Overlay (Temperate)', -1, -1, -1, -1, nil);
CbxType.ItemsEx.AddItem('Overlay (Snow)', -1, -1, -1, -1, nil);
if Index < 8 then
CbxType.ItemIndex := Index
else
CbxType.ItemIndex := 0;
end;
3:
begin
CbxType.ItemsEx.Clear;
CbxType.ItemsEx.AddItem('Any (Auto)', -1, -1, -1, -1, nil);
CbxType.ItemsEx.AddItem('Unit', -1, -1, -1, -1, nil);
CbxType.ItemsEx.AddItem('Building', -1, -1, -1, -1, nil);
CbxType.ItemsEx.AddItem('Building Animation', -1, -1, -1, -1, nil);
CbxType.ItemsEx.AddItem('Animation', -1, -1, -1, -1, nil);
CbxType.ItemsEx.AddItem('Cameo', -1, -1, -1, -1, nil);
CbxType.ItemsEx.AddItem('Overlay (Temperate)', -1, -1, -1, -1, nil);
CbxType.ItemsEx.AddItem('Overlay (Snow)', -1, -1, -1, -1, nil);
CbxType.ItemsEx.AddItem('Overlay (Urban)', -1, -1, -1, -1, nil);
CbxType.ItemsEx.AddItem('Overlay (Desert)', -1, -1, -1, -1, nil);
CbxType.ItemsEx.AddItem('Overlay (Lunar)', -1, -1, -1, -1, nil);
CbxType.ItemsEx.AddItem('Overlay (New Urban)', -1, -1, -1, -1, nil);
if Index < 8 then
CbxType.ItemIndex := Index
else
CbxType.ItemIndex := 0;
end;
end;
end;
procedure TFrmQuickNewSHP.FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
begin
if Key = VK_RETURN then
begin
BtOkClick(Sender);
end
else if Key = VK_ESCAPE then
begin
BtCancelClick(Sender);
end;
end;
procedure TFrmQuickNewSHP.FormShow(Sender: TObject);
begin
Changed := False;
CbxGame.Images := FrmMain.ImageList;
CbxGame.ItemIndex := 2;
CbxType.ItemIndex := 0;
end;
end.