OSDN Git Service

・スキンのガイドラインに準拠。
[gikonavigoeson/gikonavi.git] / Option.pas
1 unit Option;
2
3 interface
4
5 uses
6         Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
7         ComCtrls, StdCtrls, ExtCtrls, Dialogs, FileCtrl, MMSystem,
8         GikoSystem, GikoUtil, Buttons, UrlMon, Menus, ImgList;
9
10 type
11         TOptionDialog = class(TForm)
12                 OkBotton: TButton;
13                 CancelBotton: TButton;
14                 OptionTab: TPageControl;
15                 ConnectSheet: TTabSheet;
16                 Font1Sheet: TTabSheet;
17     ApplyButton: TButton;
18                 FontDialog: TFontDialog;
19                 ColorDialog: TColorDialog;
20     ReadProxyGroupBox: TGroupBox;
21     ReadAddressLabel: TLabel;
22                 ReadPortLabel: TLabel;
23     ReadProxyCheck: TCheckBox;
24     ReadProxyAddressEdit: TEdit;
25     ReadPortEdit: TEdit;
26     ReadProxyUserIDEdit: TEdit;
27     ReadProxyPasswordEdit: TEdit;
28                 ReadUserIDLabel: TLabel;
29                 ReadPasswordLabel: TLabel;
30                 FolderSheet: TTabSheet;
31     FolderGroupBox: TGroupBox;
32                 LogFolderEdit: TEdit;
33     LogFolderButton: TButton;
34     Label1: TLabel;
35                 Label2: TLabel;
36     ThreadSheet: TTabSheet;
37     SoundSheet: TTabSheet;
38     SoundEventGroupBox: TGroupBox;
39                 SoundListView: TListView;
40     SoundReferButton: TButton;
41     SoundFileEdit: TEdit;
42     OpenDialog: TOpenDialog;
43     WriteProxyGroupBox: TGroupBox;
44     WriteAddressLabel: TLabel;
45     WritePortLabel: TLabel;
46     WriteUserIDLabel: TLabel;
47     WritePasswordLabel: TLabel;
48     WriteProxyCheck: TCheckBox;
49     WriteProxyAddressEdit: TEdit;
50     WritePortEdit: TEdit;
51     WriteProxyUserIDEdit: TEdit;
52     WriteProxyPasswordEdit: TEdit;
53     BoardSheet: TTabSheet;
54     GroupBox4: TGroupBox;
55     BoardURL2chEdit: TEdit;
56     Label13: TLabel;
57     UserIDSheet: TTabSheet;
58                 GroupBox3: TGroupBox;
59     Label9: TLabel;
60                 Label10: TLabel;
61     UserIDEdit: TEdit;
62     PasswordEdit: TEdit;
63     SoundPlayButton: TBitBtn;
64                 AutoLoginCheckBox: TCheckBox;
65     Tora3URLLabel: TLabel;
66     Label12: TLabel;
67     Label5: TLabel;
68     GroupBox5: TGroupBox;
69     ComboBox1: TComboBox;
70     Label6: TLabel;
71     Label7: TLabel;
72     Label8: TLabel;
73     ComboBox2: TComboBox;
74     ComboBox3: TComboBox;
75     Label4: TLabel;
76     Edit1: TEdit;
77     Button1: TButton;
78     CabinetFontBotton: TButton;
79     CabinetColorBotton: TButton;
80     CabinetDefaultButton: TButton;
81     CabinetMemo: TMemo;
82     ListMemo: TMemo;
83     ListFontBotton: TButton;
84     ListColorBotton: TButton;
85     ListDefaultBotton: TButton;
86     HintFontButton: TButton;
87     HintBackButton: TButton;
88     HintDefaultButton: TButton;
89     HintMemo: TMemo;
90                 EditorMemo: TMemo;
91     EditorFontBotton: TButton;
92     EditorColorBotton: TButton;
93     EditorDefaultBotton: TButton;
94                 BrowserTabMemo: TMemo;
95     BruwserTabFontButton: TButton;
96     BrowserTabDefaultButton: TButton;
97     Bevel1: TBevel;
98     Bevel2: TBevel;
99     GroupBox1: TGroupBox;
100     GroupBox2: TGroupBox;
101     URLAppCheckBox: TCheckBox;
102     AppFolderLabel: TLabel;
103     AppFolderEdit: TEdit;
104     AppFolderButton: TButton;
105     OpenMailerCheckBox: TCheckBox;
106     TabSheet1: TTabSheet;
107     PopupPositionRadioGroup: TRadioGroup;
108     TabAddRadioGroup: TRadioGroup;
109     TabSheet2: TTabSheet;
110     GroupBox7: TGroupBox;
111     URLDisplayCheckBox: TCheckBox;
112     Label3: TLabel;
113     Label11: TLabel;
114     TabStopAddressBarCheckBox: TCheckBox;
115     AddressHistoryCountEdit: TEdit;
116     LinkAddCheckBox: TCheckBox;
117     GroupBox8: TGroupBox;
118     PreviewVisibleCheckBox: TCheckBox;
119     PreviewSizeComboBox: TComboBox;
120     Label14: TLabel;
121     Label15: TLabel;
122     PreviewWaitEdit: TEdit;
123     Label16: TLabel;
124     ShowMailCheckBox: TCheckBox;
125     TabSheet3: TTabSheet;
126     GroupBox9: TGroupBox;
127     ThreadListIconCheckBox: TCheckBox;
128     GroupBox6: TGroupBox;
129     LogDeleteMessageCheckBox: TCheckBox;
130     GroupBox10: TGroupBox;
131     UnActivePopupCheckBox: TCheckBox;
132     GroupBox11: TGroupBox;
133     RecvBufferSize: TEdit;
134     Label17: TLabel;
135     ProxyProtocolCheckBox: TCheckBox;
136     ProtocolCheckBox: TCheckBox;
137     Label18: TLabel;
138     Label19: TLabel;
139     Bevel5: TBevel;
140     Label20: TLabel;
141     Label21: TLabel;
142     Label22: TLabel;
143     Label23: TLabel;
144     TabSheet4: TTabSheet;
145     lblSFont: TLabel;
146     GroupBox12: TGroupBox;
147     CSSCheckBox: TCheckBox;
148     CSSListLabel: TLabel;
149     CSSListView: TListView;
150     GroupBox13: TGroupBox;
151     PostTimeCheckBox: TCheckBox;
152     Label24: TLabel;
153     Label25: TLabel;
154     PostTimeEdit: TEdit;
155     PostTimeLabel: TLabel;
156     Label27: TLabel;
157     PutPostTimeRadioButton: TRadioButton;
158     BackPostTimeRadioButton: TRadioButton;
159     ResPopupBoldCheckBox: TCheckBox;
160     NGwordSheet: TTabSheet;
161     GroupBox14: TGroupBox;
162     RloCheckBox: TCheckBox;
163     ReplaceulCheckBox: TCheckBox;
164     PopUpAbonCheckBox: TCheckBox;
165                 procedure FormCreate(Sender: TObject);
166                 procedure FormDestroy(Sender: TObject);
167                 procedure ApplyButtonClick(Sender: TObject);
168                 procedure CabinetFontBottonClick(Sender: TObject);
169                 procedure CabinetColorBottonClick(Sender: TObject);
170                 procedure EditorFontBottonClick(Sender: TObject);
171                 procedure OkBottonClick(Sender: TObject);
172                 procedure ReadProxyCheckClick(Sender: TObject);
173                 procedure ListFontBottonClick(Sender: TObject);
174                 procedure ListColorBottonClick(Sender: TObject);
175                 procedure EditorColorBottonClick(Sender: TObject);
176                 procedure CabinetDefaultButtonClick(Sender: TObject);
177                 procedure ReadPortEditExit(Sender: TObject);
178                 procedure ListDefaultBottonClick(Sender: TObject);
179                 procedure EditorDefaultBottonClick(Sender: TObject);
180                 procedure HintFontButtonClick(Sender: TObject);
181                 procedure HintBackButtonClick(Sender: TObject);
182                 procedure HintDefaultButtonClick(Sender: TObject);
183                 procedure LogFolderButtonClick(Sender: TObject);
184                 procedure FormClose(Sender: TObject; var Action: TCloseAction);
185                 procedure SoundReferButtonClick(Sender: TObject);
186                 procedure SoundPlayButtonClick(Sender: TObject);
187                 procedure SoundListViewChanging(Sender: TObject; Item: TListItem;
188       Change: TItemChange; var AllowChange: Boolean);
189                 procedure SoundFileEditChange(Sender: TObject);
190                 procedure OptionTabChange(Sender: TObject);
191                 procedure AppFolderButtonClick(Sender: TObject);
192                 procedure WriteProxyCheckClick(Sender: TObject);
193                 procedure WritePortEditExit(Sender: TObject);
194                 procedure Tora3URLLabelClick(Sender: TObject);
195                 procedure HotKeyEnter(Sender: TObject);
196                 procedure HotKeyExit(Sender: TObject);
197                 procedure URLAppCheckBoxClick(Sender: TObject);
198                 procedure BruwserTabFontButtonClick(Sender: TObject);
199                 procedure BrowserTabDefaultButtonClick(Sender: TObject);
200     procedure AddressHistoryCountEditExit(Sender: TObject);
201     procedure PreviewWaitEditExit(Sender: TObject);
202                 procedure RecvBufferSizeExit(Sender: TObject);
203     procedure CSSCheckBoxClick(Sender: TObject);
204     procedure PostTimeEditExit(Sender: TObject);
205     procedure PostTimeCheckBoxClick(Sender: TObject);
206         private
207                 { Private \90é\8c¾ }
208                 FClose: Boolean;
209                 function GetMemoText(font: TFont; text: string): string;
210 //              function GetFontText(Font: TFont; Text: string): string;
211                 procedure SetValue;
212                 procedure SaveSetting;
213                 procedure SettingApply;
214                 function CheckFolder: Boolean;
215         procedure SetAbonpropertys;
216         public
217                 { Public \90é\8c¾ }
218         end;
219
220 var
221         OptionDialog: TOptionDialog;
222
223 implementation
224
225 uses
226         Giko, Editor, Setting, ActnList;
227
228 const
229         FONT_TEXT: string = '%s %d pt';
230         MEMO_CABINET: string = '\83L\83\83\83r\83l\83b\83g';
231         MEMO_THREAD: string = '\83X\83\8c\83b\83h\83\8a\83X\83g';
232         MEMO_BROWSERPOPUP: string = '\83u\83\89\83E\83U\83|\83b\83v\83A\83b\83v';
233         MEMO_BROWSERTAB: string = '\83u\83\89\83E\83U\83^\83u';
234         MEMO_EDITOR: string = '\83G\83f\83B\83^\83e\83L\83X\83g';
235         DEFAULT_FONT_NAME: string = '\82l\82\82o\83S\83V\83b\83N';
236         DEFAULT_FONT_SIZE: Integer = 9;
237         DEFAULT_TABFONT_NAME: string = '\82l\82\82o\83S\83V\83b\83N';
238         DEFAULT_TABFONT_SIZE: Integer = 9;
239         URL_TORA3: WideString = 'http://2ch.tora3.net/';
240
241 {$R *.DFM}
242
243 procedure TOptionDialog.FormCreate(Sender: TObject);
244 begin
245         FClose := True;
246
247         OptionTab.ActivePage := ConnectSheet;
248         SetValue;
249
250         CabinetMemo.Text := GetMemoText(CabinetMemo.Font, MEMO_CABINET);
251         ListMemo.Text := GetMemoText(ListMemo.Font, MEMO_THREAD);
252         HintMemo.Text := GetMemoText(HintMemo.Font, MEMO_BROWSERPOPUP);
253         BrowserTabMemo.Text := GetMemoText(BrowserTabMemo.Font, MEMO_BROWSERTAB);
254         EditorMemo.Text := GetMemoText(EditorMemo.Font, MEMO_EDITOR);
255
256         Tora3URLLabel.Cursor := 5;
257         lblSFont.Caption := '\81\9a\8fd\97v\81\9a'#13#10#13#10
258                                                                                 + '\83X\83\8c\83b\83h\95\\8e¦\83G\83\8a\83A\82Ì\83t\83H\83\93\83g\95Ï\8dX\82Í\81A'#13#10
259                                                                                 + '\81u\83X\83^\83C\83\8b\83V\81[\83g\81v\83^\83u\82Å\90Ý\92è\8fo\97\88\82Ü\82·';
260         CSSCheckBoxClick(Sender);
261         PostTimeCheckBoxClick(Sender);
262 end;
263
264 procedure TOptionDialog.FormDestroy(Sender: TObject);
265 begin
266         sndPlaySound(nil, SND_ASYNC);
267 end;
268
269 procedure TOptionDialog.OkBottonClick(Sender: TObject);
270 begin
271         FClose := True;
272         RecvBufferSizeExit(Sender);
273         ReadPortEditExit(Sender);
274         WritePortEditExit(Sender);
275         AddressHistoryCountEditExit(Sender);
276         PreviewWaitEditExit(Sender);
277         PostTimeEditExit(Sender);
278
279         if not CheckFolder then begin
280                 FClose := False;
281                 Exit;
282         end;
283         SaveSetting;
284         SettingApply;
285   SetAbonpropertys;
286 end;
287
288 procedure TOptionDialog.ApplyButtonClick(Sender: TObject);
289 begin
290         RecvBufferSizeExit(Sender);
291         ReadPortEditExit(Sender);
292         WritePortEditExit(Sender);
293         AddressHistoryCountEditExit(Sender);
294         PreviewWaitEditExit(Sender);
295         PostTimeEditExit(Sender);
296
297         if not CheckFolder then begin
298                 FClose := False;
299                 Exit;
300         end;
301         SaveSetting;
302         SettingApply;
303   SetAbonpropertys;
304         FClose := False;
305 end;
306
307 //function TOptionDialog.GetFontText(Font: TFont; Text: string): string;
308 //begin
309 //      result := Format(Text, [Font.Name, Font.Size]);
310 //end;
311
312 function TOptionDialog.GetMemoText(font: TFont; text: string): string;
313 var
314         s: string;
315 begin
316         s := '';
317         if font <> nil then
318                 s := Format(FONT_TEXT, [Font.Name, Font.Size]) + #13#10;
319         Result := s + text;
320 end;
321
322 //\83L\83\83\83r\83l\83b\83g\83t\83H\83\93\83g\83{\83^\83\93
323 procedure TOptionDialog.CabinetFontBottonClick(Sender: TObject);
324 begin
325         FontDialog.Options := [fdAnsiOnly, fdEffects];
326         FontDialog.Font.Assign(CabinetMemo.Font);
327         if FontDialog.Execute then begin
328                 FontDialog.Font.Style := FontDialog.Font.Style - [fsUnderline] - [fsStrikeout];
329                 CabinetMemo.Font.Assign(FontDialog.Font);
330                 CabinetMemo.Text := GetMemoText(CabinetMemo.Font, MEMO_CABINET);
331                 CabinetMemo.Font.Charset := SHIFTJIS_CHARSET;
332         end;
333 end;
334
335 //\83L\83\83\83r\83l\83b\83g\94w\8ci\90F\83{\83^\83\93
336 procedure TOptionDialog.CabinetColorBottonClick(Sender: TObject);
337 begin
338         ColorDialog.Color := CabinetMemo.Color;
339         if ColorDialog.Execute then begin
340                 CabinetMemo.Color := ColorDialog.Color;
341         end;
342 end;
343
344 //\83L\83\83\83r\83l\83b\83g\83f\83t\83H\83\8b\83g\83{\83^\83\93
345 procedure TOptionDialog.CabinetDefaultButtonClick(Sender: TObject);
346 begin
347         CabinetMemo.Font.Name := DEFAULT_FONT_NAME;
348         CabinetMemo.Font.Size := DEFAULT_FONT_SIZE;
349         CabinetMemo.Font.Color := clWindowText;
350         CabinetMemo.Font.Style := [];
351         CabinetMemo.Color := clWindow;
352         CabinetMemo.Text := GetMemoText(CabinetMemo.Font, MEMO_CABINET);
353 end;
354
355 //\83X\83\8c\83b\83h\83\8a\83X\83g\83t\83H\83\93\83g\83{\83^\83\93
356 procedure TOptionDialog.ListFontBottonClick(Sender: TObject);
357 begin
358         FontDialog.Options := [fdAnsiOnly, fdEffects];
359         FontDialog.Font.Assign(ListMemo.Font);
360         if FontDialog.Execute then begin
361                 ListMemo.Font.Assign(FontDialog.Font);
362                 ListMemo.Text := GetMemoText(ListMemo.Font, MEMO_THREAD);
363                 ListMemo.Font.Charset := SHIFTJIS_CHARSET;
364         end;
365 end;
366
367 //\83X\83\8c\83b\83h\83\8a\83X\83g\94w\8ci\90F\83{\83^\83\93
368 procedure TOptionDialog.ListColorBottonClick(Sender: TObject);
369 begin
370         ColorDialog.Color := ListMemo.Color;
371         if ColorDialog.Execute then begin
372                 ListMemo.Color := ColorDialog.Color;
373         end;
374 end;
375
376 //\83X\83\8c\83b\83h\83\8a\83X\83g\83f\83t\83H\83\8b\83g\83{\83^\83\93
377 procedure TOptionDialog.ListDefaultBottonClick(Sender: TObject);
378 begin
379         ListMemo.Font.Name := DEFAULT_FONT_NAME;
380         ListMemo.Font.Size := DEFAULT_FONT_SIZE;
381         ListMemo.Font.Color := clWindowText;
382         ListMemo.Font.Style := [];
383         ListMemo.Color := clWindow;
384         ListMemo.Text := GetMemoText(ListMemo.Font, MEMO_THREAD);
385 end;
386
387 //\83u\83\89\83E\83U\83|\83b\83v\83A\83b\83v\83t\83H\83\93\83g\83{\83^\83\93
388 procedure TOptionDialog.HintFontButtonClick(Sender: TObject);
389 begin
390         FontDialog.Options := [fdAnsiOnly, fdEffects];
391         FontDialog.Font.Assign(HintMemo.Font);
392         if FontDialog.Execute then begin
393                 HintMemo.Font.Assign(FontDialog.Font);
394                 HintMemo.Text := GetMemoText(HintMemo.Font, MEMO_BROWSERPOPUP);
395                 HintMemo.Font.Charset := SHIFTJIS_CHARSET;
396         end;
397 end;
398
399 //\83u\83\89\83E\83U\83|\83b\83v\83A\83b\83v\94w\8ci\90F\83{\83^\83\93
400 procedure TOptionDialog.HintBackButtonClick(Sender: TObject);
401 begin
402         ColorDialog.Color := HintMemo.Color;
403         if ColorDialog.Execute then begin
404                 HintMemo.Color := ColorDialog.Color;
405         end;
406 end;
407
408 //\83u\83\89\83E\83U\83|\83b\83v\83A\83b\83v\83f\83t\83H\83\8b\83g\83{\83^\83\93
409 procedure TOptionDialog.HintDefaultButtonClick(Sender: TObject);
410 begin
411         HintMemo.Font.Name := DEFAULT_FONT_NAME;
412         HintMemo.Font.Size := DEFAULT_FONT_SIZE;
413         HintMemo.Font.Color := clWindowText;
414         HintMemo.Font.Style := [];
415         HintMemo.Color := clInfoBk;
416         HintMemo.Text := GetMemoText(HintMemo.Font, MEMO_BROWSERPOPUP);
417 end;
418
419 //\83u\83\89\83E\83U\83^\83u\83t\83H\83\93\83g\83{\83^\83\93
420 procedure TOptionDialog.BruwserTabFontButtonClick(Sender: TObject);
421 begin
422         FontDialog.Options := [fdAnsiOnly];
423         FontDialog.Font.Assign(BrowserTabMemo.Font);
424         if FontDialog.Execute then begin
425                 BrowserTabMemo.Font.Assign(FontDialog.Font);
426                 BrowserTabMemo.Text := GetMemoText(FontDialog.Font, MEMO_BROWSERTAB);
427                 BrowserTabMemo.Font.Charset := SHIFTJIS_CHARSET;
428         end;
429 end;
430
431 //\83u\83\89\83E\83U\83^\83u\83f\83t\83H\83\8b\83g\83{\83^\83\93
432 procedure TOptionDialog.BrowserTabDefaultButtonClick(Sender: TObject);
433 begin
434         BrowserTabMemo.Font.Name := DEFAULT_TABFONT_NAME;
435         BrowserTabMemo.Font.Size := DEFAULT_TABFONT_SIZE;
436         BrowserTabMemo.Font.Color := clWindowText;
437         BrowserTabMemo.Font.Style := [];
438         BrowserTabMemo.Color := clBtnFace;
439         BrowserTabMemo.Text := GetMemoText(BrowserTabMemo.Font, MEMO_BROWSERTAB);
440 end;
441
442 //\83G\83f\83B\83^\83t\83H\83\93\83g\83{\83^\83\93
443 procedure TOptionDialog.EditorFontBottonClick(Sender: TObject);
444 begin
445         FontDialog.Options := [fdAnsiOnly, fdEffects];
446         FontDialog.Font.Assign(EditorMemo.Font);
447         if FontDialog.Execute then begin
448                 EditorMemo.Font.Assign(FontDialog.Font);
449                 EditorMemo.Text := GetMemoText(EditorMemo.Font, MEMO_EDITOR);
450                 EditorMemo.Font.Charset := SHIFTJIS_CHARSET;
451         end;
452 end;
453
454 //\83G\83f\83B\83^\94w\8ci\90F\83{\83^\83\93
455 procedure TOptionDialog.EditorColorBottonClick(Sender: TObject);
456 begin
457         ColorDialog.Color := EditorMemo.Font.Color;
458         if ColorDialog.Execute then begin
459                 EditorMemo.Color := ColorDialog.Color;
460         end;
461 end;
462
463 //\83G\83f\83B\83^\83f\83t\83H\83\8b\83g\83{\83^\83\93
464 procedure TOptionDialog.EditorDefaultBottonClick(Sender: TObject);
465 begin
466         EditorMemo.Font.Name := DEFAULT_FONT_NAME;
467         EditorMemo.Font.Size := DEFAULT_FONT_SIZE;
468         EditorMemo.Font.Color := clWindowText;
469         EditorMemo.Font.Style := [];
470         EditorMemo.Color := clWindow;
471         EditorMemo.Text := GetMemoText(EditorMemo.Font, MEMO_EDITOR);
472 end;
473
474 procedure TOptionDialog.SetValue;
475 var
476         i: Integer;
477         Item: TListItem;
478 //      s: string;
479         idx: Integer;
480         FileList: TStringList;
481 begin
482         //\8eó\90M\83o\83b\83t\83@\83T\83C\83Y
483         RecvBufferSize.Text := IntToStr(Gikosys.Setting.RecvBufferSize);
484         //HTTP1.1\8eg\97p
485         ProtocolCheckBox.Checked := GikoSys.Setting.Protocol;
486         //\83v\83\8d\83L\83V\90Ú\91±HTTP1.1\8eg\97p
487         ProxyProtocolCheckBox.Checked := Gikosys.Setting.ProxyProtocol;
488
489         //\93Ç\82Ý\8d\9e\82Ý\97p\83v\83\8d\83L\83V
490         ReadProxyCheck.Checked := GikoSys.Setting.ReadProxy;
491         ReadProxyCheckClick(nil);
492         ReadProxyAddressEdit.Text := GikoSys.Setting.ReadProxyAddress;
493         ReadPortEdit.Text := IntToStr(GikoSys.Setting.ReadProxyPort);
494         ReadProxyUserIDEdit.Text := GikoSys.Setting.ReadProxyUserID;
495         ReadProxyPasswordEdit.Text := GikoSys.Setting.ReadProxyPassword;
496         //\8f\91\82«\8d\9e\82Ý\97p\83v\83\8d\83L\83V
497         WriteProxyCheck.Checked := GikoSys.Setting.WriteProxy;
498         WriteProxyCheckClick(nil);
499         WriteProxyAddressEdit.Text := GikoSys.Setting.WriteProxyAddress;
500         WritePortEdit.Text := IntToStr(GikoSys.Setting.WriteProxyPort);
501         WriteProxyUserIDEdit.Text := GikoSys.Setting.WriteProxyUserID;
502         WriteProxyPasswordEdit.Text := GikoSys.Setting.WriteProxyPassword;
503         //\83L\83\83\83r\83l\83b\83g\83t\83H\83\93\83g
504         CabinetMemo.Font.Name := GikoSys.Setting.CabinetFontName;
505         CabinetMemo.Font.Size := GikoSys.Setting.CabinetFontSize;
506         CabinetMemo.Font.Color := GikoSys.Setting.CabinetFontColor;
507         CabinetMemo.Color := GikoSys.Setting.CabinetBackColor;
508         //\83X\83\8c\83b\83h\83\8a\83X\83g\83t\83H\83\93\83g
509         ListMemo.Font.Name := GikoSys.Setting.ListFontName;
510         ListMemo.Font.Size := GikoSys.Setting.ListFontSize;
511         ListMemo.Font.Color := GikoSys.Setting.ListFontColor;
512         ListMemo.Color := GikoSys.Setting.ListBackColor;
513         //\83u\83\89\83E\83U\83|\83b\83v\83A\83b\83v\83t\83H\83\93\83g
514         HintMemo.Font.Name := GikoSys.Setting.HintFontName;
515         HintMemo.Font.Size := GikoSys.Setting.HintFontSize;
516         HintMemo.Font.Color := GikoSys.Setting.HintFontColor;
517         HintMemo.Color := GikoSys.Setting.HintBackColor;
518         //\83u\83\89\83E\83U\83^\83u\83t\83H\83\93\83g
519         BrowserTabMemo.Font.Name := GikoSys.Setting.BrowserTabFontName;
520         BrowserTabMemo.Font.Size := GikoSys.Setting.BrowserTabFontSize;
521         BrowserTabMemo.Font.Style := [];
522         if GikoSys.Setting.BrowserTabFontBold then
523                 BrowserTabMemo.Font.Style := BrowserTabMemo.Font.Style + [fsBold];
524         if GikoSys.Setting.BrowserTabFontItalic then
525                 BrowserTabMemo.Font.Style := BrowserTabMemo.Font.Style + [fsItalic];
526         //\83G\83f\83B\83^\83\81\83\82\83t\83H\83\93\83g
527         EditorMemo.Font.Name := GikoSys.Setting.EditorFontName;
528         EditorMemo.Font.Size := GikoSys.Setting.EditorFontSize;
529         EditorMemo.Font.Color := GikoSys.Setting.EditorFontColor;
530         EditorMemo.Color := GikoSys.Setting.EditorBackColor;
531         //CSS\95\\8e¦
532         CSSCheckBox.Checked := GikoSys.Setting.UseCSS;
533         //
534         //\83X\83^\83C\83\8b\83V\81[\83g\83t\83@\83C\83\8b\96¼\88ê\97\97
535         FileList := TStringList.Create;
536         try
537                 GikoSys.GetFileList(GikoSys.GetStyleSheetDir, '*.css', FileList, True, True);
538
539                 Idx := Length(GikoSys.GetStyleSheetDir);
540                 for i := 0 to FileList.Count - 1 do
541                         FileList[i] := Copy(FileList[i], Idx + 1, Length(FileList[i]));
542                 FileList.Sort;
543                 for i := 0 to FileList.Count - 1 do begin
544                         //s := ExtractFileName(FileList[i]);
545                         if LowerCase(FileList[i]) = 'default.css' then
546                                 Item := CSSListView.Items.Insert(0)
547                         else
548                                 Item := CSSListView.Items.Add;
549                         Item.Caption := ChangeFileExt(FileList[i], '');
550                         if LowerCase(FileList[i]) = LowerCase(GikoSys.Setting.CSSFileName) then
551                                 Item.Selected := True;
552                 end;
553         finally
554                 FileList.Free;
555         end;
556         //\83X\83L\83\93\83t\83@\83C\83\8b\96¼\88ê\97\97
557         FileList := TStringList.Create;
558         try
559                 GikoSys.GetDirectoryList(GikoSys.GetSkinDir, '*', FileList, True);
560
561     Idx := Length(GikoSys.GetSkinDir);
562                 FileList.Sort;
563                 for i := 0 to FileList.Count - 1 do begin
564                         //s := ExtractFileName(FileList[i]);
565                         Item := CSSListView.Items.Add;
566       Item.Data := PChar( FileList[i] );
567                         Item.Caption := Copy( FileList[i], Idx + 1, Length(FileList[i]) );
568                         if LowerCase(FileList[i]) = LowerCase(GikoSys.Setting.CSSFileName) then
569                                 Item.Selected := True;
570                 end;
571         finally
572         // Item.Data \82É\83|\83C\83\93\83^\93Ë\82Á\8d\9e\82ñ\82Å\82é\82©\82ç\8aJ\95ú\82Å\82«\82È\82¢\82æ\82§\81`
573                 //FileList.Free;
574         end;
575
576         if (CSSListView.ItemIndex = -1) and (CSSListView.Items.Count > 0) then
577                 CSSListView.Items[0].Selected := True;          
578
579         //Mail\97\93\95\\8e¦
580         ShowMailCheckBox.Checked := GikoSys.Setting.ShowMail;
581         //\83^\83u\92Ç\89Á\88Ê\92u
582         TabAddRadioGroup.ItemIndex := Ord(GikoSys.Setting.BrowserTabAppend);
583         //\94Â\8dX\90VURL
584         BoardURL2chEdit.Text := GikoSys.Setting.BoardURL2ch;
585         //\94F\8fØ
586         UserIDEdit.Text := GikoSys.Setting.UserID;
587         PasswordEdit.Text := GikoSys.Setting.Password;
588         AutoLoginCheckBox.Checked := GikoSys.Setting.AutoLogin;
589         //\83\8d\83O\83t\83H\83\8b\83_
590         if GikoSys.Setting.NewLogFolder = '' then
591                 LogFolderEdit.Text := GikoSys.Setting.LogFolder
592         else
593                 LogFolderEdit.Text := GikoSys.Setting.NewLogFolder;
594         //\83T\83E\83\93\83h
595         for i := 0 to GikoSys.Setting.GetSoundCount - 1 do begin
596                 Item := SoundListView.Items.Add;
597                 Item.Caption := GikoSys.Setting.SoundViewName[i];
598                 if FileExists(GikoSys.Setting.SoundFileName[i]) then
599                         Item.SubItems.Add(GikoSys.Setting.SoundFileName[i])
600                 else
601                         Item.SubItems.Add('');
602         end;
603         //URL\83N\83\8a\83b\83N\8e\9e\93®\8dì
604         URLAppCheckBox.Checked := GikoSys.Setting.URLApp;
605         URLAppCheckBoxClick(nil);
606         AppFolderEdit.Text := GikoSys.Setting.URLAppFile;
607
608         //mailto\83N\83\8a\83b\83N\8e\9e\93®\8dì
609         OpenMailerCheckBox.Checked := GikoSys.Setting.OpenMailer;
610
611         //\83\8d\83O\8dí\8f\9c\8e\9e\83\81\83b\83Z\81[\83W
612         LogDeleteMessageCheckBox.Checked := GikoSys.Setting.DeleteMsg;
613
614         //\83|\83b\83v\83A\83b\83v\88Ê\92u
615         case GikoSys.Setting.PopupPosition of
616                 gppRightTop:            PopupPositionRadioGroup.ItemIndex := 0;
617                 gppRight:                       PopupPositionRadioGroup.ItemIndex := 1;
618                 gppRightBottom: PopupPositionRadioGroup.ItemIndex := 2;
619                 gppTop:                                 PopupPositionRadioGroup.ItemIndex := 3;
620                 gppCenter:                      PopupPositionRadioGroup.ItemIndex := 4;
621                 gppBottom:                      PopupPositionRadioGroup.ItemIndex := 5;
622                 gppLeftTop:             PopupPositionRadioGroup.ItemIndex := 6;
623                 gppLeft:                                PopupPositionRadioGroup.ItemIndex := 7;
624                 gppLeftBottom:  PopupPositionRadioGroup.ItemIndex := 8;
625         end;
626
627         //\94ñ\83A\83N\83e\83B\83u\8e\9e\83|\83b\83v\83A\83b\83v\95\\8e¦
628         UnActivePopupCheckBox.Checked := GikoSys.Setting.UnActivePopup;
629         //\83\8c\83X\83|\83b\83v\83A\83b\83v\83{\81[\83\8b\83h\95\\8e¦
630         ResPopupBoldCheckBox.Checked := GikoSys.Setting.ResPopupHeaderBold;
631
632         //\83A\83h\83\8c\83X\83o\81[
633         URLDisplayCheckBox.Checked := GikoSys.Setting.URLDisplay;
634         TabStopAddressBarCheckBox.Checked := GikoSys.Setting.AddressBarTabStop;
635         LinkAddCheckBox.Checked := GikoSys.Setting.LinkAddAddressBar;
636         AddressHistoryCountEdit.Text := IntToStr(GikoSys.Setting.AddressHistoryCount);
637
638         //HTML\83v\83\8c\83r\83\85\81[
639         PreviewVisibleCheckBox.Checked := GikoSys.Setting.PreviewVisible;
640         PreviewWaitEdit.Text := IntToStr(GikoSys.Setting.PreviewWait);
641         PreviewSizeComboBox.ItemIndex := 2;
642         case GikoSys.Setting.PreviewSize of
643                 gpsXLarge: PreviewSizeComboBox.ItemIndex := 4;
644                 gpsLarge: PreviewSizeComboBox.ItemIndex := 3;
645                 gpsMedium: PreviewSizeComboBox.ItemIndex := 2;
646                 gpsSmall: PreviewSizeComboBox.ItemIndex := 1;
647                 gpsXSmall: PreviewSizeComboBox.ItemIndex := 0;
648         end;
649
650         //\83X\83\8c\83b\83h\88ê\97\97\8dX\90V\83A\83C\83R\83\93
651         ThreadListIconCheckBox.Checked := GikoSys.Setting.ListIconVisible;
652
653         //\8f\91\82«\8d\9e\82Ý\8e\9e\83}\83V\83\93\8e\9e\8aÔ\8eg\97p\90Ý\92è
654         PostTimeCheckBox.Checked := GikoSys.Setting.UseMachineTime;
655         PostTimeEdit.Text := IntToStr(GikoSys.Setting.TimeAdjustSec);
656         if GikoSys.Setting.TimeAdjust then
657                 PutPostTimeRadioButton.Checked := True
658         else
659                 BackPostTimeRadioButton.Checked := True;
660     //\82 \82Ú\81`\82ñ
661     RloCheckBox.Checked := GikoSys.Setting.AbonDeleterlo;
662     ReplaceulCheckBox.Checked := GikoSys.Setting.AbonReplaceul;
663     PopUpAbonCheckBox.Checked := GikoSys.Setting.PopUpAbon;
664
665 end;
666
667 procedure TOptionDialog.SaveSetting;
668 var
669         i: Integer;
670 //      Item: TListItem;
671 begin
672         //\8eó\90M\83o\83b\83t\83@\83T\83C\83Y
673         Gikosys.Setting.RecvBufferSize := StrToInt(RecvBufferSize.Text);
674         //HTTP1.1\8eg\97p
675         GikoSys.Setting.Protocol := ProtocolCheckBox.Checked;
676         //\83v\83\8d\83L\83V\90Ú\91±HTTP1.1\8eg\97p
677         Gikosys.Setting.ProxyProtocol := ProxyProtocolCheckBox.Checked;
678
679         GikoSys.Setting.ReadProxy := ReadProxyCheck.Checked;
680         GikoSys.Setting.ReadProxyAddress := ReadProxyAddressEdit.Text;
681         GikoSys.Setting.ReadProxyPort := StrToInt(ReadPortEdit.Text);
682         GikoSys.Setting.ReadProxyUserID := ReadProxyUserIDEdit.Text;
683         GikoSys.Setting.ReadProxyPassword := ReadProxyPasswordEdit.Text;
684
685         GikoSys.Setting.WriteProxy := WriteProxyCheck.Checked;
686         GikoSys.Setting.WriteProxyAddress := WriteProxyAddressEdit.Text;
687         GikoSys.Setting.WriteProxyPort := StrToInt(WritePortEdit.Text);
688         GikoSys.Setting.WriteProxyUserID := WriteProxyUserIDEdit.Text;
689         GikoSys.Setting.WriteProxyPassword := WriteProxyPasswordEdit.Text;
690
691         GikoSys.Setting.CabinetFontName := CabinetMemo.Font.Name;
692         GikoSys.Setting.CabinetFontSize := CabinetMemo.Font.Size;
693         GikoSys.Setting.CabinetFontColor := CabinetMemo.Font.Color;
694         GikoSys.Setting.CabinetBackColor := CabinetMemo.Color;
695
696         GikoSys.Setting.ListFontName := ListMemo.Font.Name;
697         GikoSys.Setting.ListFontSize := ListMemo.Font.Size;
698         GikoSys.Setting.ListFontColor := ListMemo.Font.Color;
699         GikoSys.Setting.ListBackColor := ListMemo.Color;
700
701         GikoSys.Setting.HintFontName := HintMemo.Font.Name;
702         GikoSys.Setting.HintFontSize := HintMemo.Font.Size;
703         GikoSys.Setting.HintFontColor := HintMemo.Font.Color;
704         GikoSys.Setting.HintBackColor := HintMemo.Color;
705
706         GikoSys.Setting.BrowserTabFontName := BrowserTabMemo.Font.Name;
707         GikoSys.Setting.BrowserTabFontSize := BrowserTabMemo.Font.Size;
708
709         GikoSys.Setting.EditorFontName := EditorMemo.Font.Name;
710         GikoSys.Setting.EditorFontSize := EditorMemo.Font.Size;
711         GikoSys.Setting.EditorFontColor := EditorMemo.Font.Color;
712         GikoSys.Setting.EditorBackColor := EditorMemo.Color;
713         //CSS\95\\8e¦
714         GikoSys.Setting.UseCSS := CSSCheckBox.Checked;
715         //CSS\83t\83@\83C\83\8b\96¼
716         GikoSys.Setting.CSSFileName := 'default.css';
717         if CSSListView.Items.Count > 0 then begin
718                 try
719         if CSSListView.Items[CSSListView.ItemIndex].Data <> nil then
720                                 GikoSys.Setting.CSSFileName := string( CSSListView.Items[CSSListView.ItemIndex].data )
721       else
722                                 GikoSys.Setting.CSSFileName := CSSListView.Items[CSSListView.ItemIndex].Caption + '.css';
723                 except
724                 end;
725         end;
726
727         //Mail\97\93\95\\8e¦
728         GikoSys.Setting.ShowMail := ShowMailCheckBox.Checked;
729
730         GikoSys.Setting.BrowserTabAppend := TGikoTabAppend(TabAddRadioGroup.ItemIndex);
731
732         GikoSys.Setting.BoardURL2ch := BoardURL2chEdit.Text;
733
734         GikoSys.Setting.UserID := UserIDEdit.Text;
735         GikoSys.Setting.Password := PasswordEdit.Text;
736         GikoSys.Setting.AutoLogin := AutoLoginCheckBox.Checked;
737
738         GikoSys.Setting.URLApp := URLAppCheckBox.Checked;
739         GikoSys.Setting.URLAppFile := AppFolderEdit.Text;
740
741         GikoSys.Setting.OpenMailer := OpenMailerCheckBox.Checked;
742         GikoSys.Setting.DeleteMsg := LogDeleteMessageCheckBox.Checked;
743
744         //\83|\83b\83v\83A\83b\83v\88Ê\92u
745         case PopupPositionRadioGroup.ItemIndex of
746                 0: GikoSys.Setting.PopupPosition := gppRightTop;
747                 1: GikoSys.Setting.PopupPosition := gppRight;
748                 2: GikoSys.Setting.PopupPosition := gppRightBottom;
749                 3: GikoSys.Setting.PopupPosition := gppTop;
750                 4: GikoSys.Setting.PopupPosition := gppCenter;
751                 5: GikoSys.Setting.PopupPosition := gppBottom;
752                 6: GikoSys.Setting.PopupPosition := gppLeftTop;
753                 7: GikoSys.Setting.PopupPosition := gppLeft;
754                 8: GikoSys.Setting.PopupPosition := gppLeftBottom;
755         end;
756
757         //\94ñ\83A\83N\83e\83B\83u\8e\9e\83|\83b\83v\83A\83b\83v\95\\8e¦
758         GikoSys.Setting.UnActivePopup := UnActivePopupCheckBox.Checked;
759         //\83\8c\83X\83|\83b\83v\83A\83b\83v\83{\81[\83\8b\83h\95\\8e¦
760         GikoSys.Setting.ResPopupHeaderBold := ResPopupBoldCheckBox.Checked;
761
762         //\83A\83h\83\8c\83X\83o\81[
763         GikoSys.Setting.URLDisplay := URLDisplayCheckBox.Checked;
764         GikoSys.Setting.AddressBarTabStop := TabStopAddressBarCheckBox.Checked;
765         GikoSys.Setting.LinkAddAddressBar := LinkAddCheckBox.Checked;
766         if GikoSys.IsNumeric(AddressHistoryCountEdit.Text) then
767                 GikoSys.Setting.AddressHistoryCount := StrToInt(AddressHistoryCountEdit.Text)
768         else
769                 GikoSys.Setting.AddressHistoryCount := 100;
770
771         //HTML\83v\83\8c\83r\83\85\81[
772         GikoSys.Setting.PreviewVisible := PreviewVisibleCheckBox.Checked;
773         if GikoSys.IsNumeric(PreviewWaitEdit.Text) then
774                 GikoSys.Setting.PreviewWait := StrToInt(PreviewWaitEdit.Text)
775         else
776                 GikoSys.Setting.PreviewWait := 500;
777         case PreviewSizeComboBox.ItemIndex of
778                 0: GikoSys.Setting.PreviewSize := gpsXSmall;
779                 1: GikoSys.Setting.PreviewSize := gpsSmall;
780                 2: GikoSys.Setting.PreviewSize := gpsMedium;
781                 3: GikoSys.Setting.PreviewSize := gpsLarge;
782                 4: GikoSys.Setting.PreviewSize := gpsXLarge;
783         end;
784
785         //\83X\83\8c\83b\83h\88ê\97\97\8dX\90V\83A\83C\83R\83\93
786         GikoSys.Setting.ListIconVisible := ThreadListIconCheckBox.Checked;
787
788         //\8f\91\82«\8d\9e\82Ý\8e\9e\83}\83V\83\93\8e\9e\8aÔ\8eg\97p\90Ý\92è
789         GikoSys.Setting.UseMachineTime := PostTimeCheckBox.Checked;
790         if GikoSys.IsNumeric(PostTimeEdit.Text) then
791                 GikoSys.Setting.TimeAdjustSec := StrToInt(PostTimeEdit.Text)
792         else
793                 GikoSys.Setting.TimeAdjustSec := 0;
794         GikoSys.Setting.TimeAdjust := PutPostTimeRadioButton.Checked;
795
796
797         GikoSys.Setting.WriteSystemSettingFile;
798 //      GikoForm.SetBrowserTabState;
799
800         if LogFolderEdit.Text <> '' then begin
801                 GikoSys.Setting.NewLogFolder := LogFolderEdit.Text;
802                 GikoSys.Setting.WriteFolderSettingFile;
803         end;
804
805         for i := 0 to SoundListView.Items.Count - 1 do begin
806                 if FileExists(SoundListView.Items[i].SubItems[0]) then
807                         GikoSys.Setting.SoundFileName[i] := SoundListView.Items[i].SubItems[0]
808                 else
809                         GikoSys.Setting.SoundFileName[i] := '';
810         end;
811
812   //\82 \82Ú\81`\82ñ
813   GikoSys.Setting.AbonDeleterlo := RloCheckBox.Checked;
814   GikoSys.Setting.AbonReplaceul := ReplaceulCheckBox.Checked;
815   GikoSys.Setting.PopUpAbon := PopUpAbonCheckBox.Checked;
816 end;
817
818 procedure TOptionDialog.SettingApply;
819 var
820         i: Integer;
821 begin
822         GikoForm.TreeView.Items.BeginUpdate;
823         GikoForm.ListView.Items.BeginUpdate;
824         try
825                 GikoForm.TreeView.Font.Name := GikoSys.Setting.CabinetFontName;
826                 GikoForm.TreeView.Font.Size := GikoSys.Setting.CabinetFontSize;
827                 GikoForm.TreeView.Font.Color := GikoSys.Setting.CabinetFontColor;
828                 GikoForm.TreeView.Color := GikoSys.Setting.CabinetBackColor;
829
830                 GikoForm.ListView.Font.Name := GikoSys.Setting.ListFontName;
831                 GikoForm.ListView.Font.Size := GikoSys.Setting.ListFontSize;
832                 GikoForm.ListView.Font.Color := GikoSys.Setting.ListFontColor;
833                 GikoForm.ListView.Color := GikoSys.Setting.ListBackColor;
834
835                 GikoForm.BrowserTab.Font.Name := GikoSys.Setting.BrowserTabFontName;
836                 GikoForm.BrowserTab.Font.Size := GikoSys.Setting.BrowserTabFontSize;
837 //              GikoForm.BrowserTab.Height := (GikoSys.Setting.BrowserTabFontSize * 2) + 1;
838 //              GikoForm.BrowserBottomPanel.Height := GikoForm.BrowserTab.Height;
839
840                 for i := 0 to Screen.CustomFormCount - 1 do begin
841                         if TObject(Screen.CustomForms[i]) is TEditorForm then begin
842                                 TEditorForm(Screen.CustomForms[i]).SetFont;
843                         end;
844                 end;
845
846         finally
847                 GikoForm.TreeView.Items.EndUpdate;
848                 GikoForm.ListView.Items.EndUpdate;
849         end;
850
851         //\83A\83h\83\8c\83X\83o\81[
852         for i := GikoForm.AddressComboBox.Items.Count - 1 downto 0 do begin
853                 if GikoSys.Setting.AddressHistoryCount >= GikoForm.AddressComboBox.Items.Count then
854                         Break;
855                 GikoForm.AddressComboBox.Items.Delete(i);
856         end;
857         GikoForm.AddressComboBox.TabStop := GikoSys.Setting.AddressBarTabStop;
858 end;
859
860 procedure TOptionDialog.ReadProxyCheckClick(Sender: TObject);
861 begin
862         ReadProxyAddressEdit.Enabled := ReadProxyCheck.Checked;
863         ReadPortEdit.Enabled := ReadProxyCheck.Checked;
864         ReadProxyUserIDEdit.Enabled := ReadProxyCheck.Checked;
865         ReadProxyPasswordEdit.Enabled := ReadProxyCheck.Checked;
866
867         ReadAddressLabel.Enabled := ReadProxyCheck.Checked;
868         ReadPortLabel.Enabled := ReadProxyCheck.Checked;
869         ReadUserIDLabel.Enabled := ReadProxyCheck.Checked;
870         ReadPasswordLabel.Enabled := ReadProxyCheck.Checked;
871 end;
872
873 procedure TOptionDialog.ReadPortEditExit(Sender: TObject);
874 begin
875         if not GikoSys.IsNumeric(ReadPortEdit.Text) then
876                 ReadPortEdit.Text := '0';
877 end;
878
879 procedure TOptionDialog.LogFolderButtonClick(Sender: TObject);
880 var
881         Root: WideString;
882         Dir: string;
883 begin
884         Root := '';
885         if SelectDirectory('\83\8d\83O\83t\83H\83\8b\83_\91I\91ð', Root, Dir) then begin
886                 LogFolderEdit.Text := Dir;
887         end;
888 end;
889
890 function TOptionDialog.CheckFolder: Boolean;
891 begin
892         if Trim(LogFolderEdit.Text) = '' then
893                 LogFolderEdit.Text := ExtractFilePath(Application.ExeName) + 'Log';
894
895         if DirectoryExists(LogFolderEdit.Text) then begin
896                 Result := True;
897         end else begin
898                 if MsgBox(Handle, '\83\8d\83O\83t\83H\83\8b\83_\82ª\91\8dÝ\82µ\82Ü\82¹\82ñ\81B\8dì\90¬\82µ\82Ü\82·\82©\81H', '\83M\83R\83i\83r', MB_YESNO or MB_ICONQUESTION) = IDYES        then begin
899                         //\83t\83H\83\8b\83_\82ð\8dì\90¬
900                         try
901                                 GikoSys.ForceDirectoriesEx(LogFolderEdit.Text);
902                                 Result := True
903                         except
904                                 MsgBox(Handle, '\83\8d\83O\83t\83H\83\8b\83_\82Ì\8ew\92è\82ª\95s\90³\82Å\82·\81B', '\83G\83\89\81[', MB_OK or MB_ICONSTOP);
905                                 OptionTab.ActivePage := FolderSheet;
906                                 LogFolderEdit.SetFocus;
907                                 Result := False;
908                         end;
909                 end else
910                         Result := False;
911         end;
912 end;
913
914 procedure TOptionDialog.FormClose(Sender: TObject; var Action: TCloseAction);
915 begin
916         if not FClose then
917                 Action := caNone;
918         FClose := True;
919 end;
920
921 procedure TOptionDialog.SoundReferButtonClick(Sender: TObject);
922 begin
923         OpenDialog.Filter := '\83T\83E\83\93\83h (*.wav)|*.wav|\82·\82×\82Ä\82Ì\83t\83@\83C\83\8b (*.*)|*.*';
924         sndPlaySound(nil, SND_ASYNC);
925         if OpenDialog.Execute then begin
926                 SoundFileEdit.Text := OpenDialog.FileName;
927         end;
928 end;
929
930 procedure TOptionDialog.SoundPlayButtonClick(Sender: TObject);
931 begin
932         if not FileExists(SoundFileEdit.Text) then begin
933                 MsgBox(Handle, '\91\8dÝ\82µ\82È\82¢\83t\83@\83C\83\8b\82Å\82·', '\83G\83\89\81[', MB_ICONSTOP or MB_OK);
934                 SoundFileEdit.Text := '';
935                 Exit;
936         end;
937         if not sndPlaySound(PChar(SoundFileEdit.Text), SND_ASYNC or SND_NOSTOP) then begin
938                 sndPlaySound(nil, SND_ASYNC);
939         end;
940 end;
941
942 procedure TOptionDialog.SoundListViewChanging(Sender: TObject;
943   Item: TListItem; Change: TItemChange; var AllowChange: Boolean);
944 begin
945         if Item.SubItems.Count > 0 then
946                 SoundFileEdit.Text := Item.SubItems[0];
947 end;
948
949 procedure TOptionDialog.SoundFileEditChange(Sender: TObject);
950 var
951         Item: TListItem;
952 begin
953         sndPlaySound(nil, SND_ASYNC);
954         Item := SoundListView.Selected;
955         if Item = nil then Exit;
956
957         if FileExists(SoundFileEdit.Text) then
958                 Item.SubItems[0] := SoundFileEdit.Text;
959         if Trim(SoundFileEdit.Text) = '' then
960                 Item.SubItems[0] := '';
961 end;
962
963 procedure TOptionDialog.OptionTabChange(Sender: TObject);
964 begin
965         sndPlaySound(nil, SND_ASYNC);
966 end;
967
968 procedure TOptionDialog.AppFolderButtonClick(Sender: TObject);
969 begin
970         OpenDialog.Filter := '\8eÀ\8ds\83t\83@\83C\83\8b (*.exe)|*.exe|\82·\82×\82Ä\82Ì\83t\83@\83C\83\8b (*.*)|*.*';
971         if OpenDialog.Execute then
972                 AppFolderEdit.Text := OpenDialog.FileName;
973 end;
974
975 procedure TOptionDialog.WriteProxyCheckClick(Sender: TObject);
976 begin
977         WriteProxyAddressEdit.Enabled := WriteProxyCheck.Checked;
978         WritePortEdit.Enabled := WriteProxyCheck.Checked;
979         WriteProxyUserIDEdit.Enabled := WriteProxyCheck.Checked;
980         WriteProxyPasswordEdit.Enabled := WriteProxyCheck.Checked;
981
982         WriteAddressLabel.Enabled := WriteProxyCheck.Checked;
983         WritePortLabel.Enabled := WriteProxyCheck.Checked;
984         WriteUserIDLabel.Enabled := WriteProxyCheck.Checked;
985         WritePasswordLabel.Enabled := WriteProxyCheck.Checked;
986 end;
987
988 procedure TOptionDialog.WritePortEditExit(Sender: TObject);
989 begin
990         if not GikoSys.IsNumeric(WritePortEdit.Text) then
991                 WritePortEdit.Text := '0';
992 end;
993
994 procedure TOptionDialog.Tora3URLLabelClick(Sender: TObject);
995 begin
996         GikoSys.OpenBrowser(URL_TORA3, gbtAuto);
997 end;
998
999 procedure TOptionDialog.HotKeyEnter(Sender: TObject);
1000 begin
1001         OkBotton.Default := False;
1002         CancelBotton.Cancel := False;
1003 end;
1004
1005 procedure TOptionDialog.HotKeyExit(Sender: TObject);
1006 begin
1007         OkBotton.Default := True;
1008         CancelBotton.Cancel := True;
1009 end;
1010
1011 procedure TOptionDialog.URLAppCheckBoxClick(Sender: TObject);
1012 begin
1013         AppFolderLabel.Enabled := URLAppCheckBox.Checked;
1014         AppFolderEdit.Enabled := URLAppCheckBox.Checked;
1015         AppFolderButton.Enabled := URLAppCheckBox.Checked;
1016 end;
1017
1018 procedure TOptionDialog.AddressHistoryCountEditExit(Sender: TObject);
1019 begin
1020         if not GikoSys.IsNumeric(AddressHistoryCountEdit.Text) then
1021                 AddressHistoryCountEdit.Text := '100';
1022 end;
1023
1024 procedure TOptionDialog.PreviewWaitEditExit(Sender: TObject);
1025 begin
1026         if not GikoSys.IsNumeric(PreviewWaitEdit.Text) then
1027                 PreviewWaitEdit.Text := '500';
1028         if StrToInt(PreviewWaitEdit.Text) < 500 then
1029                 PreviewWaitEdit.Text := '500';
1030         if StrToInt(PreviewWaitEdit.Text) > 9999 then
1031                 PreviewWaitEdit.Text := '9999';
1032 end;
1033
1034 procedure TOptionDialog.RecvBufferSizeExit(Sender: TObject);
1035 begin
1036         if not GikoSys.IsNumeric(RecvBufferSize.Text) then
1037                 RecvBufferSize.Text := '4096';
1038         if StrToInt(RecvBufferSize.Text) < 256 then
1039                 RecvBufferSize.Text := '4096';
1040 end;
1041
1042 procedure TOptionDialog.CSSCheckBoxClick(Sender: TObject);
1043 begin
1044         CSSListLabel.Enabled := CSSCheckBox.Checked;
1045         CSSListView.Enabled := CSSCheckBox.Checked;
1046 end;
1047
1048 procedure TOptionDialog.PostTimeEditExit(Sender: TObject);
1049 begin
1050         if not GikoSys.IsNumeric(PostTimeEdit.Text) then
1051                 PostTimeEdit.Text := '0';
1052 end;
1053
1054 procedure TOptionDialog.PostTimeCheckBoxClick(Sender: TObject);
1055 begin
1056         PostTimeLabel.Enabled := PostTimeCheckBox.Checked;
1057         PostTimeEdit.Enabled := PostTimeCheckBox.Checked;
1058         PutPostTimeRadioButton.Enabled := PostTimeCheckBox.Checked;
1059         BackPostTimeRadioButton.Enabled := PostTimeCheckBox.Checked;
1060 end;
1061 procedure TOptionDialog.SetAbonpropertys;
1062 begin
1063     //\82 \82Ú\81`\82ñ
1064     GikoSys.FAbon.Deleterlo := RloCheckBox.Checked;
1065     GikoSys.FAbon.Replaceul := ReplaceulCheckBox.Checked;
1066     GikoSys.FAbon.AbonPopupRes := PopUpAbonCheckBox.Checked;
1067
1068 end;
1069 end.
1070