OSDN Git Service

・スレタイの特定ワードを非表示にする機能に「©bbspink.com」も追加
[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 {$IF Defined(DELPRO) }
10         SHDocVw,
11         MSHTML,
12 {$ELSE}
13         SHDocVw_TLB,
14         MSHTML_TLB,
15 {$IFEND}
16         BoardGroup, BrowserRecord;
17
18 type
19         TOptionDialog = class(TForm)
20                 CancelBotton: TButton;
21                 ApplyButton: TButton;
22                 FontDialog: TFontDialog;
23                 ColorDialog: TColorDialog;
24                 OpenDialog: TOpenDialog;
25                 Label26: TLabel;
26                 CroutOption: TButton;
27                 OptionTab: TPageControl;
28                 ConnectSheet: TTabSheet;
29                 ReadProxyGroupBox: TGroupBox;
30                 ReadAddressLabel: TLabel;
31                 ReadPortLabel: TLabel;
32                 ReadUserIDLabel: TLabel;
33                 ReadPasswordLabel: TLabel;
34                 ReadProxyCheck: TCheckBox;
35                 ReadProxyAddressEdit: TEdit;
36                 ReadPortEdit: TEdit;
37                 ReadProxyUserIDEdit: TEdit;
38                 ReadProxyPasswordEdit: TEdit;
39                 WriteProxyGroupBox: TGroupBox;
40                 WriteAddressLabel: TLabel;
41                 WritePortLabel: TLabel;
42                 WriteUserIDLabel: TLabel;
43                 WritePasswordLabel: TLabel;
44                 WriteProxyCheck: TCheckBox;
45                 WriteProxyAddressEdit: TEdit;
46                 WritePortEdit: TEdit;
47                                 WriteProxyUserIDEdit: TEdit;
48                                 WriteProxyPasswordEdit: TEdit;
49                 Font1Sheet: TTabSheet;
50                 Bevel1: TBevel;
51                 Bevel2: TBevel;
52                 Label19: TLabel;
53                                 Bevel5: TBevel;
54                 Label20: TLabel;
55                 Label21: TLabel;
56                 Label22: TLabel;
57                 Label23: TLabel;
58                 lblSFont: TLabel;
59                 CabinetFontBotton: TButton;
60                 CabinetColorBotton: TButton;
61                 CabinetDefaultButton: TButton;
62                 CabinetMemo: TMemo;
63                 ListMemo: TMemo;
64                 ListFontBotton: TButton;
65                 ListColorBotton: TButton;
66                 ListDefaultBotton: TButton;
67                 HintFontButton: TButton;
68                 HintBackButton: TButton;
69                 HintDefaultButton: TButton;
70                 HintMemo: TMemo;
71                 EditorMemo: TMemo;
72                 EditorFontBotton: TButton;
73                 EditorColorBotton: TButton;
74                 EditorDefaultBotton: TButton;
75                 BrowserTabMemo: TMemo;
76                 BruwserTabFontButton: TButton;
77                 BrowserTabDefaultButton: TButton;
78                 OddResNumCheckBox: TCheckBox;
79                 OddResNumColorBox: TColorBox;
80                 CSSTabSheet: TTabSheet;
81                 GroupBox12: TGroupBox;
82                 CSSListLabel: TLabel;
83                 CSSCheckBox: TCheckBox;
84                 CSSListView: TListView;
85                 CSSBrowser: TWebBrowser;
86                 CSSFontCheckBox: TCheckBox;
87                 CSSBackColorCheckBox: TCheckBox;
88                 CSSFontButton: TButton;
89                 CSSBackColorButton: TButton;
90                 TabSheet3: TTabSheet;
91                 GroupBox9: TGroupBox;
92                 ThreadListIconCheckBox: TCheckBox;
93                 GroupBox16: TGroupBox;
94                 CreationTimeLogsCheckBox: TCheckBox;
95                 FutureThreadCheckBox: TCheckBox;
96                 GroupBox5: TGroupBox;
97                 BrowserMaxLabel: TLabel;
98                 BrowserMaxCombo: TComboBox;
99                 GroupBox17: TGroupBox;
100                 SelectIntervalLabel: TLabel;
101                 Label4: TLabel;
102                 Label6: TLabel;
103                 SelectIntervalEdit: TEdit;
104                 GroupBox18: TGroupBox;
105                 DatOchiSortCombo: TComboBox;
106                 ThreadSheet: TTabSheet;
107                 GroupBox1: TGroupBox;
108                 ShowMailCheckBox: TCheckBox;
109                 ResRangeHoldCheckBox: TCheckBox;
110                 ResRangeHoldComboBox: TComboBox;
111                 GroupBox2: TGroupBox;
112                 AppFolderLabel: TLabel;
113                 URLAppCheckBox: TCheckBox;
114                 AppFolderEdit: TEdit;
115                 AppFolderButton: TButton;
116                 OpenMailerCheckBox: TCheckBox;
117                 GroupBox6: TGroupBox;
118                 LogDeleteMessageCheckBox: TCheckBox;
119                 TabSheet1: TTabSheet;
120                 TabAddRadioGroup: TRadioGroup;
121                 GroupBox8: TGroupBox;
122                 Label14: TLabel;
123                 Label15: TLabel;
124                 Label16: TLabel;
125                 PreviewVisibleCheckBox: TCheckBox;
126                 PreviewSizeComboBox: TComboBox;
127                 PreviewWaitEdit: TEdit;
128                 GroupBox10: TGroupBox;
129                 UnActivePopupCheckBox: TCheckBox;
130                 ResPopupBoldCheckBox: TCheckBox;
131                 TabSheet2: TTabSheet;
132                 GroupBox7: TGroupBox;
133                 Label3: TLabel;
134                 Label11: TLabel;
135                 URLDisplayCheckBox: TCheckBox;
136                 AddressHistoryCountEdit: TEdit;
137                 TabStopAddressBarCheckBox: TCheckBox;
138                 LinkAddCheckBox: TCheckBox;
139                 GroupBox15: TGroupBox;
140                 ShowDialogForEndCheckBox: TCheckBox;
141                 AllTabCloseCheckBox: TCheckBox;
142                 SambaGroupBox: TGroupBox;
143                 UseSambaCheckBox: TCheckBox;
144                 TabAutoSaveLoad: TGroupBox;
145                 TabLoadSave: TCheckBox;
146                 SoundSheet: TTabSheet;
147                 SoundEventGroupBox: TGroupBox;
148                 SoundListView: TListView;
149                 SoundReferButton: TButton;
150                 SoundFileEdit: TEdit;
151                 SoundPlayButton: TBitBtn;
152                 FolderSheet: TTabSheet;
153                 FolderGroupBox: TGroupBox;
154                 Label1: TLabel;
155                 Label2: TLabel;
156                 Label5: TLabel;
157                 LogFolderEdit: TEdit;
158                 LogFolderButton: TButton;
159                 NGwordSheet: TTabSheet;
160                 GroupBox14: TGroupBox;
161                 RloCheckBox: TCheckBox;
162                 ReplaceulCheckBox: TCheckBox;
163                 PopUpAbonCheckBox: TCheckBox;
164                 ShowNGLineCheckBox: TCheckBox;
165                 AddResAnchorCheckBox: TCheckBox;
166                 DeleteSyriaCheckBox: TCheckBox;
167                 UserIDSheet: TTabSheet;
168                 GroupBox3: TGroupBox;
169                 Label9: TLabel;
170                 Label10: TLabel;
171                 ForcedLoginLabel: TLabel;
172                 UserIDEdit: TEdit;
173                 PasswordEdit: TEdit;
174                 AutoLoginCheckBox: TCheckBox;
175                 ForcedLoginCheckBox: TCheckBox;
176                 GroupBox4: TGroupBox;
177                 Label13: TLabel;
178                 BoardURLComboBox: TComboBox;
179                 AddURLButton: TButton;
180                 RemoveURLButton: TButton;
181                 OkBotton: TButton;
182                 SpamFilterGroupBox: TGroupBox;
183                 SpamFilterAlgorithmComboBox: TComboBox;
184                 TabSheet4: TTabSheet;
185                 GroupBox13: TGroupBox;
186                 UseUndecidedCheckBox: TCheckBox;
187                 Tora3URLLabel: TLabel;
188                 Label12: TLabel;
189                 GroupBox11: TGroupBox;
190                 Label7: TLabel;
191                 BeUserIDEdit: TEdit;
192                 Label8: TLabel;
193     BeCodeEdit: TEdit;
194                 BeAutoLoginCheckBox: TCheckBox;
195     GroupBox19: TGroupBox;
196     Label17: TLabel;
197     MaxRecordCountEdit: TEdit;
198     Label18: TLabel;
199     UnFocusedBoldCheckBox: TCheckBox;
200     IgnoreKanaCheckBox: TCheckBox;
201     UseKatjuTypeSkinCheckBox: TCheckBox;
202     GroupBox20: TGroupBox;
203     AutoSortCheckBox: TCheckBox;
204     Label24: TLabel;
205     GroupBox21: TGroupBox;
206     StoredTaskTrayCB: TCheckBox;
207     GroupBox22: TGroupBox;
208     LoopBrowserTabsCB: TCheckBox;
209     GroupBox23: TGroupBox;
210     IgnoreContextCheckBox: TCheckBox;
211     GroupBox24: TGroupBox;
212     gppRightTopRB: TRadioButton;
213     gppTopRB: TRadioButton;
214     gppLeftTopRB: TRadioButton;
215     gppLeftRB: TRadioButton;
216     gppRightRB: TRadioButton;
217     gppLeftBottomRB: TRadioButton;
218     gppBottomRB: TRadioButton;
219     gppRighBottomRB: TRadioButton;
220     ResAnchorCheckBox: TCheckBox;
221     IgnoreLimitResCountCheckBox: TCheckBox;
222     GroupBox25: TGroupBox;
223     Label25: TLabel;
224     BoukenComboBox: TComboBox;
225     BoukenModButton: TButton;
226     BoukenDelButton: TButton;
227     BoukenEdit: TEdit;
228     GroupBox26: TGroupBox;
229     UseUnicodeCB: TCheckBox;
230     Label27: TLabel;
231     DispImageCheckBox: TCheckBox;
232     GroupBox27: TGroupBox;
233     ThreadTitleTrimCheckBox: TCheckBox;
234                 procedure FormCreate(Sender: TObject);
235                 procedure FormDestroy(Sender: TObject);
236                 procedure ApplyButtonClick(Sender: TObject);
237                 procedure CabinetFontBottonClick(Sender: TObject);
238                 procedure CabinetColorBottonClick(Sender: TObject);
239                 procedure EditorFontBottonClick(Sender: TObject);
240                 procedure OkBottonClick(Sender: TObject);
241                 procedure ReadProxyCheckClick(Sender: TObject);
242                 procedure ListFontBottonClick(Sender: TObject);
243                 procedure ListColorBottonClick(Sender: TObject);
244                 procedure EditorColorBottonClick(Sender: TObject);
245                 procedure CabinetDefaultButtonClick(Sender: TObject);
246                 procedure ReadPortEditExit(Sender: TObject);
247                 procedure ListDefaultBottonClick(Sender: TObject);
248                 procedure EditorDefaultBottonClick(Sender: TObject);
249                 procedure HintFontButtonClick(Sender: TObject);
250                 procedure HintBackButtonClick(Sender: TObject);
251                 procedure HintDefaultButtonClick(Sender: TObject);
252                 procedure LogFolderButtonClick(Sender: TObject);
253                 procedure FormClose(Sender: TObject; var Action: TCloseAction);
254                 procedure SoundReferButtonClick(Sender: TObject);
255                 procedure SoundPlayButtonClick(Sender: TObject);
256                 procedure SoundListViewChanging(Sender: TObject; Item: TListItem;
257                         Change: TItemChange; var AllowChange: Boolean);
258                 procedure SoundFileEditChange(Sender: TObject);
259                 procedure OptionTabChange(Sender: TObject);
260                 procedure AppFolderButtonClick(Sender: TObject);
261                 procedure WriteProxyCheckClick(Sender: TObject);
262                 procedure WritePortEditExit(Sender: TObject);
263                 procedure Tora3URLLabelClick(Sender: TObject);
264                 procedure HotKeyEnter(Sender: TObject);
265                 procedure HotKeyExit(Sender: TObject);
266                 procedure URLAppCheckBoxClick(Sender: TObject);
267                 procedure BruwserTabFontButtonClick(Sender: TObject);
268                 procedure BrowserTabDefaultButtonClick(Sender: TObject);
269                 procedure AddressHistoryCountEditExit(Sender: TObject);
270                 procedure PreviewWaitEditExit(Sender: TObject);
271                 procedure CSSCheckBoxClick(Sender: TObject);            procedure CSSFontButtonClick(Sender: TObject);
272                 procedure CSSBackColorButtonClick(Sender: TObject);
273                 procedure CSSFontCheckBoxClick(Sender: TObject);
274                 procedure CSSBackColorCheckBoxClick(Sender: TObject);
275                 procedure CSSListViewChange(Sender: TObject; Item: TListItem;
276                         Change: TItemChange);
277                 procedure AddURLButtonClick(Sender: TObject);
278                 procedure RemoveURLButtonClick(Sender: TObject);
279                 procedure OddResNumCheckBoxClick(Sender: TObject);
280                 procedure ResRangeHoldCheckBoxClick(Sender: TObject);
281                 procedure CroutOptionClick(Sender: TObject);
282     procedure MaxRecordCountEditExit(Sender: TObject);
283     procedure BoukenDelButtonClick(Sender: TObject);
284     procedure BoukenComboBoxChange(Sender: TObject);
285     procedure BoukenModButtonClick(Sender: TObject);
286         private
287                 { Private \90é\8c¾ }
288                 FClose: Boolean;
289                 FRepaintList: Boolean;
290                 FRepaintThread: Boolean;
291                 FCSSFont: TFont;
292                 FCSSBackColor: TColor;
293                 FCSSStrings: TStringList;
294                 function GetMemoText(font: TFont; text: string): string;
295 //              function GetFontText(Font: TFont; Text: string): string;
296                 procedure SetValue;
297                 procedure SaveSetting;
298                 procedure SettingApply;
299                 function CheckFolder: Boolean;
300                 procedure SetAbonpropertys;
301                 procedure CSSSetContent(Content: string);
302                 procedure CSSPreview;
303                 //! CSS\83v\83\8c\83r\83\85\81[\97pHTMLBody\90\90¬
304                 function CreatePreviewBody(Res: array of TResRec): string;
305                 //! CSS/SKIN\83v\83\8c\83r\83\85\81[\97pStyle\95\8e\9a\97ñ\8eæ\93¾
306                 function GetPreviewUserStyle(): string;
307         public
308                 { Public \90é\8c¾ }
309         end;
310
311 var
312         OptionDialog: TOptionDialog;
313
314 implementation
315
316 uses
317         Giko, Editor, Setting, ActnList, KuroutSetting, Math, HTMLCreate;
318
319 const
320         FONT_TEXT: string = '%s %d pt';
321         MEMO_CABINET: string = '\83L\83\83\83r\83l\83b\83g';
322         MEMO_THREAD: string = '\83X\83\8c\83b\83h\83\8a\83X\83g';
323         MEMO_BROWSERPOPUP: string = '\83u\83\89\83E\83U\83|\83b\83v\83A\83b\83v';
324         MEMO_BROWSERTAB: string = '\83u\83\89\83E\83U\83^\83u';
325         MEMO_EDITOR: string = '\83G\83f\83B\83^\83e\83L\83X\83g';
326         DEFAULT_FONT_NAME: string = '\82l\82\82o\83S\83V\83b\83N';
327         DEFAULT_FONT_SIZE: Integer = 9;
328         DEFAULT_TABFONT_NAME: string = '\82l\82\82o\83S\83V\83b\83N';
329         DEFAULT_TABFONT_SIZE: Integer = 9;
330 //      URL_TORA3: WideString = 'http://2ch.tora3.net/';
331         URL_TORA3: WideString = 'http://ronin.bbspink.com/';
332         DEFAULT_CSS_FILENAME = 'default.css';
333
334 {$R *.DFM}
335
336 procedure TOptionDialog.FormCreate(Sender: TObject);
337 var
338     CenterForm: TCustomForm;
339 begin
340     CenterForm := TCustomForm(Owner);
341     if Assigned(CenterForm) then begin
342         Left := ((CenterForm.Width - Width) div 2) + CenterForm.Left;
343         Top := ((CenterForm.Height - Height) div 2) + CenterForm.Top;
344     end else begin
345         Left := (Screen.Width - Width) div 2;
346         Top := (Screen.Height - Height) div 2;
347     end;
348
349         CSSBrowser.Navigate('about:blank');
350         FClose := True;
351
352         OptionTab.ActivePage := ConnectSheet;
353         SetValue;
354
355         CabinetMemo.Text := GetMemoText(CabinetMemo.Font, MEMO_CABINET);
356         ListMemo.Text := GetMemoText(ListMemo.Font, MEMO_THREAD);
357         HintMemo.Text := GetMemoText(HintMemo.Font, MEMO_BROWSERPOPUP);
358         BrowserTabMemo.Text := GetMemoText(BrowserTabMemo.Font, MEMO_BROWSERTAB);
359         EditorMemo.Text := GetMemoText(EditorMemo.Font, MEMO_EDITOR);
360
361         Tora3URLLabel.Cursor := 5;
362         lblSFont.Caption := '\81\9a\8fd\97v\81\9a'#13#10#13#10
363                                                                                 + '\83X\83\8c\83b\83h\95\\8e¦\83G\83\8a\83A\82Ì\83t\83H\83\93\83g\95Ï\8dX\82Í\81A'#13#10
364                                                                                 + '\81uCSS \82Æ\83X\83L\83\93\81v\83^\83u\82Å\90Ý\92è\8fo\97\88\82Ü\82·';
365
366         ForcedLoginLabel.Caption := '- \83`\83F\83b\83N\82ð\93ü\82ê\82é\82Ì\82Í\83Z\83L\83\85\83\8a\83e\83B\8fã\8dD\82Ü\82µ\82­\82 \82è\82Ü\82¹\82ñ\81B' + #13#10
367                                                                         + '\81@\82â\82Þ\82ð\93¾\82È\82¢\8e\9e\82¾\82¯\82É\82µ\82Ä\82­\82¾\82³\82¢\81B';
368         CSSCheckBoxClick(Sender);
369         BrowserMaxLabel.Caption :=
370                 '\83u\83\89\83E\83U\82ª\8dÅ\8f¬\89»\82³\82ê\82Ä\82¢\82é\82Æ\82«\82É\88È\89º\82Ì\91\80\8dì\82Å\83u\83\89\83E\83U\82ð\8dÅ\91å\89»\82µ\82Ü\82·\81B'#13#10 +
371                 '\82Ü\82½\81A\83z\83C\81[\83\8b\83N\83\8a\83b\83N\82É\82æ\82è\8dÅ\91å\89»\82ð\83L\83\83\83\93\83Z\83\8b\82·\82é\82±\82Æ\82ª\8fo\97\88\82Ü\82·\81B';
372
373         if OptionTab.PageCount > GikoSys.Setting.OptionDialogTabIndex then begin
374                 OptionTab.ActivePageIndex := GikoSys.Setting.OptionDialogTabIndex;
375                 OptionTabChange( nil );
376         end;
377         
378 end;
379
380 procedure TOptionDialog.FormDestroy(Sender: TObject);
381 begin
382         CSSListView.OnChange := nil;
383         if FCSSStrings <> nil then
384                 FCSSStrings.Free;
385         if FCSSFont <> nil then
386                 FCSSFont.Free;
387         sndPlaySound(nil, SND_ASYNC);
388
389 end;
390
391 procedure TOptionDialog.OkBottonClick(Sender: TObject);
392 begin
393         FClose := True;
394         ReadPortEditExit(Sender);
395         WritePortEditExit(Sender);
396         AddressHistoryCountEditExit(Sender);
397     MaxRecordCountEditExit(Sender);
398         PreviewWaitEditExit(Sender);
399
400         if not CheckFolder then begin
401                 FClose := False;
402                 Exit;
403         end;
404                 SetAbonpropertys;
405         SaveSetting;
406         SettingApply;
407
408 end;
409
410 procedure TOptionDialog.ApplyButtonClick(Sender: TObject);
411 begin
412         ReadPortEditExit(Sender);
413         WritePortEditExit(Sender);
414         AddressHistoryCountEditExit(Sender);
415         MaxRecordCountEditExit(Sender);
416         PreviewWaitEditExit(Sender);
417
418         if not CheckFolder then begin
419                 FClose := False;
420                 Exit;
421         end;
422         SetAbonpropertys;
423         SaveSetting;
424         SettingApply;
425         FClose := False;
426 end;
427
428 //function TOptionDialog.GetFontText(Font: TFont; Text: string): string;
429 //begin
430 //      result := Format(Text, [Font.Name, Font.Size]);
431 //end;
432
433 function TOptionDialog.GetMemoText(font: TFont; text: string): string;
434 var
435         s: string;
436 begin
437         s := '';
438         if font <> nil then
439                 s := Format(FONT_TEXT, [Font.Name, Font.Size]) + #13#10;
440         Result := s + text;
441 end;
442
443 //\83L\83\83\83r\83l\83b\83g\83t\83H\83\93\83g\83{\83^\83\93
444 procedure TOptionDialog.CabinetFontBottonClick(Sender: TObject);
445 begin
446         FontDialog.Options := [fdAnsiOnly, fdEffects];
447         FontDialog.Font.Assign(CabinetMemo.Font);
448         if FontDialog.Execute then begin
449                 FontDialog.Font.Style := FontDialog.Font.Style - [fsUnderline] - [fsStrikeout];
450                 CabinetMemo.Font.Assign(FontDialog.Font);
451                 CabinetMemo.Text := GetMemoText(CabinetMemo.Font, MEMO_CABINET);
452                 CabinetMemo.Font.Charset := SHIFTJIS_CHARSET;
453         end;
454 end;
455
456 //\83L\83\83\83r\83l\83b\83g\94w\8ci\90F\83{\83^\83\93
457 procedure TOptionDialog.CabinetColorBottonClick(Sender: TObject);
458 begin
459         ColorDialog.Color := CabinetMemo.Color;
460         if ColorDialog.Execute then begin
461                 CabinetMemo.Color := ColorDialog.Color;
462         end;
463 end;
464
465 //\83L\83\83\83r\83l\83b\83g\83f\83t\83H\83\8b\83g\83{\83^\83\93
466 procedure TOptionDialog.CabinetDefaultButtonClick(Sender: TObject);
467 begin
468         CabinetMemo.Font.Name := DEFAULT_FONT_NAME;
469         CabinetMemo.Font.Size := DEFAULT_FONT_SIZE;
470         CabinetMemo.Font.Color := clWindowText;
471         CabinetMemo.Font.Style := [];
472         CabinetMemo.Color := clWindow;
473         CabinetMemo.Text := GetMemoText(CabinetMemo.Font, MEMO_CABINET);
474 end;
475
476 //\83X\83\8c\83b\83h\83\8a\83X\83g\83t\83H\83\93\83g\83{\83^\83\93
477 procedure TOptionDialog.ListFontBottonClick(Sender: TObject);
478 begin
479         FontDialog.Options := [fdAnsiOnly, fdEffects];
480         FontDialog.Font.Assign(ListMemo.Font);
481         if FontDialog.Execute then begin
482                 ListMemo.Font.Assign(FontDialog.Font);
483                 ListMemo.Text := GetMemoText(ListMemo.Font, MEMO_THREAD);
484                 ListMemo.Font.Charset := SHIFTJIS_CHARSET;
485         end;
486 end;
487
488 //\83X\83\8c\83b\83h\83\8a\83X\83g\94w\8ci\90F\83{\83^\83\93
489 procedure TOptionDialog.ListColorBottonClick(Sender: TObject);
490 begin
491         ColorDialog.Color := ListMemo.Color;
492         if ColorDialog.Execute then begin
493                 ListMemo.Color := ColorDialog.Color;
494         end;
495 end;
496
497 //\83X\83\8c\83b\83h\83\8a\83X\83g\83f\83t\83H\83\8b\83g\83{\83^\83\93
498 procedure TOptionDialog.ListDefaultBottonClick(Sender: TObject);
499 begin
500         ListMemo.Font.Name := DEFAULT_FONT_NAME;
501         ListMemo.Font.Size := DEFAULT_FONT_SIZE;
502         ListMemo.Font.Color := clWindowText;
503         ListMemo.Font.Style := [];
504         ListMemo.Color := clWindow;
505         ListMemo.Text := GetMemoText(ListMemo.Font, MEMO_THREAD);
506 end;
507
508 //\83u\83\89\83E\83U\83|\83b\83v\83A\83b\83v\83t\83H\83\93\83g\83{\83^\83\93
509 procedure TOptionDialog.HintFontButtonClick(Sender: TObject);
510 begin
511         FontDialog.Options := [fdAnsiOnly, fdEffects];
512         FontDialog.Font.Assign(HintMemo.Font);
513         if FontDialog.Execute then begin
514                 HintMemo.Font.Assign(FontDialog.Font);
515                 HintMemo.Text := GetMemoText(HintMemo.Font, MEMO_BROWSERPOPUP);
516                 HintMemo.Font.Charset := SHIFTJIS_CHARSET;
517         end;
518 end;
519
520 //\83u\83\89\83E\83U\83|\83b\83v\83A\83b\83v\94w\8ci\90F\83{\83^\83\93
521 procedure TOptionDialog.HintBackButtonClick(Sender: TObject);
522 begin
523         ColorDialog.Color := HintMemo.Color;
524         if ColorDialog.Execute then begin
525                 HintMemo.Color := ColorDialog.Color;
526         end;
527 end;
528
529 //\83u\83\89\83E\83U\83|\83b\83v\83A\83b\83v\83f\83t\83H\83\8b\83g\83{\83^\83\93
530 procedure TOptionDialog.HintDefaultButtonClick(Sender: TObject);
531 begin
532         HintMemo.Font.Name := DEFAULT_FONT_NAME;
533         HintMemo.Font.Size := DEFAULT_FONT_SIZE;
534         HintMemo.Font.Color := clWindowText;
535         HintMemo.Font.Style := [];
536         HintMemo.Color := clInfoBk;
537         HintMemo.Text := GetMemoText(HintMemo.Font, MEMO_BROWSERPOPUP);
538 end;
539
540 //\83u\83\89\83E\83U\83^\83u\83t\83H\83\93\83g\83{\83^\83\93
541 procedure TOptionDialog.BruwserTabFontButtonClick(Sender: TObject);
542 begin
543         FontDialog.Options := [fdAnsiOnly];
544         FontDialog.Font.Assign(BrowserTabMemo.Font);
545         if FontDialog.Execute then begin
546                 BrowserTabMemo.Font.Assign(FontDialog.Font);
547                 BrowserTabMemo.Text := GetMemoText(FontDialog.Font, MEMO_BROWSERTAB);
548                 BrowserTabMemo.Font.Charset := SHIFTJIS_CHARSET;
549         end;
550 end;
551
552 //\83u\83\89\83E\83U\83^\83u\83f\83t\83H\83\8b\83g\83{\83^\83\93
553 procedure TOptionDialog.BrowserTabDefaultButtonClick(Sender: TObject);
554 begin
555         BrowserTabMemo.Font.Name := DEFAULT_TABFONT_NAME;
556         BrowserTabMemo.Font.Size := DEFAULT_TABFONT_SIZE;
557         BrowserTabMemo.Font.Color := clWindowText;
558         BrowserTabMemo.Font.Style := [];
559         BrowserTabMemo.Color := clBtnFace;
560         BrowserTabMemo.Text := GetMemoText(BrowserTabMemo.Font, MEMO_BROWSERTAB);
561 end;
562
563 //\83G\83f\83B\83^\83t\83H\83\93\83g\83{\83^\83\93
564 procedure TOptionDialog.EditorFontBottonClick(Sender: TObject);
565 begin
566         FontDialog.Options := [fdAnsiOnly, fdEffects];
567         FontDialog.Font.Assign(EditorMemo.Font);
568         if FontDialog.Execute then begin
569                 EditorMemo.Font.Assign(FontDialog.Font);
570                 EditorMemo.Text := GetMemoText(EditorMemo.Font, MEMO_EDITOR);
571                 EditorMemo.Font.Charset := SHIFTJIS_CHARSET;
572         end;
573 end;
574
575 //\83G\83f\83B\83^\94w\8ci\90F\83{\83^\83\93
576 procedure TOptionDialog.EditorColorBottonClick(Sender: TObject);
577 begin
578         ColorDialog.Color := EditorMemo.Font.Color;
579         if ColorDialog.Execute then begin
580                 EditorMemo.Color := ColorDialog.Color;
581         end;
582 end;
583
584 //\83G\83f\83B\83^\83f\83t\83H\83\8b\83g\83{\83^\83\93
585 procedure TOptionDialog.EditorDefaultBottonClick(Sender: TObject);
586 begin
587         EditorMemo.Font.Name := DEFAULT_FONT_NAME;
588         EditorMemo.Font.Size := DEFAULT_FONT_SIZE;
589         EditorMemo.Font.Color := clWindowText;
590         EditorMemo.Font.Style := [];
591         EditorMemo.Color := clWindow;
592         EditorMemo.Text := GetMemoText(EditorMemo.Font, MEMO_EDITOR);
593 end;
594
595 procedure TOptionDialog.SetValue;
596 var
597         i: Integer;
598         Item: TListItem;
599 //      s: string;
600         idx: Integer;
601         FileList : TStringList;
602     DomainList : TStringList;
603 begin
604
605         //\93Ç\82Ý\8d\9e\82Ý\97p\83v\83\8d\83L\83V
606         ReadProxyCheck.Checked := GikoSys.Setting.ReadProxy;
607         ReadProxyCheckClick(nil);
608         ReadProxyAddressEdit.Text := GikoSys.Setting.ReadProxyAddress;
609         ReadPortEdit.Text := IntToStr(GikoSys.Setting.ReadProxyPort);
610         ReadProxyUserIDEdit.Text := GikoSys.Setting.ReadProxyUserID;
611         ReadProxyPasswordEdit.Text := GikoSys.Setting.ReadProxyPassword;
612         //\8f\91\82«\8d\9e\82Ý\97p\83v\83\8d\83L\83V
613         WriteProxyCheck.Checked := GikoSys.Setting.WriteProxy;
614         WriteProxyCheckClick(nil);
615         WriteProxyAddressEdit.Text := GikoSys.Setting.WriteProxyAddress;
616         WritePortEdit.Text := IntToStr(GikoSys.Setting.WriteProxyPort);
617         WriteProxyUserIDEdit.Text := GikoSys.Setting.WriteProxyUserID;
618         WriteProxyPasswordEdit.Text := GikoSys.Setting.WriteProxyPassword;
619         //\83L\83\83\83r\83l\83b\83g\83t\83H\83\93\83g
620         CabinetMemo.Font.Name := GikoSys.Setting.CabinetFontName;
621         CabinetMemo.Font.Size := GikoSys.Setting.CabinetFontSize;
622         CabinetMemo.Font.Color := GikoSys.Setting.CabinetFontColor;
623         CabinetMemo.Font.Style := [];
624         if GikoSys.Setting.CabinetFontBold then
625                 CabinetMemo.Font.Style := [fsBold];
626         if GikoSys.Setting.CabinetFontItalic then
627                 CabinetMemo.Font.Style := CabinetMemo.Font.Style + [fsItalic];
628         CabinetMemo.Color := GikoSys.Setting.CabinetBackColor;
629
630         //\83X\83\8c\83b\83h\83\8a\83X\83g\83t\83H\83\93\83g
631         ListMemo.Font.Name := GikoSys.Setting.ListFontName;
632         ListMemo.Font.Size := GikoSys.Setting.ListFontSize;
633         ListMemo.Font.Color := GikoSys.Setting.ListFontColor;
634         ListMemo.Font.Style := [];
635         if GikoSys.Setting.ListFontBold then
636                 ListMemo.Font.Style := ListMemo.Font.Style + [fsBold];
637         if GikoSys.Setting.ListFontItalic then
638                 ListMemo.Font.Style := ListMemo.Font.Style + [fsItalic];
639
640         ListMemo.Color := GikoSys.Setting.ListBackColor;
641         //\83\8c\83X\90\94\91\9d\8c¸\83X\83\8c\8b­\92²\95\\8e¦\83`\83F\83b\83N\83{\83b\83N\83X\81\95\83J\83\89\81[\83_\83C\83A\83\8d\83O
642         OddResNumCheckBox.Checked := GikoSys.Setting.UseOddColorOddResNum;
643         OddResNumColorBox.Selected := GikoSys.Setting.OddColor;
644         OddResNumColorBox.Enabled := OddResNumCheckBox.Checked;
645         UnFocusedBoldCheckBox.Checked := GikoSys.Setting.UnFocusedBold;
646         UnFocusedBoldCheckBox.Enabled := OddResNumCheckBox.Checked;
647
648         //\83u\83\89\83E\83U\83|\83b\83v\83A\83b\83v\83t\83H\83\93\83g
649         HintMemo.Font.Name := GikoSys.Setting.HintFontName;
650         HintMemo.Font.Size := GikoSys.Setting.HintFontSize;
651         HintMemo.Font.Color := GikoSys.Setting.HintFontColor;
652         HintMemo.Color := GikoSys.Setting.HintBackColor;
653         //\83u\83\89\83E\83U\83^\83u\83t\83H\83\93\83g
654         BrowserTabMemo.Font.Name := GikoSys.Setting.BrowserTabFontName;
655         BrowserTabMemo.Font.Size := GikoSys.Setting.BrowserTabFontSize;
656         BrowserTabMemo.Font.Style := [];
657         if GikoSys.Setting.BrowserTabFontBold then
658                 BrowserTabMemo.Font.Style := BrowserTabMemo.Font.Style + [fsBold];
659         if GikoSys.Setting.BrowserTabFontItalic then
660                 BrowserTabMemo.Font.Style := BrowserTabMemo.Font.Style + [fsItalic];
661         //\83G\83f\83B\83^\83\81\83\82\83t\83H\83\93\83g
662         EditorMemo.Font.Name := GikoSys.Setting.EditorFontName;
663         EditorMemo.Font.Size := GikoSys.Setting.EditorFontSize;
664         EditorMemo.Font.Color := GikoSys.Setting.EditorFontColor;
665         EditorMemo.Color := GikoSys.Setting.EditorBackColor;
666         //CSS\95\\8e¦
667         CSSCheckBox.Checked := GikoSys.Setting.UseCSS;
668         //\82©\82¿\82ã\83X\83L\83\93\8eg\97p
669         UseKatjuTypeSkinCheckBox.Checked := GikoSys.Setting.UseKatjushaType;
670         if FCSSFont <> nil then
671                 FCSSFont.Free;
672         FCSSFont := TFont.Create;
673         if (GikoSys.Setting.BrowserFontName <> '') or
674                  (GikoSys.Setting.BrowserFontSize <> 0) or
675                  (GikoSys.Setting.BrowserFontBold <> 0) or
676                  (GikoSys.Setting.BrowserFontItalic <> 0) or
677                  (GikoSys.Setting.BrowserFontColor <> -1 ) then begin
678                 CSSFontCheckBox.Checked := True;
679                 FCSSFont.Name := GikoSys.Setting.BrowserFontName;
680                 FCSSFont.Size := GikoSys.Setting.BrowserFontSize;
681                 FCSSFont.Style := [];
682                 if GikoSys.Setting.BrowserFontBold = 1 then
683                         FCSSFont.Style := FCSSFont.Style + [fsBold];
684                 if GikoSys.Setting.BrowserFontItalic = 1 then
685                         FCSSFont.Style := FCSSFont.Style + [fsItalic];
686                 i := GikoSys.Setting.BrowserFontColor;
687                 i := (i shr 16) or (i and $ff00) or ((i and $ff) shl 16);
688                 FCSSFont.Color := i;
689         end;
690         if GikoSys.Setting.BrowserBackColor <> -1 then begin
691                 CSSBackColorCheckBox.Checked := True;
692
693                 i := GikoSys.Setting.BrowserBackColor;
694                 i := (i shr 16) or (i and $ff00) or ((i and $ff) shl 16);
695                 FCSSBackColor := i;
696         end;
697         //
698         //\83X\83^\83C\83\8b\83V\81[\83g\83t\83@\83C\83\8b\96¼\88ê\97\97
699         FileList := TStringList.Create;
700         try
701         FileList.BeginUpdate;
702                 GikoSys.GetFileList(GikoSys.GetStyleSheetDir, '*.css', FileList, True, True);
703         FileList.EndUpdate;
704                 Idx := Length(GikoSys.GetStyleSheetDir);
705                 for i := 0 to FileList.Count - 1 do
706                         FileList[i] := Copy(FileList[i], Idx + 1, Length(FileList[i]));
707                 FileList.Sort;
708                 for i := 0 to FileList.Count - 1 do begin
709                         //s := ExtractFileName(FileList[i]);
710                         if LowerCase(FileList[i]) = DEFAULT_CSS_FILENAME then
711                                 Item := CSSListView.Items.Insert(0)
712                         else
713                                 Item := CSSListView.Items.Add;
714                         Item.Caption := ChangeFileExt(FileList[i], '');
715                         if LowerCase(FileList[i]) = LowerCase(GikoSys.Setting.CSSFileName) then
716                                 Item.Selected := True;
717                 end;
718         finally
719                 FileList.Free;
720         end;
721         //\83X\83L\83\93\83t\83@\83C\83\8b\96¼\88ê\97\97
722         //FileList := TStringList.Create;
723         if FCSSStrings <> nil then
724                 FCSSStrings.Clear;
725         FCSSStrings := TStringList.Create;
726         try
727                 GikoSys.GetDirectoryList(GikoSys.GetSkinDir, '*', FCSSStrings, False);
728
729                 Idx := Length(GikoSys.GetSkinDir);
730                 FCSSStrings.Sort;
731                 for i := 0 to FCSSStrings.Count - 1 do begin
732                         Item := CSSListView.Items.Add;
733                         Item.Data := PChar( FCSSStrings[i] );
734                         Item.Caption := Copy( FCSSStrings[i], Idx + 1, Length(FCSSStrings[i]) );
735                         if LowerCase(FCSSStrings[i]) = LowerCase(GikoSys.Setting.CSSFileName) then
736                                 Item.Selected := True;
737                 end;
738         finally
739         end;
740
741         if (CSSListView.ItemIndex = -1) and (CSSListView.Items.Count > 0) then
742                 CSSListView.Items[0].Selected := True;
743
744         //Mail\97\93\95\\8e¦
745         ShowMailCheckBox.Checked := GikoSys.Setting.ShowMail;
746     //BE2.0\83A\83C\83R\83\93\81EEmoticons\82ð\89æ\91\9c\95\\8e¦\82·\82é
747     DispImageCheckBox.Checked := GikoSys.Setting.IconImageDisplay;
748
749         // \8bN\93®\8e\9e\83\8c\83X\95\\8e¦\94Í\88Í\82Ì\8cÅ\92è
750         ResRangeHoldCheckBox.Checked := GikoSys.Setting.ResRangeHold;
751         case GikoSys.Setting.ResRange of
752         Ord( grrAll ):  ResRangeHoldComboBox.ItemIndex := 0;
753         Ord( grrKoko ): ResRangeHoldComboBox.ItemIndex := 2;
754         Ord( grrNew ):  ResRangeHoldComboBox.ItemIndex := 3;
755         10..65535:                                              ResRangeHoldComboBox.ItemIndex := 1;
756         end;
757         ResRangeHoldComboBox.Enabled := GikoSys.Setting.ResRangeHold;
758         //\83^\83u\92Ç\89Á\88Ê\92u
759         TabAddRadioGroup.ItemIndex := Ord(GikoSys.Setting.BrowserTabAppend);
760         //\94Â\8dX\90VURL
761         //BoardURL2chEdit.Text := GikoSys.Setting.BoardURL2ch;
762                 BoardURLComboBox.Clear;
763                 BoardURLComboBox.Items.AddStrings(GikoSys.Setting.BoardURLs);
764                 try
765                         BoardURLComboBox.ItemIndex := GikoSys.Setting.BoardURLSelected - 1;
766                 except
767                         BoardURLComboBox.ItemIndex := 0;
768                 end;
769         //\94F\8fØ
770         UserIDEdit.Text := GikoSys.Setting.UserID;
771         PasswordEdit.Text := GikoSys.Setting.Password;
772         AutoLoginCheckBox.Checked := GikoSys.Setting.AutoLogin;
773         ForcedLoginCheckBox.Checked := GikoSys.Setting.ForcedLogin;
774         //\83\8d\83O\83t\83H\83\8b\83_
775         if GikoSys.Setting.NewLogFolder = '' then
776                 LogFolderEdit.Text := GikoSys.Setting.LogFolder
777         else
778                 LogFolderEdit.Text := GikoSys.Setting.NewLogFolder;
779         //\83T\83E\83\93\83h
780         for i := 0 to GikoSys.Setting.GetSoundCount - 1 do begin
781                 Item := SoundListView.Items.Add;
782                 Item.Caption := GikoSys.Setting.SoundViewName[i];
783                 if FileExists(GikoSys.Setting.SoundFileName[i]) then
784                         Item.SubItems.Add(GikoSys.Setting.SoundFileName[i])
785                 else
786                         Item.SubItems.Add('');
787         end;
788         //URL\83N\83\8a\83b\83N\8e\9e\93®\8dì
789         URLAppCheckBox.Checked := GikoSys.Setting.URLApp;
790         URLAppCheckBoxClick(nil);
791         AppFolderEdit.Text := GikoSys.Setting.URLAppFile;
792
793         //mailto\83N\83\8a\83b\83N\8e\9e\93®\8dì
794         OpenMailerCheckBox.Checked := GikoSys.Setting.OpenMailer;
795
796         //\83\8d\83O\8dí\8f\9c\8e\9e\83\81\83b\83Z\81[\83W
797         LogDeleteMessageCheckBox.Checked := GikoSys.Setting.DeleteMsg;
798     //\93¯ID\83\8c\83X\83A\83\93\83J\81[\95\\8e¦\82Ì\90§\8cÀ\90\94\89z\82¦\83\81\83b\83Z\81[\83W
799     IgnoreLimitResCountCheckBox.Checked := GikoSys.Setting.LimitResCountMessage;
800
801         //\8fI\97¹\8e\9e\8am\94F\83_\83C\83A\83\8d\83O
802         ShowDialogForEndCheckBox.Checked := GikoSys.Setting.ShowDialogForEnd;
803         //AllTabClose
804         AllTabCloseCheckBox.Checked := GikoSys.Setting.ShowDialogForAllTabClose;
805         //Samba
806         UseSambaCheckBox.Checked := GikoSys.Setting.UseSamba;
807         ResAnchorCheckBox.Checked := GikoSys.Setting.ResAnchorJamp;
808         // \83u\83\89\83E\83U\8dÅ\91å\89»
809         BrowserMaxCombo.ItemIndex := Ord( GikoSys.Setting.BrowserAutoMaximize );
810         //\83|\83b\83v\83A\83b\83v\88Ê\92u
811         case GikoSys.Setting.PopupPosition of
812                 gppRightTop:            gppRightTopRB.Checked := True;
813                 gppRight:                       gppRightRB.Checked := True;
814                 gppRightBottom:     gppRighBottomRB.Checked := True;
815                 gppTop:                         gppTopRB.Checked := True;
816                 gppCenter:                      gppTopRB.Checked := True; // \93Ç\82Ý\8d\9e\82Ý\82Å\95Ï\8a·\82µ\82Ä\82é\82Í\82¸
817                 gppBottom:                      gppBottomRB.Checked := True;
818                 gppLeftTop:             gppLeftTopRB.Checked := True;
819                 gppLeft:                        gppLeftRB.Checked := True;
820                 gppLeftBottom:      gppLeftBottomRB.Checked := True;
821         end;
822
823         //\94ñ\83A\83N\83e\83B\83u\8e\9e\83|\83b\83v\83A\83b\83v\95\\8e¦
824         UnActivePopupCheckBox.Checked := GikoSys.Setting.UnActivePopup;
825         //\83\8c\83X\83|\83b\83v\83A\83b\83v\83{\81[\83\8b\83h\95\\8e¦
826         ResPopupBoldCheckBox.Checked := GikoSys.Setting.ResPopupHeaderBold;
827
828         //\83A\83h\83\8c\83X\83o\81[
829         URLDisplayCheckBox.Checked := GikoSys.Setting.URLDisplay;
830         TabStopAddressBarCheckBox.Checked := GikoSys.Setting.AddressBarTabStop;
831         LinkAddCheckBox.Checked := GikoSys.Setting.LinkAddAddressBar;
832         AddressHistoryCountEdit.Text := IntToStr(GikoSys.Setting.AddressHistoryCount);
833
834         //HTML\83v\83\8c\83r\83\85\81[
835         PreviewVisibleCheckBox.Checked := GikoSys.Setting.PreviewVisible;
836         PreviewWaitEdit.Text := IntToStr(GikoSys.Setting.PreviewWait);
837         PreviewSizeComboBox.ItemIndex := 2;
838         case GikoSys.Setting.PreviewSize of
839                 gpsXLarge: PreviewSizeComboBox.ItemIndex := 4;
840                 gpsLarge: PreviewSizeComboBox.ItemIndex := 3;
841                 gpsMedium: PreviewSizeComboBox.ItemIndex := 2;
842                 gpsSmall: PreviewSizeComboBox.ItemIndex := 1;
843                 gpsXSmall: PreviewSizeComboBox.ItemIndex := 0;
844         end;
845
846         //\83X\83\8c\83b\83h\88ê\97\97\8dX\90V\83A\83C\83R\83\93
847         ThreadListIconCheckBox.Checked := GikoSys.Setting.ListIconVisible;
848         CreationTimeLogsCheckBox.Checked := GikoSys.Setting.CreationTimeLogs;
849         FutureThreadCheckBox.Checked := GikoSys.Setting.FutureThread;
850         SelectIntervalEdit.Text := IntToStr(GikoSys.Setting.SelectInterval);
851
852         //dat\97\8e\82¿\83X\83\8c\83\\81[\83g\8f\87
853         case TGikoBoardColumnID( GikoSys.Setting.DatOchiSortIndex ) of
854                 gbcTitle:
855                         if GikoSys.Setting.DatOchiSortOrder then
856                                 DatOchiSortCombo.ItemIndex := 1
857                         else
858                                 DatOchiSortCombo.ItemIndex := 2;
859                 gbcRoundDate://gbcLastModified:
860                         if GikoSys.Setting.DatOchiSortOrder then
861                                 DatOchiSortCombo.ItemIndex := 3
862                         else
863                                 DatOchiSortCombo.ItemIndex := 4;
864                 gbcCreated:
865                         if GikoSys.Setting.DatOchiSortOrder then
866                                 DatOchiSortCombo.ItemIndex := 5
867                         else
868                                 DatOchiSortCombo.ItemIndex := 6;
869                 gbcLastModified:
870                         if GikoSys.Setting.DatOchiSortOrder then
871                                 DatOchiSortCombo.ItemIndex := 7
872                         else
873                                 DatOchiSortCombo.ItemIndex := 8;
874         else
875                 DatOchiSortCombo.ItemIndex := 0;
876         end;
877         AutoSortCheckBox.Checked := GikoSys.Setting.AutoSortThreadList;
878         
879         //\82 \82Ú\81`\82ñ
880         RloCheckBox.Checked := GikoSys.Setting.AbonDeleterlo;
881         ReplaceulCheckBox.Checked := GikoSys.Setting.AbonReplaceul;
882         PopUpAbonCheckBox.Checked := GikoSys.Setting.PopUpAbon;
883         ShowNGLineCheckBox.Checked := GikoSys.Setting.ShowNGLinesNum;
884         AddResAnchorCheckBox.Checked := GikoSys.Setting.AddResAnchor;
885         DeleteSyriaCheckBox.Checked := GikoSys.Setting.DeleteSyria;
886         IgnoreKanaCheckBox.Checked := GikoSys.Setting.IgnoreKana;
887 {$IFDEF SPAM_FILTER_ENABLED}
888         // \83X\83p\83\80\83t\83B\83\8b\83^\82Ì\90Ý\92è\82ð\95\\8e¦\82·\82é
889         SpamFilterGroupBox.Visible := True;
890 {$ENDIF}
891         // \8eg\97p\82·\82é\83X\83p\83\80\83t\83B\83\8b\83^
892 {$IFDEF DEBUG}
893         SpamFilterAlgorithmComboBox.Clear;
894         SpamFilterAlgorithmComboBox.AddItem( '\8eg\97p\82µ\82È\82¢', nil );
895         SpamFilterAlgorithmComboBox.AddItem( 'Paul Graham \96@', nil );
896         SpamFilterAlgorithmComboBox.AddItem( 'Gary Robinson \96@', nil );
897         SpamFilterAlgorithmComboBox.AddItem( 'Gary Robinson-Fisher \96@', nil );
898 {$ENDIF}
899         SpamFilterAlgorithmComboBox.ItemIndex :=
900                 Ord( GikoSys.Setting.SpamFilterAlgorithm );
901
902         //TabAutoLoad
903         TabLoadSave.Checked := Gikosys.Setting.TabAutoLoadSave;
904         UseUndecidedCheckBox.Checked := GikoSys.Setting.UseUndecided;
905
906     // \83\8c\83X\83G\83f\83B\83^Unicode\93ü\97Í
907     UseUnicodeCB.Checked := Gikosys.Setting.UseUnicode;
908     // \83X\83\8c\83^\83C\93Á\92è\95\8e\9a\97ñ\8f\9c\8b\8e
909     ThreadTitleTrimCheckBox.Checked := GikoSys.Setting.ThreadTitleTrim;
910
911         //Be2ch\94F\8fØ
912         BeUserIDEdit.Text := GikoSys.Setting.BeUserID;
913         BeCodeEdit.Text := GikoSys.Setting.BePassword;
914         BeAutoLoginCheckBox.Checked := GikoSys.Setting.BeAutoLogin;
915         //\97\9a\97ð\82Ì\8dÅ\91å\95Û\91\90\94
916         MaxRecordCountEdit.Text := IntToStr(GikoSys.Setting.MaxRecordCount);
917     // \8dÅ\8f¬\89»\8e\9e\82É\83^\83X\83N\83g\83\8c\83C\82É\8ai\94[\82·\82é\82©
918     StoredTaskTrayCB.Checked := GikoSys.Setting.StoredTaskTray;
919     // \83u\83\89\83E\83U\83^\83u\82Ì\88Ú\93®\82Å\83\8b\81[\83v\82ð\8b\96\89Â\82·\82é\82©
920     LoopBrowserTabsCB.Checked := GikoSys.Setting.LoopBrowserTabs;
921     //
922     IgnoreContextCheckBox.Checked := GikoSys.Setting.GestureIgnoreContext;
923
924     // \96`\8c¯\82Ì\8f\91\83h\83\81\83C\83\93\88ê\97\97\8eæ\93¾
925     BoukenComboBox.Text := '';
926     BoukenComboBox.Items.Clear;
927     DomainList := TStringList.Create;
928     GikoSys.GetBoukenDomain(DomainList);
929     for i := 0 to DomainList.Count - 1 do begin
930         BoukenComboBox.Items.Add( DomainList[i] ) ;
931     end;
932     DomainList.Free;
933     BoukenComboBox.ItemIndex := 0;
934     BoukenComboBox.OnChange(nil);
935 end;
936
937 procedure TOptionDialog.SaveSetting;
938 var
939         i: Integer;
940         tmp: string;
941 //      Item: TListItem;
942 begin
943         GikoSys.Setting.OptionDialogTabIndex := OptionTab.TabIndex;
944
945         GikoSys.Setting.ReadProxy := ReadProxyCheck.Checked;
946         GikoSys.Setting.ReadProxyAddress := ReadProxyAddressEdit.Text;
947         GikoSys.Setting.ReadProxyPort := StrToInt(ReadPortEdit.Text);
948         GikoSys.Setting.ReadProxyUserID := ReadProxyUserIDEdit.Text;
949         GikoSys.Setting.ReadProxyPassword := ReadProxyPasswordEdit.Text;
950
951         GikoSys.Setting.WriteProxy := WriteProxyCheck.Checked;
952         GikoSys.Setting.WriteProxyAddress := WriteProxyAddressEdit.Text;
953         GikoSys.Setting.WriteProxyPort := StrToInt(WritePortEdit.Text);
954         GikoSys.Setting.WriteProxyUserID := WriteProxyUserIDEdit.Text;
955         GikoSys.Setting.WriteProxyPassword := WriteProxyPasswordEdit.Text;
956
957         GikoSys.Setting.CabinetFontName := CabinetMemo.Font.Name;
958         GikoSys.Setting.CabinetFontSize := CabinetMemo.Font.Size;
959         GikoSys.Setting.CabinetFontColor := CabinetMemo.Font.Color;
960         GikoSys.Setting.CabinetFontBold  := fsBold in CabinetMemo.Font.Style;
961         GikoSys.Setting.CabinetFontItalic:= fsItalic in CabinetMemo.Font.Style;
962         GikoSys.Setting.CabinetBackColor := CabinetMemo.Color;
963
964         GikoSys.Setting.ListFontName    := ListMemo.Font.Name;
965         GikoSys.Setting.ListFontSize    := ListMemo.Font.Size;
966         GikoSys.Setting.ListFontColor   := ListMemo.Font.Color;
967         GikoSys.Setting.ListFontBold    := fsBold in ListMemo.Font.Style;
968         GikoSys.Setting.ListFontItalic  := fsItalic in ListMemo.Font.Style;
969         GikoSys.Setting.ListBackColor := ListMemo.Color;
970         GikoSys.Setting.UseOddColorOddResNum := OddResNumCheckBox.Checked;
971         GikoSys.Setting.OddColor := OddResNumColorBox.Selected;
972         GikoSys.Setting.UnFocusedBold := (UnFocusedBoldCheckBox.Enabled) and
973                                                                                 (UnFocusedBoldCheckBox.Checked);
974
975         GikoSys.Setting.HintFontName := HintMemo.Font.Name;
976         GikoSys.Setting.HintFontSize := HintMemo.Font.Size;
977         GikoSys.Setting.HintFontColor := HintMemo.Font.Color;
978         GikoSys.Setting.HintBackColor := HintMemo.Color;
979
980         GikoSys.Setting.BrowserTabFontName := BrowserTabMemo.Font.Name;
981         GikoSys.Setting.BrowserTabFontSize := BrowserTabMemo.Font.Size;
982         GikoSys.Setting.BrowserTabFontBold := fsBold in BrowserTabMemo.Font.Style;
983         GikoSys.Setting.BrowserTabFontItalic := fsItalic in BrowserTabMemo.Font.Style;
984         GikoSys.Setting.EditorFontName := EditorMemo.Font.Name;
985         GikoSys.Setting.EditorFontSize := EditorMemo.Font.Size;
986         GikoSys.Setting.EditorFontColor := EditorMemo.Font.Color;
987         GikoSys.Setting.EditorBackColor := EditorMemo.Color;
988         {FRepaintThread : \95\\8e¦\8dÏ\82Ý\83X\83\8c\83b\83h\82Ì\8dÄ\95`\89æ\82ª\95K\97v\82©\82Ç\82¤\82©
989         \90Ý\92è\82ª\95Ï\82í\82Á\82Ä\82¢\82½\8fê\8d\87\81Atrue\82É\82µ\82Ä\8aù\82É\95\\8e¦\82µ\82Ä\82¢\82é\91S\82Ä\82Ì
990         \83X\83\8c\83b\83h\82ÌRepaint\82ðtrue\82É\82·\82é
991         }
992         //CSS\95\\8e¦
993         if GikoSys.Setting.UseCSS <> CSSCheckBox.Checked then FRepaintThread := true;
994         GikoSys.Setting.UseCSS := CSSCheckBox.Checked;
995         GikoSys.Setting.UseKatjushaType := UseKatjuTypeSkinCheckBox.Checked;
996         //CSS\83t\83@\83C\83\8b\96¼
997         tmp := GikoSys.Setting.CSSFileName;
998         GikoSys.Setting.CSSFileName := DEFAULT_CSS_FILENAME;
999         if CSSListView.Items.Count > 0 then begin
1000                 try
1001                         if CSSListView.Items[CSSListView.ItemIndex].Data <> nil then
1002                                 GikoSys.Setting.CSSFileName := string( CSSListView.Items[CSSListView.ItemIndex].data )
1003                         else
1004                                 GikoSys.Setting.CSSFileName := CSSListView.Items[CSSListView.ItemIndex].Caption + '.css';
1005                 except
1006                 end;
1007         end;
1008         if tmp <> GikoSys.Setting.CSSFileName then FRepaintThread := true;
1009         // CSS \82Ì\83t\83H\83\93\83g\8ew\92è
1010         if CSSFontCheckBox.Checked then begin
1011                 if GikoSys.Setting.BrowserFontName <> FCSSFont.Name then FRepaintThread := true;
1012                 GikoSys.Setting.BrowserFontName := FCSSFont.Name;
1013                 if GikoSys.Setting.BrowserFontSize <> FCSSFont.Size then FRepaintThread := true;
1014                 GikoSys.Setting.BrowserFontSize := FCSSFont.Size;
1015                 if fsBold in FCSSFont.Style then begin
1016                         if GikoSys.Setting.BrowserFontBold <> 1 then FRepaintThread := true;
1017                         GikoSys.Setting.BrowserFontBold := 1;
1018                 end else begin
1019                         if GikoSys.Setting.BrowserFontBold <> -1 then FRepaintThread := true;
1020                         GikoSys.Setting.BrowserFontBold := -1;
1021                 end;
1022                 if fsItalic in FCSSFont.Style then begin
1023                         if GikoSys.Setting.BrowserFontItalic <> 1 then FRepaintThread := true;
1024                         GikoSys.Setting.BrowserFontItalic := 1;
1025                 end else begin
1026                         if GikoSys.Setting.BrowserFontItalic <> -1 then FRepaintThread := true;
1027                         GikoSys.Setting.BrowserFontItalic := -1;
1028                 end;
1029                 i := ColorToRGB( FCSSFont.Color );
1030                 if (GikoSys.Setting.BrowserFontColor <> (i shr 16) or (i and $ff00) or ((i and $ff) shl 16)) then
1031                         FRepaintThread := true;
1032                 GikoSys.Setting.BrowserFontColor := (i shr 16) or (i and $ff00) or ((i and $ff) shl 16);
1033         end else begin
1034                 if GikoSys.Setting.BrowserFontName <> '' then FRepaintThread := true;
1035                 GikoSys.Setting.BrowserFontName := '';
1036                 if GikoSys.Setting.BrowserFontSize <> 0 then FRepaintThread := true;
1037                 GikoSys.Setting.BrowserFontSize := 0;
1038                 if GikoSys.Setting.BrowserFontBold <> 0 then FRepaintThread := true;
1039                 GikoSys.Setting.BrowserFontBold := 0;
1040                 if GikoSys.Setting.BrowserFontItalic <> 0 then FRepaintThread := true;
1041                 GikoSys.Setting.BrowserFontItalic := 0;
1042                 if GikoSys.Setting.BrowserFontColor <> -1 then FRepaintThread := true;
1043                 GikoSys.Setting.BrowserFontColor := -1;
1044         end;
1045         if CSSBackColorCheckBox.Checked then begin
1046                 i := ColorToRGB( FCSSBackColor );
1047                 if(GikoSys.Setting.BrowserBackColor <> (i shr 16) or (i and $ff00) or ((i and $ff) shl 16)) then
1048                         FRepaintThread := true;
1049                 GikoSys.Setting.BrowserBackColor := (i shr 16) or (i and $ff00) or ((i and $ff) shl 16);
1050         end else begin
1051                 if GikoSys.Setting.BrowserBackColor <> -1 then FRepaintThread := true;
1052                 GikoSys.Setting.BrowserBackColor := -1;
1053         end;
1054
1055         //Mail\97\93\95\\8e¦
1056         if GikoSys.Setting.ShowMail <> ShowMailCheckBox.Checked then FRepaintThread := true;
1057         GikoSys.Setting.ShowMail := ShowMailCheckBox.Checked;
1058     //BE2.0\83A\83C\83R\83\93\81EEmoticons\82ð\89æ\91\9c\95\\8e¦\82·\82é
1059     GikoSys.Setting.IconImageDisplay := DispImageCheckBox.Checked;
1060         // \8bN\93®\8e\9e\83\8c\83X\95\\8e¦\94Í\88Í\82Ì\8cÅ\92è
1061         GikoSys.Setting.ResRangeHold := ResRangeHoldCheckBox.Checked;
1062         case ResRangeHoldComboBox.ItemIndex of
1063                 0: GikoSys.Setting.ResRange := Ord( grrAll );
1064                 1: GikoSys.Setting.ResRange := GikoSys.Setting.ResRangeExCount;
1065                 2: GikoSys.Setting.ResRange := Ord( grrKoko );
1066                 3: GikoSys.Setting.ResRange := Ord( grrNew );
1067         end;
1068
1069         GikoSys.Setting.BrowserTabAppend := TGikoTabAppend(TabAddRadioGroup.ItemIndex);
1070
1071 //      GikoSys.Setting.BoardURL2ch := BoardURL2chEdit.Text;
1072         GikoSys.Setting.BoardURLs.Clear;
1073         GikoSys.Setting.BoardURLs.AddStrings(BoardURLComboBox.Items);
1074         GikoSys.Setting.BoardURLSelected := BoardURLComboBox.ItemIndex + 1;
1075         GikoSys.Setting.UserID := UserIDEdit.Text;
1076         GikoSys.Setting.Password := PasswordEdit.Text;
1077         GikoSys.Setting.AutoLogin := AutoLoginCheckBox.Checked;
1078         GikoSys.Setting.ForcedLogin := ForcedLoginCheckBox.Checked;
1079         GikoSys.Setting.URLApp := URLAppCheckBox.Checked;
1080         GikoSys.Setting.URLAppFile := AppFolderEdit.Text;
1081
1082         GikoSys.Setting.OpenMailer := OpenMailerCheckBox.Checked;
1083         GikoSys.Setting.DeleteMsg := LogDeleteMessageCheckBox.Checked;
1084     GikoSys.Setting.LimitResCountMessage := IgnoreLimitResCountCheckBox.Checked;
1085
1086         //\8fI\97¹\8e\9e\8am\94F\83_\83C\83A\83\8d\83O
1087         GikoSys.Setting.ShowDialogForEnd := ShowDialogForEndCheckBox.Checked;
1088         //AllTabClose
1089         GikoSys.Setting.ShowDialogForAllTabClose := AllTabCloseCheckBox.Checked;
1090         //Samba
1091         GikoSys.Setting.UseSamba := UseSambaCheckBox.Checked;
1092         GikoSys.Setting.ResAnchorJamp := ResAnchorCheckBox.Checked;
1093         // \83u\83\89\83E\83U\8dÅ\91å\89»
1094         GikoSys.Setting.BrowserAutoMaximize := TGikoBrowserAutoMaximize( BrowserMaxCombo.ItemIndex );
1095         //\83|\83b\83v\83A\83b\83v\88Ê\92u
1096     if (gppRightTopRB.Checked) then GikoSys.Setting.PopupPosition := gppRightTop;
1097     if (gppRightRB.Checked) then GikoSys.Setting.PopupPosition := gppRight;
1098     if (gppRighBottomRB.Checked) then GikoSys.Setting.PopupPosition := gppRightBottom;
1099     if (gppTopRB.Checked) then GikoSys.Setting.PopupPosition := gppTop;
1100     if (gppBottomRB.Checked) then GikoSys.Setting.PopupPosition := gppBottom;
1101     if (gppLeftTopRB.Checked) then GikoSys.Setting.PopupPosition := gppLeftTop;
1102     if (gppLeftRB.Checked) then GikoSys.Setting.PopupPosition := gppLeft;
1103     if (gppLeftBottomRB.Checked) then GikoSys.Setting.PopupPosition := gppLeftBottom;
1104         //\94ñ\83A\83N\83e\83B\83u\8e\9e\83|\83b\83v\83A\83b\83v\95\\8e¦
1105         GikoSys.Setting.UnActivePopup := UnActivePopupCheckBox.Checked;
1106         //\83\8c\83X\83|\83b\83v\83A\83b\83v\83{\81[\83\8b\83h\95\\8e¦
1107         GikoSys.Setting.ResPopupHeaderBold := ResPopupBoldCheckBox.Checked;
1108
1109         //\83A\83h\83\8c\83X\83o\81[
1110         GikoSys.Setting.URLDisplay := URLDisplayCheckBox.Checked;
1111         GikoSys.Setting.AddressBarTabStop := TabStopAddressBarCheckBox.Checked;
1112         GikoSys.Setting.LinkAddAddressBar := LinkAddCheckBox.Checked;
1113         if GikoSys.IsNumeric(AddressHistoryCountEdit.Text) then
1114                 GikoSys.Setting.AddressHistoryCount := StrToInt(AddressHistoryCountEdit.Text)
1115         else
1116                 GikoSys.Setting.AddressHistoryCount := 100;
1117
1118         //HTML\83v\83\8c\83r\83\85\81[
1119         GikoSys.Setting.PreviewVisible := PreviewVisibleCheckBox.Checked;
1120         if GikoSys.IsNumeric(PreviewWaitEdit.Text) then
1121                 GikoSys.Setting.PreviewWait := StrToInt(PreviewWaitEdit.Text)
1122         else
1123                 GikoSys.Setting.PreviewWait := 500;
1124         case PreviewSizeComboBox.ItemIndex of
1125                 0: GikoSys.Setting.PreviewSize := gpsXSmall;
1126                 1: GikoSys.Setting.PreviewSize := gpsSmall;
1127                 2: GikoSys.Setting.PreviewSize := gpsMedium;
1128                 3: GikoSys.Setting.PreviewSize := gpsLarge;
1129                 4: GikoSys.Setting.PreviewSize := gpsXLarge;
1130         end;
1131
1132         //\83X\83\8c\83b\83h\88ê\97\97\8dX\90V\83A\83C\83R\83\93
1133         GikoSys.Setting.ListIconVisible := ThreadListIconCheckBox.Checked;
1134
1135         GikoSys.Setting.CreationTimeLogs := CreationTimeLogsCheckBox.Checked;
1136         GikoSys.Setting.FutureThread := FutureThreadCheckBox.Checked;
1137         if StrToIntDef(SelectIntervalEdit.Text, 110) > 55 then
1138                 GikoSys.Setting.SelectInterval := StrToIntDef(SelectIntervalEdit.Text, 110)
1139         else
1140                 GikoSys.Setting.SelectInterval := 55;
1141
1142         //dat\97\8e\82¿\83X\83\8c\83\\81[\83g\8f\87
1143         case DatOchiSortCombo.ItemIndex of
1144                 0: GikoSys.Setting.DatOchiSortIndex := -1;      //\95À\82Ñ\91Ö\82¦\82µ\82È\82¢
1145                 1: begin        //\83X\83\8c\94Ô\8d\86(\8f¸\8f\87)
1146                         GikoSys.Setting.DatOchiSortOrder := true;
1147                         GikoSys.Setting.DatOchiSortIndex := Ord( gbcTitle );
1148                    end;
1149                 2: begin        //\83X\83\8c\94Ô\8d\86(\8d~\8f\87)
1150                         GikoSys.Setting.DatOchiSortOrder := false;
1151                         GikoSys.Setting.DatOchiSortIndex := Ord( gbcTitle );
1152                    end;
1153                 3: begin        //\8eæ\93¾\93ú\8e\9e(\8f¸\8f\87)
1154                         GikoSys.Setting.DatOchiSortOrder := true;
1155                         GikoSys.Setting.DatOchiSortIndex := Ord( gbcRoundDate );{gbcLastModified}
1156                    end;
1157                 4: begin        //\8eæ\93¾\93ú\8e\9e(\8d~\8f\87)
1158                         GikoSys.Setting.DatOchiSortOrder := false;
1159                         GikoSys.Setting.DatOchiSortIndex := Ord( gbcRoundDate );{gbcLastModified}
1160                    end;
1161                 5: begin        //\83X\83\8c\8dì\90¬\93ú\8e\9e(\8f¸\8f\87)
1162                         GikoSys.Setting.DatOchiSortOrder := true;
1163                         GikoSys.Setting.DatOchiSortIndex := Ord( gbcCreated );
1164                    end;
1165                 6: begin        //\83X\83\8c\8dì\90¬\93ú\8e\9e(\8d~\8f\87)
1166                         GikoSys.Setting.DatOchiSortOrder := false;
1167                         GikoSys.Setting.DatOchiSortIndex := Ord( gbcCreated );
1168                    end;
1169                 7:      begin  //\83X\83\8c\8dÅ\8fI\8dX\90V\93ú\8e\9e\81i\8f¸\8f\87\81j
1170                         GikoSys.Setting.DatOchiSortOrder := true;
1171                         GikoSys.Setting.DatOchiSortIndex := Ord( gbcLastModified );{gbcLastModified}
1172                         end;
1173                 8:      begin  //\83X\83\8c\8dÅ\8fI\8dX\90V\93ú\8e\9e\81i\8d~\8f\87\81j
1174                         GikoSys.Setting.DatOchiSortOrder := false;
1175                         GikoSys.Setting.DatOchiSortIndex := Ord( gbcLastModified );{gbcLastModified}
1176                         end;
1177         end;
1178         GikoSys.Setting.AutoSortThreadList := AutoSortCheckBox.Checked;
1179
1180         GikoSys.Setting.WriteSystemSettingFile;
1181         GikoSys.Setting.WriteBoardURLSettingFile;
1182 //      GikoForm.SetBrowserTabState;
1183
1184         if LogFolderEdit.Text <> '' then begin
1185                 GikoSys.Setting.NewLogFolder := LogFolderEdit.Text;
1186                 GikoSys.Setting.WriteFolderSettingFile;
1187         end;
1188
1189         for i := 0 to SoundListView.Items.Count - 1 do begin
1190                 if FileExists(SoundListView.Items[i].SubItems[0]) then
1191                         GikoSys.Setting.SoundFileName[i] := SoundListView.Items[i].SubItems[0]
1192                 else
1193                         GikoSys.Setting.SoundFileName[i] := '';
1194         end;
1195
1196         //\82 \82Ú\81`\82ñ
1197         GikoSys.Setting.AbonDeleterlo := RloCheckBox.Checked;
1198         GikoSys.Setting.AbonReplaceul := ReplaceulCheckBox.Checked;
1199         GikoSys.Setting.PopUpAbon := PopUpAbonCheckBox.Checked;
1200         GikoSys.Setting.ShowNGLinesNum := ShowNGLineCheckBox.Checked;
1201         GikoSys.Setting.AddResAnchor := AddResAnchorCheckBox.Checked;
1202         GikoSys.Setting.DeleteSyria := DeleteSyriaCheckBox.Checked;
1203         GikoSys.Setting.IgnoreKana := IgnoreKanaCheckBox.Checked;
1204         GikoSys.FAbon.IgnoreKana := GikoSys.Setting.IgnoreKana;
1205         // \8eg\97p\82·\82é\83X\83p\83\80\83t\83B\83\8b\83^
1206         if GikoSys.Setting.SpamFilterAlgorithm <> TGikoSpamFilterAlgorithm(
1207                 SpamFilterAlgorithmComboBox.ItemIndex ) then begin
1208                 GikoSys.Setting.SpamFilterAlgorithm := TGikoSpamFilterAlgorithm(
1209                         SpamFilterAlgorithmComboBox.ItemIndex );
1210                 FRepaintThread := True;
1211         end;
1212
1213         //Tab\8e©\93®\95Û\91
1214         GikoSys.Setting.TabAutoLoadSave := TabLoadSave.Checked;
1215         GikoSys.Setting.UseUndecided := UseUndecidedCheckBox.Checked;
1216         //Be2ch
1217         GikoSys.Setting.BeUserID := BeUserIDEdit.Text;
1218         GikoSys.Setting.BePassword := BeCodeEdit.Text;
1219                 GikoSys.Setting.BeAutoLogin := BeAutoLoginCheckBox.Checked;
1220         //\97\9a\97ð\82Ì\8dÅ\91å\95Û\91\90\94
1221         GikoSys.Setting.MaxRecordCount := Max(StrToInt64Def(MaxRecordCountEdit.Text,100),1);
1222     GikoSys.Setting.StoredTaskTray := StoredTaskTrayCB.Checked;
1223     GikoSys.Setting.LoopBrowserTabs := LoopBrowserTabsCB.Checked;
1224
1225     GikoSys.Setting.GestureIgnoreContext := IgnoreContextCheckBox.Checked;
1226
1227     // \83\8c\83X\83G\83f\83B\83^Unicode\93ü\97Í
1228     Gikosys.Setting.UseUnicode := UseUnicodeCB.Checked;
1229     // \83X\83\8c\83^\83C\93Á\92è\95\8e\9a\97ñ\8f\9c\8b\8e
1230     GikoSys.Setting.ThreadTitleTrim := ThreadTitleTrimCheckBox.Checked;
1231
1232 end;
1233
1234 procedure TOptionDialog.SettingApply;
1235 var
1236         i: Integer;
1237 begin
1238         GikoForm.TreeView.Items.BeginUpdate;
1239         GikoForm.FavoriteTreeView.Items.BeginUpdate;
1240         GikoForm.ListView.Items.BeginUpdate;
1241         try
1242                 GikoForm.TreeView.Font.Name := GikoSys.Setting.CabinetFontName;
1243                 GikoForm.TreeView.Font.Size := GikoSys.Setting.CabinetFontSize;
1244                 GikoForm.TreeView.Font.Color := GikoSys.Setting.CabinetFontColor;
1245                 GikoForm.TreeView.Color := GikoSys.Setting.CabinetBackColor;
1246
1247                 GikoForm.FavoriteTreeView.Font.Assign(GikoForm.TreeView.Font);
1248                 GikoForm.FavoriteTreeView.Color := GikoSys.Setting.CabinetBackColor;
1249
1250                 GikoForm.ListView.Font.Name := GikoSys.Setting.ListFontName;
1251                 GikoForm.ListView.Font.Size := GikoSys.Setting.ListFontSize;
1252                 GikoForm.ListView.Font.Color := GikoSys.Setting.ListFontColor;
1253                 GikoForm.ListView.Font.Style := [];
1254                 if GikoSys.Setting.ListFontBold then
1255                         GikoForm.ListView.Font.Style := [fsbold];
1256                 if GikoSys.Setting.ListFontItalic then
1257                         GikoForm.ListView.Font.Style := GikoForm.ListView.Font.Style + [fsitalic];
1258
1259                 //GikoForm.ListView.Color := GikoSys.Setting.ListBackColor;
1260                 GikoForm.ListViewBackGroundColor := GikoSys.Setting.ListBackColor;
1261                 GikoForm.UseOddResOddColor := GikoSys.Setting.UseOddColorOddResNum;
1262                 GikoForm.OddColor := GikoSys.Setting.OddColor;
1263                 GikoSys.Setting.UnFocusedBold := (UnFocusedBoldCheckBox.Enabled) and
1264                                                                                         (UnFocusedBoldCheckBox.Checked);
1265
1266                 GikoForm.BrowserTab.Font.Name := GikoSys.Setting.BrowserTabFontName;
1267                 GikoForm.BrowserTab.Font.Size := GikoSys.Setting.BrowserTabFontSize;
1268                 GikoForm.BrowserTab.Font.Style := [];
1269                 if GikoSys.Setting.BrowserTabFontBold then
1270                         GikoForm.BrowserTab.Font.Style := [fsBold];
1271                 if GikoSys.Setting.BrowserTabFontItalic then
1272                         GikoForm.BrowserTab.Font.Style := GikoForm.BrowserTab.Font.Style + [fsItalic];
1273 //              GikoForm.BrowserTab.Height := (GikoSys.Setting.BrowserTabFontSize * 2) + 1;
1274 //              GikoForm.BrowserBottomPanel.Height := GikoForm.BrowserTab.Height;
1275
1276                 for i := 0 to Screen.CustomFormCount - 1 do begin
1277                         if TObject(Screen.CustomForms[i]) is TEditorForm then begin
1278                                 TEditorForm(Screen.CustomForms[i]).SetFont;
1279                         end;
1280                 end;
1281
1282         finally
1283                 GikoForm.TreeView.Items.EndUpdate;
1284                 GikoForm.FavoriteTreeView.Items.EndUpdate;
1285                 GikoForm.ListView.Items.EndUpdate;
1286         end;
1287
1288         //\83A\83h\83\8c\83X\83o\81[
1289         for i := GikoForm.AddressComboBox.Items.Count - 1 downto 0 do begin
1290                 if GikoSys.Setting.AddressHistoryCount >= GikoForm.AddressComboBox.Items.Count then
1291                         Break;
1292                 GikoForm.AddressComboBox.Items.Delete(i);
1293         end;
1294         GikoForm.AddressComboBox.TabStop := GikoSys.Setting.AddressBarTabStop;
1295
1296         //\83X\83\8c\88ê\97\97\82Ì\83\8a\83t\83\8c\83b\83V\83\85
1297         if FRepaintList then begin
1298                 // SetActiveList\82ð\8eÀ\8ds
1299                 GikoForm.ActiveList := GikoForm.ActiveList;
1300         end;
1301
1302         // \83X\83\8c\83b\83h\82Ì\83\8a\83t\83\8c\83b\83V\83\85
1303         if FRepaintThread then begin
1304                 for i := GikoForm.BrowserTab.Tabs.Count - 1 downto 0 do begin
1305                         TBrowserRecord(GikoForm.BrowserTab.Tabs.Objects[i]).Repaint := true;
1306                 end;
1307                 GikoForm.BrowserTab.OnChange(nil);
1308         end;
1309
1310     // \83^\83u\82Ì\83X\83\8c\83^\83C\8dX\90V
1311     GikoForm.UpdateThreadTitle;
1312 end;
1313
1314 procedure TOptionDialog.ReadProxyCheckClick(Sender: TObject);
1315 begin
1316         ReadProxyAddressEdit.Enabled := ReadProxyCheck.Checked;
1317         ReadPortEdit.Enabled := ReadProxyCheck.Checked;
1318         ReadProxyUserIDEdit.Enabled := ReadProxyCheck.Checked;
1319         ReadProxyPasswordEdit.Enabled := ReadProxyCheck.Checked;
1320
1321         ReadAddressLabel.Enabled := ReadProxyCheck.Checked;
1322         ReadPortLabel.Enabled := ReadProxyCheck.Checked;
1323         ReadUserIDLabel.Enabled := ReadProxyCheck.Checked;
1324         ReadPasswordLabel.Enabled := ReadProxyCheck.Checked;
1325 end;
1326
1327 procedure TOptionDialog.ReadPortEditExit(Sender: TObject);
1328 begin
1329         if not GikoSys.IsNumeric(ReadPortEdit.Text) then
1330                 ReadPortEdit.Text := '0';
1331 end;
1332
1333 procedure TOptionDialog.LogFolderButtonClick(Sender: TObject);
1334 var
1335         Root: WideString;
1336         Dir: string;
1337 begin
1338         Root := '';
1339         if SelectDirectory('\83\8d\83O\83t\83H\83\8b\83_\91I\91ð', Root, Dir) then begin
1340                 LogFolderEdit.Text := Dir;
1341         end;
1342 end;
1343
1344 function TOptionDialog.CheckFolder: Boolean;
1345 begin
1346         if Trim(LogFolderEdit.Text) = '' then
1347                 LogFolderEdit.Text := GikoSys.GetAppDir + 'Log';
1348
1349         if DirectoryExists(LogFolderEdit.Text) then begin
1350                 Result := True;
1351         end else begin
1352                 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
1353                         //\83t\83H\83\8b\83_\82ð\8dì\90¬
1354                         try
1355                                 GikoSys.ForceDirectoriesEx(LogFolderEdit.Text);
1356                                 Result := True
1357                         except
1358                                 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);
1359                                 OptionTab.ActivePage := FolderSheet;
1360                                 LogFolderEdit.SetFocus;
1361                                 Result := False;
1362                         end;
1363                 end else
1364                         Result := False;
1365         end;
1366 end;
1367
1368 procedure TOptionDialog.FormClose(Sender: TObject; var Action: TCloseAction);
1369 begin
1370         if not FClose then
1371                 Action := caNone;
1372         FClose := True;
1373 end;
1374
1375 procedure TOptionDialog.SoundReferButtonClick(Sender: TObject);
1376 begin
1377         OpenDialog.Filter := '\83T\83E\83\93\83h (*.wav)|*.wav|\82·\82×\82Ä\82Ì\83t\83@\83C\83\8b (*.*)|*.*';
1378         sndPlaySound(nil, SND_ASYNC);
1379         if OpenDialog.Execute then begin
1380                 SoundFileEdit.Text := OpenDialog.FileName;
1381         // \83A\83v\83\8a\94z\89º\82Ì\83t\83@\83C\83\8b\82Ì\8fê\8d\87\91\8a\91Î\83p\83X\82É\95Ï\8a·\82·\82é\81B
1382         if (AnsiPos(GikoSys.Setting.GetAppDir,SoundFileEdit.Text) = 1) then begin
1383             // .\ \82ª\82Â\82©\82È\82¢\82Ì\82Å\81A.\\82ð\92Ç\89Á
1384             SoundFileEdit.Text := '.\' + ExtractRelativePath(
1385                                       GikoSys.Setting.GetAppDir,
1386                                       SoundFileEdit.Text);
1387
1388         end;
1389         end;
1390 end;
1391
1392 procedure TOptionDialog.SoundPlayButtonClick(Sender: TObject);
1393 var
1394     s : String;
1395 begin
1396     SetCurrentDir(GikoSys.Setting.GetAppDir);
1397     s := ExpandFileName(SoundFileEdit.Text);
1398         if not FileExists(s) then begin
1399                 MsgBox(Handle, '\91\8dÝ\82µ\82È\82¢\83t\83@\83C\83\8b\82Å\82·', '\83G\83\89\81[', MB_ICONSTOP or MB_OK);
1400                 SoundFileEdit.Text := '';
1401                 Exit;
1402         end;
1403         if not sndPlaySound(PChar(s), SND_ASYNC or SND_NOSTOP) then begin
1404                 sndPlaySound(nil, SND_ASYNC);
1405         end;
1406 end;
1407
1408 procedure TOptionDialog.SoundListViewChanging(Sender: TObject;
1409         Item: TListItem; Change: TItemChange; var AllowChange: Boolean);
1410 begin
1411         if Item.SubItems.Count > 0 then
1412                 SoundFileEdit.Text := Item.SubItems[0];
1413 end;
1414
1415 procedure TOptionDialog.SoundFileEditChange(Sender: TObject);
1416 var
1417         Item: TListItem;
1418 begin
1419         sndPlaySound(nil, SND_ASYNC);
1420         Item := SoundListView.Selected;
1421         if Item = nil then Exit;
1422
1423     SetCurrentDir(GikoSys.Setting.GetAppDir);
1424         if FileExists(ExpandFileName(SoundFileEdit.Text)) then
1425                 Item.SubItems[0] := SoundFileEdit.Text;
1426         if Trim(SoundFileEdit.Text) = '' then
1427                 Item.SubItems[0] := '';
1428 end;
1429
1430 procedure TOptionDialog.OptionTabChange(Sender: TObject);
1431 begin
1432         sndPlaySound(nil, SND_ASYNC);
1433
1434         if OptionTab.ActivePage = CSSTabSheet then
1435                 CSSPreview;
1436 end;
1437
1438 procedure TOptionDialog.AppFolderButtonClick(Sender: TObject);
1439 begin
1440         OpenDialog.Filter := '\8eÀ\8ds\83t\83@\83C\83\8b (*.exe)|*.exe|\82·\82×\82Ä\82Ì\83t\83@\83C\83\8b (*.*)|*.*';
1441         if OpenDialog.Execute then
1442                 AppFolderEdit.Text := OpenDialog.FileName;
1443 end;
1444
1445 procedure TOptionDialog.WriteProxyCheckClick(Sender: TObject);
1446 begin
1447         WriteProxyAddressEdit.Enabled := WriteProxyCheck.Checked;
1448         WritePortEdit.Enabled := WriteProxyCheck.Checked;
1449         WriteProxyUserIDEdit.Enabled := WriteProxyCheck.Checked;
1450         WriteProxyPasswordEdit.Enabled := WriteProxyCheck.Checked;
1451
1452         WriteAddressLabel.Enabled := WriteProxyCheck.Checked;
1453         WritePortLabel.Enabled := WriteProxyCheck.Checked;
1454         WriteUserIDLabel.Enabled := WriteProxyCheck.Checked;
1455         WritePasswordLabel.Enabled := WriteProxyCheck.Checked;
1456 end;
1457
1458 procedure TOptionDialog.WritePortEditExit(Sender: TObject);
1459 begin
1460         if not GikoSys.IsNumeric(WritePortEdit.Text) then
1461                 WritePortEdit.Text := '0';
1462 end;
1463
1464 procedure TOptionDialog.Tora3URLLabelClick(Sender: TObject);
1465 begin
1466         GikoSys.OpenBrowser(URL_TORA3, gbtAuto);
1467 end;
1468
1469 procedure TOptionDialog.HotKeyEnter(Sender: TObject);
1470 begin
1471         OkBotton.Default := False;
1472         CancelBotton.Cancel := False;
1473 end;
1474
1475 procedure TOptionDialog.HotKeyExit(Sender: TObject);
1476 begin
1477         OkBotton.Default := True;
1478         CancelBotton.Cancel := True;
1479 end;
1480
1481 procedure TOptionDialog.URLAppCheckBoxClick(Sender: TObject);
1482 begin
1483         AppFolderLabel.Enabled := URLAppCheckBox.Checked;
1484         AppFolderEdit.Enabled := URLAppCheckBox.Checked;
1485         AppFolderButton.Enabled := URLAppCheckBox.Checked;
1486 end;
1487
1488 procedure TOptionDialog.AddressHistoryCountEditExit(Sender: TObject);
1489 begin
1490         if not GikoSys.IsNumeric(AddressHistoryCountEdit.Text) then
1491                 AddressHistoryCountEdit.Text := '100';
1492 end;
1493
1494 procedure TOptionDialog.PreviewWaitEditExit(Sender: TObject);
1495 begin
1496         if not GikoSys.IsNumeric(PreviewWaitEdit.Text) then
1497                 PreviewWaitEdit.Text := '500';
1498         if StrToInt(PreviewWaitEdit.Text) < 500 then
1499                 PreviewWaitEdit.Text := '500';
1500         if StrToInt(PreviewWaitEdit.Text) > 9999 then
1501                 PreviewWaitEdit.Text := '9999';
1502 end;
1503
1504 procedure TOptionDialog.CSSCheckBoxClick(Sender: TObject);
1505 begin
1506         CSSListLabel.Enabled := CSSCheckBox.Checked;
1507         CSSListView.Enabled := CSSCheckBox.Checked;
1508 end;
1509
1510 procedure TOptionDialog.SetAbonpropertys;
1511 begin
1512         //\82 \82Ú\81`\82ñ
1513         GikoSys.FAbon.Deleterlo := RloCheckBox.Checked;
1514         GikoSys.FAbon.Replaceul := ReplaceulCheckBox.Checked;
1515         GikoSys.FAbon.AbonPopupRes := PopUpAbonCheckBox.Checked;
1516         GikoSys.FAbon.ReturnNGwordLineNum := ShowNGLineCheckBox.Checked;
1517         GikoSys.FAbon.SetNGResAnchor := AddResAnchorCheckBox.Checked;
1518                 GikoSys.FAbon.DeleteSyria := DeleteSyriaCheckBox.Checked;
1519 end;
1520 procedure TOptionDialog.CSSFontButtonClick(Sender: TObject);
1521 begin
1522
1523         FontDialog.Options := [fdAnsiOnly, fdEffects];
1524         FontDialog.Font.Assign(FCSSFont);
1525         if FontDialog.Execute then begin
1526                 FontDialog.Font.Style := FontDialog.Font.Style - [fsUnderline] - [fsStrikeout];
1527                 FCSSFont.Assign(FontDialog.Font);
1528                 //FCSSFont := FontDialog.Font;
1529         end;
1530
1531         CSSPreview;
1532
1533 end;
1534
1535 procedure TOptionDialog.CSSBackColorButtonClick(Sender: TObject);
1536 begin
1537
1538         ColorDialog.Color := FCSSBackColor;
1539         if ColorDialog.Execute then begin
1540                 FCSSBackColor := ColorDialog.Color;
1541         end;
1542
1543         CSSPreview;
1544
1545 end;
1546
1547 procedure TOptionDialog.CSSFontCheckBoxClick(Sender: TObject);
1548 begin
1549
1550         CSSFontButton.Enabled := CSSFontCheckBox.Checked;
1551         CSSPreview;
1552
1553 end;
1554
1555 procedure TOptionDialog.CSSBackColorCheckBoxClick(Sender: TObject);
1556 begin
1557
1558         CSSBackColorButton.Enabled := CSSBackColorCheckBox.Checked;
1559         CSSPreview;
1560
1561 end;
1562
1563 procedure TOptionDialog.CSSSetContent(Content: string);
1564 var
1565         doc : OleVariant;
1566 begin
1567         if CSSBrowser.Document <> nil then begin
1568                 doc := CSSBrowser.OleObject.Document;
1569                 doc.open;
1570         doc.Clear;
1571                 doc.charset := 'Shift_JIS';
1572                 doc.Write(Content);
1573                 doc.Close;
1574   end;
1575 end;
1576
1577 procedure TOptionDialog.CSSPreview;
1578 var
1579         Board: TBoard;
1580         ThreadItem: TThreadItem;
1581         html: string;
1582         Res: array [0..1] of TResRec;
1583         fileName: string;
1584 begin
1585
1586         fileName := GikoSys.Setting.CSSFileName;
1587
1588         GikoSys.Setting.CSSFileName := DEFAULT_CSS_FILENAME;
1589         if CSSListView.Items.Count > 0 then begin
1590                 try
1591                         if CSSListView.ItemIndex >= 0 then begin
1592                                 if CSSListView.Items[CSSListView.ItemIndex].Data <> nil then
1593                                         GikoSys.Setting.CSSFileName := string( CSSListView.Items[CSSListView.ItemIndex].data )
1594                                 else
1595                                         GikoSys.Setting.CSSFileName := CSSListView.Items[CSSListView.ItemIndex].Caption + '.css';
1596                                                 end;
1597                 except
1598                 end;
1599         end;
1600
1601         Board := TBoard.Create( nil, 'about://sample/' );
1602         ThreadItem := TThreadItem.Create( nil, Board, 'about://sample/test/read.cgi/sample/' );
1603
1604         try
1605                 Board.Title := '\83T\83\93\83v\83\8b\94Â';
1606                 ThreadItem.ParentBoard := Board;
1607                 ThreadItem.AllResCount := High( Res );
1608                 ThreadItem.NewResCount := 1;
1609                 ThreadItem.NewReceive := 2;
1610                 ThreadItem.Title := '\83T\83\93\83v\83\8b\83v\83\8c\83r\83\85\81[';
1611
1612                 Res[0].FName := '\96¼\96³\82µ\82³\82ñ';
1613                 Res[0].FMailTo := 'sage';
1614                 Res[0].FDateTime := 'ID:Sample';
1615                 Res[0].FBody := 'CSS \82Æ\83X\83L\83\93\82Ì\83T\83\93\83v\83\8b';
1616                 Res[1].FName := '\96¼\96³\82µ\82³\82ñ';
1617                 Res[1].FMailTo := 'age';
1618                 Res[1].FDateTime := 'ID:Sample';
1619                 Res[1].FBody := '\83I\83}\83G\83\82\83i\81[';
1620
1621
1622                 if FileExists( GikoSys.GetSkinHeaderFileName ) then begin
1623                         html :=
1624                                 HTMLCreater.LoadFromSkin( GikoSys.GetSkinHeaderFileName, ThreadItem, 0 ) +
1625                                 '<a name="top"></a>' +
1626                                 HTMLCreater.SkinedRes( HTMLCreater.LoadFromSkin( GikoSys.GetSkinResFileName, ThreadItem, 0 ), @Res[0], '1' ) +
1627                                 HTMLCreater.SkinedRes( HTMLCreater.LoadFromSkin( GikoSys.GetSkinNewResFileName, ThreadItem, 0 ), @Res[1], '2' ) +
1628                                 '<a name="bottom"></a>' +
1629                                 HTMLCreater.LoadFromSkin( GikoSys.GetSkinFooterFileName, ThreadItem, 0 );
1630
1631                         html := StringReplace( html, '</head>',
1632                                 '<style type="text/css">body {' + GetPreviewUserStyle + '}</style></head>', [rfReplaceAll] );
1633                 end else begin
1634                         html :=
1635                                 '<html><head><meta http-equiv="Content-type" content="text/html; charset=Shift_JIS">' +
1636                                 '<title>' + ThreadItem.Title + '</title>' +
1637                                 '<link rel="stylesheet" href="' + GikoSys.GetStyleSheetDir + GikoSys.Setting.CSSFileName + '" type="text/css">' +
1638                                 '<style type="text/css">body {' + GetPreviewUserStyle + '}</style>' +
1639                                 '</head><body><div class="title">' + ThreadItem.Title + '</div>';
1640
1641                         html := html + CreatePreviewBody(Res) + '</body></html>';
1642                 end;
1643
1644                 try
1645                         CSSSetContent( html );
1646                 except
1647                 end;
1648
1649         finally
1650                 ThreadItem.Free;
1651                 Board.Free;
1652                 GikoSys.Setting.CSSFileName := fileName;
1653         end;
1654
1655 end;
1656 function TOptionDialog.CreatePreviewBody(Res: array of TResRec): string;
1657 var
1658         i : Integer;
1659 begin
1660         Result := '';
1661         for i := 0 to High( Res ) do
1662         begin
1663                 Result := Result +
1664                         '<div class="header"><span class="no">' + IntToStr( i + 1 ) + '</span>' +
1665                         '<span class="name_label"> \96¼\91O\81F </span>' +
1666                         '<a class="name_mail" href="mailto:' + Res[i].FMailTo + '">' +
1667                         '<b>' + Res[i].FName + '</b></a><span class="mail"> [' + Res[i].FMailTo + ']</span>' +
1668                         '<span class="date_label"> \93\8a\8de\93ú\81F</span>' +
1669                         '<span class="date"> ' + Res[i].FDateTime+ '</span></div>' +
1670                         '<div class="mes">' + Res[i].FBody + ' </div>';
1671         end;
1672 end;
1673
1674 function TOptionDialog.GetPreviewUserStyle(): string;
1675 var
1676         i : Integer;
1677
1678 begin
1679         Result := '';
1680         // \83t\83H\83\93\83g\82â\83T\83C\83Y\82Ì\90Ý\92è
1681         if CSSFontCheckBox.Checked then begin
1682                 i := ColorToRGB( FCSSFont.Color );
1683                 i := (i shr 16) or (i and $ff00) or ((i and $ff) shl 16);
1684
1685                 Result := Result +
1686                         'font-family:"' + FCSSFont.Name + '";' +
1687                         'font-size:' + IntToStr( FCSSFont.Size ) + 'pt;' +
1688                         'color:#' + IntToHex( i, 6 ) + ';';
1689                 if fsBold in FCSSFont.Style then
1690                         Result := Result + 'font-weight:bold;'
1691                 else
1692                         Result := Result + 'font-weight:normal;';
1693                 if fsItalic in FCSSFont.Style then
1694                         Result := Result + 'font-style:italic;'
1695                 else
1696                         Result := Result + 'font-style:normal;';
1697         end;
1698         if CSSBackColorCheckBox.Checked then begin
1699                 i := ColorToRGB( FCSSBackColor );
1700                 i := (i shr 16) or (i and $ff00) or ((i and $ff) shl 16);
1701
1702                 Result := Result +
1703                         'background-color:#' + IntToHex( i, 6 ) + ';';
1704         end;
1705
1706 end;
1707 procedure TOptionDialog.CSSListViewChange(Sender: TObject; Item: TListItem;
1708         Change: TItemChange);
1709 begin
1710
1711         if OptionTab.ActivePage = CSSTabSheet then
1712                 CSSPreview;
1713
1714 end;
1715
1716 procedure TOptionDialog.AddURLButtonClick(Sender: TObject);
1717 begin
1718         BoardURLComboBox.Items.Append(BoardURLComboBox.Text);
1719   BoardURLComboBox.ItemIndex := BoardURLComboBox.Items.Count - 1;
1720 end;
1721
1722 procedure TOptionDialog.RemoveURLButtonClick(Sender: TObject);
1723 begin
1724         BoardURLComboBox.DeleteSelected;
1725 end;
1726
1727 procedure TOptionDialog.OddResNumCheckBoxClick(Sender: TObject);
1728 begin
1729         OddResNumColorBox.Enabled := OddResNumCheckBox.Checked;
1730         UnFocusedBoldCheckBox.Enabled := OddResNumCheckBox.Checked;
1731 end;
1732
1733 procedure TOptionDialog.ResRangeHoldCheckBoxClick(Sender: TObject);
1734 begin
1735         ResRangeHoldComboBox.Enabled := ResRangeHoldCheckBox.Checked;
1736 end;
1737
1738 procedure TOptionDialog.CroutOptionClick(Sender: TObject);
1739 var
1740         KuroutOption: TKuroutOption;
1741 begin
1742         KuroutOption := TKuroutOption.Create(Self);
1743         try
1744                 KuroutOption.ShowModal;
1745         finally
1746                 KuroutOption.Release;
1747         end;
1748 end;
1749
1750 procedure TOptionDialog.MaxRecordCountEditExit(Sender: TObject);
1751 begin
1752         if not GikoSys.IsNumeric(MaxRecordCountEdit.Text) then
1753                 MaxRecordCountEdit.Text := '100'
1754         else if StrToIntDef(MaxRecordCountEdit.Text, 100) <= 0 then
1755         MaxRecordCountEdit.Text := '1';
1756 end;
1757
1758 procedure TOptionDialog.BoukenDelButtonClick(Sender: TObject);
1759 begin
1760     if ( BoukenComboBox.Items.IndexOf( BoukenComboBox.Text ) <> -1 ) then begin
1761         if MsgBox(Self.Handle, BoukenComboBox.Text + ' \82ð\8dí\8f\9c\82µ\82Ü\82·\81B'#13#10 +
1762             '\8dí\8f\9c\82·\82é\82Æ\95\9c\8c³\82Å\82«\82Ü\82¹\82ñ\81B\82æ\82ë\82µ\82¢\82Å\82·\82©\81H', '\94E\96@\92\9f\81@\83h\83\81\83C\83\93\8dí\8f\9c', MB_YESNO or MB_ICONQUESTION) = IDYES  then begin
1763             GikoSys.DelBoukenCookie(BoukenComboBox.Text);
1764             GikoSys.Setting.WriteBoukenSettingFile;
1765             BoukenComboBox.Items.Delete(BoukenComboBox.ItemIndex);
1766             if ( BoukenComboBox.Items.Count = 0 ) then begin
1767                  BoukenComboBox.Text := '';
1768             end;
1769             BoukenComboBox.OnChange(nil);
1770         end
1771     end else begin
1772         BoukenComboBox.Text := '';
1773     end;
1774 end;
1775
1776 procedure TOptionDialog.BoukenComboBoxChange(Sender: TObject);
1777 begin
1778     BoukenEdit.Text := GikoSys.GetBoukenCookie('http://*' +BoukenComboBox.Text);
1779 end;
1780
1781 procedure TOptionDialog.BoukenModButtonClick(Sender: TObject);
1782 var
1783     DomainList : TStringList;
1784     i : Integer;
1785     s : String;
1786 begin
1787     if ( Length(BoukenComboBox.Text) > 0 ) then begin
1788         s := BoukenComboBox.Text;
1789         GikoSys.SetBoukenCookie(BoukenEdit.Text, s);
1790         GikoSys.Setting.WriteBoukenSettingFile;
1791         // \96`\8c¯\82Ì\8f\91\83h\83\81\83C\83\93\88ê\97\97\8eæ\93¾
1792         BoukenComboBox.Text := '';
1793         BoukenComboBox.Items.Clear;
1794         DomainList := TStringList.Create;
1795         GikoSys.GetBoukenDomain(DomainList);
1796         for i := 0 to DomainList.Count - 1 do begin
1797             BoukenComboBox.Items.Add( DomainList[i] ) ;
1798         end;
1799         DomainList.Free;
1800         BoukenComboBox.ItemIndex := 0;
1801         for i := 0 to BoukenComboBox.Items.Count - 1 do begin
1802             if ( BoukenComboBox.Items[i] = s) then begin
1803                 BoukenComboBox.ItemIndex := i;
1804                 Break;
1805             end;
1806         end;
1807         BoukenComboBox.OnChange(nil);
1808     end;
1809 end;
1810
1811 end.
1812