OSDN Git Service

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