Skip to content

Commit 22865cf

Browse files
committed
Settings implemented
Things seem to work. I'll release and get bug reports.
1 parent 8687bd0 commit 22865cf

File tree

4 files changed

+126
-105
lines changed

4 files changed

+126
-105
lines changed

src/mainform.lfm

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
object FormMain: TFormMain
2-
Left = 365
2+
Left = 348
33
Height = 192
4-
Top = 201
4+
Top = 197
55
Width = 216
66
BorderIcons = [biSystemMenu, biMinimize]
77
BorderStyle = bsSingle
@@ -10,7 +10,8 @@ object FormMain: TFormMain
1010
ClientWidth = 216
1111
OnClose = FormClose
1212
OnCreate = FormCreate
13-
Position = poDefaultPosOnly
13+
OnShow = FormShow
14+
Position = poDefault
1415
LCLVersion = '1.6.0.4'
1516
object ImgLogo: TImage
1617
Left = 8

src/mainform.lrs

Lines changed: 86 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -1,95 +1,95 @@
11
{ This is an automatically generated lazarus resource file }
22

33
LazarusResources.Add('TFormMain','FORMDATA',[
4-
'TPF0'#9'TFormMain'#8'FormMain'#4'Left'#3'm'#1#6'Height'#3#192#0#3'Top'#3#201
4+
'TPF0'#9'TFormMain'#8'FormMain'#4'Left'#3'\'#1#6'Height'#3#192#0#3'Top'#3#197
55
+#0#5'Width'#3#216#0#11'BorderIcons'#11#12'biSystemMenu'#10'biMinimize'#0#11
66
+'BorderStyle'#7#8'bsSingle'#7'Caption'#6#13#235#170#168#235#147#156' '#235
77
+#159#176#236#178#152#12'ClientHeight'#3#192#0#11'ClientWidth'#3#216#0#7'OnCl'
8-
+'ose'#7#9'FormClose'#8'OnCreate'#7#10'FormCreate'#8'Position'#7#16'poDefault'
9-
+'PosOnly'#10'LCLVersion'#6#7'1.6.0.4'#0#6'TImage'#7'ImgLogo'#4'Left'#2#8#6'H'
10-
+'eight'#2'Z'#3'Top'#2'`'#5'Width'#3#200#0#6'Center'#9#7'OnClick'#7#12'ImgLog'
11-
+'oClick'#12'Picture.Data'#10#4#7#0#0#23'TPortableNetworkGraphic'#232#6#0#0
12-
+#137'PNG'#13#10#26#10#0#0#0#13'IHDR'#0#0#0#195#0#0#0'['#8#3#0#0#0#249#148#193
13-
+#182#0#0#0#192'PLTE'#237#28'$'#187#187#187#136#136#136'DDD'#238#238#238#17#17
14-
+#17'fff"""'#221#221#221#204#204#204#153#153#153'UUUwww333'#170#170#170#242'Y'
15-
+'^'#238'+3'#250#194#197#247#149#153#249#179#182#248#164#167#251#210#211#244
16-
+'w|'#253#225#226#254#240#240#241'IP'#225#225#225#239':A'#245#134#138#243'hm'
17-
+#174#21#26'/'#6#7#235#235#235#226#226#226'o'#13#17'~'#15#19#190#190#190#222
18-
+#222#222#241#241#241#205#24#31#251#251#251#240#240#240#249#249#249#248#248
19-
+#248'?'#7#10#254#254#254#232#232#232#227#227#227#0#0#0#255#255#255#0#0#0#0#0
20-
+#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
21-
+#206#226#177'F'#0#0#0'2tRNS'#255#255#255#255#255#255#255#255#255#255#255#255
8+
+'ose'#7#9'FormClose'#8'OnCreate'#7#10'FormCreate'#6'OnShow'#7#8'FormShow'#8
9+
+'Position'#7#9'poDefault'#10'LCLVersion'#6#7'1.6.0.4'#0#6'TImage'#7'ImgLogo'
10+
+#4'Left'#2#8#6'Height'#2'Z'#3'Top'#2'`'#5'Width'#3#200#0#6'Center'#9#7'OnCli'
11+
+'ck'#7#12'ImgLogoClick'#12'Picture.Data'#10#4#7#0#0#23'TPortableNetworkGraph'
12+
+'ic'#232#6#0#0#137'PNG'#13#10#26#10#0#0#0#13'IHDR'#0#0#0#195#0#0#0'['#8#3#0#0
13+
+#0#249#148#193#182#0#0#0#192'PLTE'#237#28'$'#187#187#187#136#136#136'DDD'#238
14+
+#238#238#17#17#17'fff"""'#221#221#221#204#204#204#153#153#153'UUUwww333'#170
15+
+#170#170#242'Y^'#238'+3'#250#194#197#247#149#153#249#179#182#248#164#167#251
16+
+#210#211#244'w|'#253#225#226#254#240#240#241'IP'#225#225#225#239':A'#245#134
17+
+#138#243'hm'#174#21#26'/'#6#7#235#235#235#226#226#226'o'#13#17'~'#15#19#190
18+
+#190#190#222#222#222#241#241#241#205#24#31#251#251#251#240#240#240#249#249
19+
+#249#248#248#248'?'#7#10#254#254#254#232#232#232#227#227#227#0#0#0#255#255
20+
+#255#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
21+
+#0#0#0#0#0#0#206#226#177'F'#0#0#0'2tRNS'#255#255#255#255#255#255#255#255#255
2222
+#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
23-
+#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#0#13
24-
+'P'#152#239#0#0#0#1'bKGD?>c0u'#0#0#0#9'pHYs'#0#0#0'H'#0#0#0'H'#0'F'#201'k>'#0
25-
+#0#0#9'vpAg'#0#0#0#195#0#0#0'['#0#219#225'U'#140#0#0#5#12'IDATx'#218#237#153
26-
+#135#142#171':'#16'@q'#195#216#180#144#236#166'm'#238'}'#189'7'#252#255'?'
27-
+#247#236'1'#189'd'#201#13'-'#18'#'#173#132#137#215#204'a'#170#141's'#189'^'
28-
+#127#248#227'/'#245#202#226'\'#175#255#254#190#180#18'O3|'#191#180#10#207'3'
29-
+#252#247#207#210'*<'#207#240#235#210#26#140#192#240#231#210#26#140#192#176
30-
+#180#2#27#195#198#176'"'#217#24#214'!'#27#195':dcX'#135'l'#12#235#144#141'a'
31-
+#29#178'1'#172'C6'#134'u'#200','#12#167#228#253#133#25'No'#199#216#177#18#31
32-
+#15#175#201'ps'#170#178#219#159'_'#144'!v'#234#178'K^'#143#225#195'i'#202#219
33-
+#203'18'#206#199#237'p2W'#167#183#204'&'#227#135#247#180#12#239'qR'#25'%;'
34-
+#136#237'W`@'#8#209#30'$'#128'H'#30'Zm'#4#6#15#229#226#13']2MS'#212#243#211
35-
+#222'0'#220#230'f'#192'i)!'#166'C'#150#188#195'p'#154#196#153#30'aHS'#22'='
36-
+#199#160#22'c '#12'('#6'@'#12'f'#16#168#26':'#20'!'#145#221'+E'#162#166't'
37-
+#184#244#16#134#236#210#243#141'%>w'#167';'#12#137'a'#248#146#143#136'y)8'#31
38-
+'!'#253#178#178'{'#247#4#183'W}'#128'A'#169#160'{'#141#225#12#16#211#251#26
39-
+'C'#241'Rfb'#160'z'#224#23#131'V'#14#21#214#210'w'#24'.'#181'"'#167#245#229
40-
+#165'R'#5#131#139'['#194#203#187#29'K?'#196'`'#158'@'#224#194#11#184'MU2'#255
41-
+#201's!`'#184#235#245'3'#28#12#194'Gu5Y'#26#162'`'#232#248'gr'''#196#190#149
42-
+'A'#178'2'#225'z'#197#188'R'#186#31'x'#254#168#185#18'h'#230#22#134#152#139
43-
+#193#216'4W'#216#199#24#140#17#154#247#232#130'k'#235#236'u'#143'!'#174#155#1
44-
+'4'#243#10'C'#204#196'`'#220'D;Od'#8#236#131'#'#6'T'#230#14#179'n%'#220'>'
45-
+#134#163#211#232'4@3'#156#27'b&'#6#2'/'#141'Z'#189#203#223')'#213#246#224'E|'
46-
+'w3'#156'/'#173#214#27'4'#211#171'YC'#204#194#0#245'A'#191'lY'#171#18'Z})kjw'
47-
+'2'#188#183#17'2'#205'rC'#20#12#184']'#209#158'g'#128#156#230#134#198#209#3
48-
+#187'`PN'#208#174#19#232';ay'#167#139#193#182#221#141#13#144#213',7Dg}'#192
49-
+'c14'#218#165'z'#199#161''''#144'z'#233#233'`'#216#219#141'h'#227'P '#211',3'
50-
+#196'<'#12'6'#142'E'#171't'#146':U'#139#225'lwp'#151#230#14'.'#211#204#24#194
51-
+#235#169'qh,'#6'X'#205#207'UC'#157'-@'#229#17'M'#134#131#245#163'c'#235'L#'
52-
+#215#12'C'#142#152'#'#166'5'#4#19#25'C'#189#29#144#247#24#206#246'xf'#215'q'
53-
+#22#144'kf'#18#157'7'#11#3#13'm'#2'E-_Aw'#24#18'{'#178#17#159':'#214'.4'#3'C'
54-
+#204#147'['#25#20'e'#218'j'#30#189#222#152'>'#219#186'V'#233'/:5'#3'C'#204'S'
55-
+#227#132'-n<o'#252#170'Z'#187#181'Q'#246#192','#18#226#158#227#152'R3c'#136
56-
+#153#234#180#132#10#209'n&H'#173#234#229'?'#159#190'd'#7#148'}k'#151#154#25
57-
+'C'#200#153'z>3'#146'&'#185#242#202#206'!'#18#178#226'L4G'#204#141'p'#234']'
58-
+#187#162#25#134#173#196','#12#214#6'A'#217#225')*'#195#20#153#215#152#194#161
59-
+#135#135'Y'#158'i'#227#190't'#164#192'T'#184#166#25#133#237#200'<'#12'&9'#177
60-
+#159#161#237#224#166#249'&V'#227#200#214':'#18'V'#170#5'4H'#151#219#254#144
61-
+#12'`'#0'7'#205#24'BR'#138#156#128#1'<'#151#255#226'7'#235'[Y'#206'Y'#148'1T'
62-
+'O'#187#227'c'#29#165#205'`2'#197#148#189'F'#237#134#128#12#139#10#138'0'#128
63-
+#222'2'#178'{S'#22#208','#166#207#173#19'o@yKz'#24#228't'#12#189'B'#17#244'3'
64-
+#229'q'#143#25'W'#14#9'N'#199'x'#231't'#201#183'>p'#2#134'A'#146#28#246'M'
65-
+#148#203#2#12#233#8#242#221#223'?'#254#244#245'7'#203#240#245#217#197#230#182
66-
+'C]'#222#147#253'-^'#215'w '#17')'#130#204#5#238'9'#251#211#225'?'#195#155'y'
67-
+#138'A'#171'n'#25'z'''#4#3'W'#154#154'!Hy'#164'\'#157'~|*x'#234'R'#21#184')7'
68-
,'C'#193#185' .'#211'{'#10')'#21#9#204#205#136#165'.'#232'-HJ'#132#158'`J'#148
69-
+'n>X1'#129#167'd'#208'7'#140'Q'#25#176#171#4'W'#1'V"T\(W'#191#251#128#234#23
70-
+',8u]J|'#133'}c'#16#157#200'}'#172#24#162'>'#180#180#250#26#19'='#193'd^'#236
71-
+#211'(,'''#144'!'#159'0'#198'e '#186#242'3'#228'i'#12#137#152'n&'#136#241#31
72-
+#143#169' '#200'|'#9#17'`0'#174#165'/'#205'PK'#10#127'6N'#172#191#21#19'&'
73-
+#144'O'#25'0'#28'o'#135#130'Q'#20'"'#243#153#195#232#228'K'#237#24#15'0x'#229
74-
+#4#186#128'/'#153'0'#160#10#135'z'#147#195#16#248#18'2'#157'E'#168#218#12#13
75-
+'_'#202#24#204#10#204#203'''('#215#253'L'#165#209#25'lD'#234#13'h'#164#178
76-
+#136#4#223#224#216#28#178#202#6#3#226#169'e'#128#152#206's.'#172'PLX '#166'{'
77-
+#200'X'#231#151'^'#157#181#164#255#232'Z'#11'1D'#188';'#243#7#156#192#241#205
78-
+'+0P'#212#243#131'@'#227'{'#202'D'#12'+'#147#141'a'#29#178'1'#172'C6'#134'u'
79-
+#200#198#176#14#217#24#214'!'#27#195':dcX'#135'l'#12#235#144#255#1#217'6R'
80-
+#189#214'V'#228#175#0#0#0'%tEXtcreate-date'#0'2009-07-05T17:58:39+09:00'#248
81-
+#222#188'a'#0#0#0'%tEXtmodify-date'#0'2009-07-05T17:58:39+09:00'#167'o'#202
82-
+'U'#0#0#0#0'IEND'#174'B`'#130#11'Transparent'#9#0#0#9'TComboBox'#7'ModList'#4
83-
+'Left'#2#8#6'Height'#2#23#3'Top'#2#8#5'Width'#3#200#0#10'ItemHeight'#2#15#5
84-
+'Style'#7#14'csDropDownList'#8'TabOrder'#2#0#0#0#7'TButton'#6'BtnRun'#4'Left'
85-
+#2#8#6'Height'#2#25#3'Top'#2' '#5'Width'#2'`'#7'Caption'#6#6#236#139#164#237
86-
+#150#137#7'OnClick'#7#11'BtnRunClick'#8'TabOrder'#2#1#0#0#7'TButton'#9'BtnRu'
87-
+'nWin'#4'Left'#2'p'#6'Height'#2#25#3'Top'#2' '#5'Width'#2'`'#7'Caption'#6#16
88-
+#236#176#189#235#170#168#235#147#156' '#236#139#164#237#150#137#7'OnClick'#7
89-
+#14'BtnRunWinClick'#8'TabOrder'#2#2#0#0#7'TButton'#6'BtnMod'#4'Left'#2#8#6'H'
90-
+'eight'#2#25#3'Top'#2'@'#5'Width'#2'`'#7'Caption'#6#17#235#170#168#235#147
91-
+#156'AI'#237#153#156#236#132#177#237#153#148#7'OnClick'#7#11'BtnModClick'#8
92-
+'TabOrder'#2#3#0#0#7'TButton'#10'BtnRestore'#4'Left'#2'p'#6'Height'#2#25#3'T'
93-
+'op'#2'@'#5'Width'#2'`'#7'Caption'#6#14#236#155#144#235#158#152'AI'#235#179
23+
+#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
24+
+#255#255#0#13'P'#152#239#0#0#0#1'bKGD?>c0u'#0#0#0#9'pHYs'#0#0#0'H'#0#0#0'H'#0
25+
+'F'#201'k>'#0#0#0#9'vpAg'#0#0#0#195#0#0#0'['#0#219#225'U'#140#0#0#5#12'IDATx'
26+
+#218#237#153#135#142#171':'#16'@q'#195#216#180#144#236#166'm'#238'}'#189'7'
27+
+#252#255'?'#247#236'1'#189'd'#201#13'-'#18'#'#173#132#137#215#204'a'#170#141
28+
+'s'#189'^'#127#248#227'/'#245#202#226'\'#175#255#254#190#180#18'O3|'#191#180
29+
+#10#207'3'#252#247#207#210'*<'#207#240#235#210#26#140#192#240#231#210#26#140
30+
+#192#176#180#2#27#195#198#176'"'#217#24#214'!'#27#195':dcX'#135'l'#12#235#144
31+
+#141'a'#29#178'1'#172'C6'#134'u'#200','#12#167#228#253#133#25'No'#199#216#177
32+
+#18#31#15#175#201'ps'#170#178#219#159'_'#144'!v'#234#178'K^'#143#225#195'i'
33+
+#202#219#203'18'#206#199#237'p2W'#167#183#204'&'#227#135#247#180#12#239'qR'
34+
+#25'%;'#136#237'W`@'#8#209#30'$'#128'H'#30'Zm'#4#6#15#229#226#13']2MS'#212
35+
+#243#211#222'0'#220#230'f'#192'i)!'#166'C'#150#188#195'p'#154#196#153#30'aHS'
36+
+#22'='#199#160#22'c '#12'('#6'@'#12'f'#16#168#26':'#20'!'#145#221'+E'#162
37+
+#166't'#184#244#16#134#236#210#243#141'%>w'#167';'#12#137'a'#248#146#143#136
38+
+'y)8'#31'!'#253#178#178'{'#247#4#183'W}'#128'A'#169#160'{'#141#225#12#16#211
39+
+#251#26'C'#241'Rfb'#160'z'#224#23#131'V'#14#21#214#210'w'#24'.'#181'"'#167
40+
+#245#229#165'R'#5#131#139'['#194#203#187#29'K?'#196'`'#158'@'#224#194#11#184
41+
+'MU2'#255#201's!`'#184#235#245'3'#28#12#194'Gu5Y'#26#162'`'#232#248'gr'''#196
42+
+#190#149'A'#178'2'#225'z'#197#188'R'#186#31'x'#254#168#185#18'h'#230#22#134
43+
+#152#139#193#216'4W'#216#199#24#140#17#154#247#232#130'k'#235#236'u'#143'!'
44+
+#174#155#1'4'#243#10'C'#204#196'`'#220'D;Od'#8#236#131'#'#6'T'#230#14#179'n%'
45+
+#220'>'#134#163#211#232'4@3'#156#27'b&'#6#2'/'#141'Z'#189#203#223')'#213#246
46+
+#224'E|w3'#156'/'#173#214#27'4'#211#171'YC'#204#194#0#245'A'#191'lY'#171#18
47+
+'Z})kjw2'#188#183#17'2'#205'rC'#20#12#184']'#209#158'g'#128#156#230#134#198
48+
+#209#3#187'`PN'#208#174#19#232';ay'#167#139#193#182#221#141#13#144#213',7Dg}'
49+
+#192'c14'#218#165'z'#199#161''''#144'z'#233#233'`'#216#219#141'h'#227'P '#211
50+
+',3'#196'<'#12'6'#142'E'#171't'#146':U'#139#225'lwp'#151#230#14'.'#211#204#24
51+
+#194#235#169'qh,'#6'X'#205#207'UC'#157'-@'#229#17'M'#134#131#245#163'c'#235
52+
+'L#'#215#12'C'#142#152'#'#166'5'#4#19#25'C'#189#29#144#247#24#206#246'xf'#215
53+
+'q'#22#144'kf'#18#157'7'#11#3#13'm'#2'E-_Aw'#24#18'{'#178#17#159':'#214'.4'#3
54+
+'C'#204#147'['#25#20'e'#218'j'#30#189#222#152'>'#219#186'V'#233'/:5'#3'C'#204
55+
+'S'#227#132'-n<o'#252#170'Z'#187#181'Q'#246#192','#18#226#158#227#152'R3c'
56+
+#136#153#234#180#132#10#209'n&H'#173#234#229'?'#159#190'd'#7#148'}k'#151#154
57+
+#25'C'#200#153'z>3'#146'&'#185#242#202#206'!'#18#178#226'L4G'#204#141'p'#234
58+
+']'#187#162#25#134#173#196','#12#214#6'A'#217#225')*'#195#20#153#215#152#194
59+
+#161#135#135'Y'#158'i'#227#190't'#164#192'T'#184#166#25#133#237#200'<'#12'&9'
60+
+#177#159#161#237#224#166#249'&V'#227#200#214':'#18'V'#170#5'4H'#151#219#254
61+
+#144#12'`'#0'7'#205#24'BR'#138#156#128#1'<'#151#255#226'7'#235'[Y'#206'Y'#148
62+
+'1TO'#187#227'c'#29#165#205'`2'#197#148#189'F'#237#134#128#12#139#10#138'0'
63+
+#128#222'2'#178'{S'#22#208','#166#207#173#19'o@yKz'#24#228't'#12#189'B'#17
64+
+#244'3'#229'q'#143#25'W'#14#9'N'#199'x'#231't'#201#183'>p'#2#134'A'#146#28
65+
+#246'M'#148#203#2#12#233#8#242#221#223'?'#254#244#245'7'#203#240#245#217#197
66+
+#230#182'C]'#222#147#253'-^'#215'w '#17')'#130#204#5#238'9'#251#211#225'?'
67+
+#195#155'y'#138'A'#171'n'#25'z'''#4#3'W'#154#154'!Hy'#164'\'#157'~|*x'#234'R'
68+
,#21#184')7C'#193#185' .'#211'{'#10')'#21#9#204#205#136#165'.'#232'-HJ'#132
69+
+#158'`J'#148'n>X1'#129#167'd'#208'7'#140'Q'#25#176#171#4'W'#1'V"T\(W'#191#251
70+
+#128#234#23',8u]J|'#133'}c'#16#157#200'}'#172#24#162'>'#180#180#250#26#19'='
71+
+#193'd^'#236#211'(,'''#144'!'#159'0'#198'e '#186#242'3'#228'i'#12#137#152'n&'
72+
+#136#241#31#143#169' '#200'|'#9#17'`0'#174#165'/'#205'PK'#10#127'6N'#172#191
73+
+#21#19'&'#144'O'#25'0'#28'o'#135#130'Q'#20'"'#243#153#195#232#228'K'#237#24
74+
+#15'0x'#229#4#186#128'/'#153'0'#160#10#135'z'#147#195#16#248#18'2'#157'E'#168
75+
+#218#12#13'_'#202#24#204#10#204#203'''('#215#253'L'#165#209#25'lD'#234#13'h'
76+
+#164#178#136#4#223#224#216#28#178#202#6#3#226#169'e'#128#152#206's.'#172'PLX'
77+
+' '#166'{'#200'X'#231#151'^'#157#181#164#255#232'Z'#11'1D'#188';'#243#7#156
78+
+#192#241#205'+0P'#212#243#131'@'#227'{'#202'D'#12'+'#147#141'a'#29#178'1'#172
79+
+'C6'#134'u'#200#198#176#14#217#24#214'!'#27#195':dcX'#135'l'#12#235#144#255#1
80+
+#217'6R'#189#214'V'#228#175#0#0#0'%tEXtcreate-date'#0'2009-07-05T17:58:39+09'
81+
+':00'#248#222#188'a'#0#0#0'%tEXtmodify-date'#0'2009-07-05T17:58:39+09:00'#167
82+
+'o'#202'U'#0#0#0#0'IEND'#174'B`'#130#11'Transparent'#9#0#0#9'TComboBox'#7'Mo'
83+
+'dList'#4'Left'#2#8#6'Height'#2#23#3'Top'#2#8#5'Width'#3#200#0#10'ItemHeight'
84+
+#2#15#5'Style'#7#14'csDropDownList'#8'TabOrder'#2#0#0#0#7'TButton'#6'BtnRun'
85+
+#4'Left'#2#8#6'Height'#2#25#3'Top'#2' '#5'Width'#2'`'#7'Caption'#6#6#236#139
86+
+#164#237#150#137#7'OnClick'#7#11'BtnRunClick'#8'TabOrder'#2#1#0#0#7'TButton'
87+
+#9'BtnRunWin'#4'Left'#2'p'#6'Height'#2#25#3'Top'#2' '#5'Width'#2'`'#7'Captio'
88+
+'n'#6#16#236#176#189#235#170#168#235#147#156' '#236#139#164#237#150#137#7'On'
89+
+'Click'#7#14'BtnRunWinClick'#8'TabOrder'#2#2#0#0#7'TButton'#6'BtnMod'#4'Left'
90+
+#2#8#6'Height'#2#25#3'Top'#2'@'#5'Width'#2'`'#7'Caption'#6#17#235#170#168#235
91+
+#147#156'AI'#237#153#156#236#132#177#237#153#148#7'OnClick'#7#11'BtnModClick'
92+
+#8'TabOrder'#2#3#0#0#7'TButton'#10'BtnRestore'#4'Left'#2'p'#6'Height'#2#25#3
93+
+'Top'#2'@'#5'Width'#2'`'#7'Caption'#6#14#236#155#144#235#158#152'AI'#235#179
9494
+#181#234#181#172#7'OnClick'#7#15'BtnRestoreClick'#8'TabOrder'#2#4#0#0#0
9595
]);

