OSDN Git Service

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