OSDN Git Service

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