src/mainform.pas

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ TFormMain = class(TForm)
2727
procedure BtnRunWinClick(Sender: TObject);
2828
procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
2929
procedure FormCreate(Sender: TObject);
30+
procedure FormShow(Sender: TObject);
3031
procedure ImgLogoClick(Sender: TObject);
3132
private
3233
{ private declarations }
@@ -41,6 +42,9 @@ TFormMain = class(TForm)
4142
procedure ActivateMod( mod_name: string );
4243
procedure DeactivateMod( mod_name: string );
4344

45+
procedure SavePos();
46+
procedure LoadPos();
47+
4448
public
4549
{ public declarations }
4650
end;
@@ -108,6 +112,11 @@ procedure TFormMain.FormCreate(Sender: TObject);
108112
ScanScripts();
109113
end;
110114

115+
procedure TFormMain.FormShow(Sender: TObject);
116+
begin
117+
LoadPos();
118+
end;
119+
111120
// Launch the game and wait for it to finish.
112121
procedure TFormMain.LaunchGame( mod_name: string; params: string );
113122
var
@@ -184,6 +193,19 @@ procedure TFormMain.DeactivateMod( mod_name: string );
184193
zbigs.clear;
185194
end;
186195

196+
procedure TFormMain.SavePos;
197+
begin
198+
settings.conf.SetValue( '/dialog/left', Left );
199+
settings.conf.SetValue( '/dialog/top', Top );
200+
end;
201+
202+
procedure TFormMain.LoadPos;
203+
begin
204+
Left := settings.conf.GetValue( '/dialog/left', Left );
205+
Top := settings.conf.GetValue( '/dialog/top', Top );
206+
SetBounds( Left, Top, Width, Height );
207+
end;
208+
187209
procedure TFormMain.BtnRunClick(Sender: TObject);
188210
begin
189211
LaunchGame( ModList.Text, '' );
@@ -196,7 +218,9 @@ procedure TFormMain.BtnRunWinClick(Sender: TObject);
196218

197219
procedure TFormMain.FormClose(Sender: TObject; var CloseAction: TCloseAction);
198220
begin
221+
SavePos();
199222
zbigs.free;
223+
settings.free;
200224
end;
201225

202226
procedure TFormMain.BtnModClick(Sender: TObject);

src/settings.pas

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ interface
1515

1616
TSettings = class
1717
private
18-
conf: TJsonConfig;
1918
json_fname: string;
2019

2120
procedure GetDirs();
@@ -30,15 +29,17 @@ TSettings = class
3029
procedure SetGameDir(AValue: string);
3130

3231
public
32+
conf: TJsonConfig;
3333
game_exe: string;
3434
script: string;
3535
dscript: string;
3636
//moddir: string;
3737

38+
constructor create();
39+
procedure free();
40+
3841
property
3942
game_dir: string read GetGameDir write SetGameDir;
40-
constructor create();
41-
destructor destroy();
4243
end;
4344

4445
implementation
@@ -50,7 +51,7 @@ constructor TSettings.create();
5051
GetDirs();
5152
end;
5253

53-
destructor TSettings.destroy();
54+
procedure TSettings.free();
5455
begin
5556
conf.free();
5657
end;
@@ -62,18 +63,14 @@ procedure TSettings.LoadConf();
6263
// Compute JSON fname
6364
config_dir := GetAppConfigDir( false );
6465
// Check if config dir exists, create if not.
65-
if( DirectoryExists( config_dir ) ) then
66+
if( not DirectoryExists( config_dir ) ) then
6667
begin
6768
CreateDir( config_dir );
6869
end;
6970

7071
json_fname := 'config.json';
7172
json_fname := path_join( config_dir, json_fname );
72-
if( FileExists( json_fname ) ) then
73-
begin
74-
// Load it
75-
conf.Filename := json_fname;
76-
end;
73+
conf.Filename := json_fname; // created if NE. loads if E.
7774
end;
7875

7976
function TSettings.GetInstallDir(): string;
@@ -103,7 +100,7 @@ function TSettings.GetInstallDir(): string;
103100
if diag.Execute then
104101
begin
105102
filename := diag.Filename;
106-
ShowMessage(filename);
103+
result := ExtractFilePath( filename );
107104
end;
108105
finally
109106
diag.free;
@@ -113,7 +110,7 @@ function TSettings.GetInstallDir(): string;
113110

114111
procedure TSettings.SetGameDir(AValue: string);
115112
begin
116-
conf.SetValue( 'game_dir', AValue );
113+
conf.SetValue( 'game_dir', Utf8Decode(AValue) );
117114
end;
118115

119116
// get directories we need for the launcher.
@@ -127,13 +124,12 @@ procedure TSettings.GetDirs();
127124
//dataleaf := GenReg( 'UserDataLeafName' );
128125
//moddir := mydoc + dataleaf;
129126

130-
// Well, attempt to read reg if game_dir is empty.
127+
// Well, config load failed. Attempt to read reg or read user input...
131128
if( game_dir = '' ) then
132129
begin
133130
game_dir := GetInstallDir();
134131
end;
135132

136-
// Attempt to read registry for installdir
137133
// we are ready to calculate now.
138134
installdir := IncludeTrailingPathDelimiter( game_dir );
139135
game_exe := installdir + 'generals.exe';
@@ -148,7 +144,7 @@ procedure TSettings.GetDirs();
148144

149145
function TSettings.GetGameDir(): string;
150146
begin
151-
result := conf.GetValue( 'game_dir', '' );
147+
result := Utf8Encode( conf.GetValue( 'game_dir', '' ) );
152148
end;
153149

154150
// read values from
@@ -165,7 +161,7 @@ function TSettings.GenReg( t: string ): string;
165161
Result := reg.ReadString( t )
166162
else begin
167163
Result := '';
168-
Warning( '제로아워 레지스트리값 ' + t + ' 읽기 실패' );
164+
Warning( '제로아워 레지스트리값 ' + t + ' 읽기 실패, Generals.exe를 직접 골라주세요.' );
169165
end;
170166
finally
171167
reg.Free;

0 commit comments

Comments
 (0)