Develop and Download Open Source Software

Browse CVS Repository

Annotation of /gikonavigoeson/gikonavi/Option.pas

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.60 - (hide annotations) (download) (as text)
Tue Aug 17 06:56:18 2004 UTC (19 years, 8 months ago) by h677
Branch: MAIN
CVS Tags: b48, v1_49_0_540, v1_48_0_535, v1_48_0_539, v1_48_0_538, v1_48_0_533, v1_48_0_537, v1_48_0_536, v1_49_0_541
Changes since 1.59: +5 -12 lines
File MIME type: text/x-pascal
タブの自動保存の設定が保存されない不具合の修正

1 hi_ 1.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 yoffy 1.8 GikoSystem, GikoUtil, Buttons, UrlMon, Menus, ImgList, OleCtrls,
9 h677 1.59 {$IF Defined(DELPRO) }
10     SHDocVw,
11     MSHTML,
12     {$ELSE}
13     SHDocVw_TLB,
14     MSHTML_TLB,
15     {$IFEND}
16     BoardGroup;
17 hi_ 1.1
18     type
19     TOptionDialog = class(TForm)
20     CancelBotton: TButton;
21 yoffy 1.22 ApplyButton: TButton;
22 hi_ 1.1 FontDialog: TFontDialog;
23     ColorDialog: TColorDialog;
24 yoffy 1.22 OpenDialog: TOpenDialog;
25 genyakun 1.57 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 h677 1.23 OddResNumCheckBox: TCheckBox;
79     OddResNumColorBox: TColorBox;
80 genyakun 1.57 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     NonAcquiredCountCheckBox: TCheckBox;
94 h677 1.28 GroupBox16: TGroupBox;
95     CreationTimeLogsCheckBox: TCheckBox;
96     FutureThreadCheckBox: TCheckBox;
97 yoffy 1.35 GroupBox5: TGroupBox;
98 yoffy 1.36 BrowserMaxLabel: TLabel;
99 yoffy 1.35 BrowserMaxCombo: TComboBox;
100 h677 1.41 GroupBox17: TGroupBox;
101     SelectIntervalLabel: TLabel;
102     Label4: TLabel;
103     Label6: TLabel;
104 genyakun 1.57 SelectIntervalEdit: TEdit;
105     GroupBox18: TGroupBox;
106     DatOchiSortCombo: TComboBox;
107     ThreadSheet: TTabSheet;
108     GroupBox1: TGroupBox;
109     ShowMailCheckBox: TCheckBox;
110     ResRangeHoldCheckBox: TCheckBox;
111     ResRangeHoldComboBox: TComboBox;
112     GroupBox2: TGroupBox;
113     AppFolderLabel: TLabel;
114     URLAppCheckBox: TCheckBox;
115     AppFolderEdit: TEdit;
116     AppFolderButton: TButton;
117     OpenMailerCheckBox: TCheckBox;
118     GroupBox6: TGroupBox;
119     LogDeleteMessageCheckBox: TCheckBox;
120     ResAnchorGroupBox: TGroupBox;
121     ResAnchorCheckBox: TCheckBox;
122     TabSheet1: TTabSheet;
123     PopupPositionRadioGroup: TRadioGroup;
124 h677 1.60 TabAddRadioGroup: TRadioGroup;
125 genyakun 1.57 GroupBox8: TGroupBox;
126     Label14: TLabel;
127     Label15: TLabel;
128     Label16: TLabel;
129     PreviewVisibleCheckBox: TCheckBox;
130     PreviewSizeComboBox: TComboBox;
131     PreviewWaitEdit: TEdit;
132     GroupBox10: TGroupBox;
133     UnActivePopupCheckBox: TCheckBox;
134     ResPopupBoldCheckBox: TCheckBox;
135     TabSheet2: TTabSheet;
136     GroupBox7: TGroupBox;
137     Label3: TLabel;
138     Label11: TLabel;
139     URLDisplayCheckBox: TCheckBox;
140     AddressHistoryCountEdit: TEdit;
141     TabStopAddressBarCheckBox: TCheckBox;
142     LinkAddCheckBox: TCheckBox;
143     GroupBox15: TGroupBox;
144     ShowDialogForEndCheckBox: TCheckBox;
145     AllTabCloseCheckBox: TCheckBox;
146     SambaGroupBox: TGroupBox;
147     UseSambaCheckBox: TCheckBox;
148 genyakun 1.46 TabAutoSaveLoad: TGroupBox;
149 genyakun 1.55 TabLoadSave: TCheckBox;
150 genyakun 1.57 SoundSheet: TTabSheet;
151     SoundEventGroupBox: TGroupBox;
152     SoundListView: TListView;
153     SoundReferButton: TButton;
154     SoundFileEdit: TEdit;
155     SoundPlayButton: TBitBtn;
156     FolderSheet: TTabSheet;
157     FolderGroupBox: TGroupBox;
158     Label1: TLabel;
159     Label2: TLabel;
160     Label5: TLabel;
161     LogFolderEdit: TEdit;
162     LogFolderButton: TButton;
163     NGwordSheet: TTabSheet;
164     GroupBox14: TGroupBox;
165     RloCheckBox: TCheckBox;
166     ReplaceulCheckBox: TCheckBox;
167     PopUpAbonCheckBox: TCheckBox;
168     ShowNGLineCheckBox: TCheckBox;
169     AddResAnchorCheckBox: TCheckBox;
170     DeleteSyriaCheckBox: TCheckBox;
171     UserIDSheet: TTabSheet;
172     Tora3URLLabel: TLabel;
173     Label12: TLabel;
174     GroupBox3: TGroupBox;
175     Label9: TLabel;
176     Label10: TLabel;
177     ForcedLoginLabel: TLabel;
178     UserIDEdit: TEdit;
179     PasswordEdit: TEdit;
180     AutoLoginCheckBox: TCheckBox;
181     ForcedLoginCheckBox: TCheckBox;
182     GroupBox4: TGroupBox;
183     Label13: TLabel;
184     BoardURLComboBox: TComboBox;
185     AddURLButton: TButton;
186     RemoveURLButton: TButton;
187     OkBotton: TButton;
188 hi_ 1.1 procedure FormCreate(Sender: TObject);
189     procedure FormDestroy(Sender: TObject);
190     procedure ApplyButtonClick(Sender: TObject);
191     procedure CabinetFontBottonClick(Sender: TObject);
192     procedure CabinetColorBottonClick(Sender: TObject);
193     procedure EditorFontBottonClick(Sender: TObject);
194     procedure OkBottonClick(Sender: TObject);
195     procedure ReadProxyCheckClick(Sender: TObject);
196     procedure ListFontBottonClick(Sender: TObject);
197     procedure ListColorBottonClick(Sender: TObject);
198     procedure EditorColorBottonClick(Sender: TObject);
199     procedure CabinetDefaultButtonClick(Sender: TObject);
200     procedure ReadPortEditExit(Sender: TObject);
201     procedure ListDefaultBottonClick(Sender: TObject);
202     procedure EditorDefaultBottonClick(Sender: TObject);
203     procedure HintFontButtonClick(Sender: TObject);
204     procedure HintBackButtonClick(Sender: TObject);
205     procedure HintDefaultButtonClick(Sender: TObject);
206     procedure LogFolderButtonClick(Sender: TObject);
207     procedure FormClose(Sender: TObject; var Action: TCloseAction);
208     procedure SoundReferButtonClick(Sender: TObject);
209     procedure SoundPlayButtonClick(Sender: TObject);
210     procedure SoundListViewChanging(Sender: TObject; Item: TListItem;
211 yoffy 1.22 Change: TItemChange; var AllowChange: Boolean);
212 hi_ 1.1 procedure SoundFileEditChange(Sender: TObject);
213     procedure OptionTabChange(Sender: TObject);
214     procedure AppFolderButtonClick(Sender: TObject);
215     procedure WriteProxyCheckClick(Sender: TObject);
216     procedure WritePortEditExit(Sender: TObject);
217     procedure Tora3URLLabelClick(Sender: TObject);
218     procedure HotKeyEnter(Sender: TObject);
219     procedure HotKeyExit(Sender: TObject);
220     procedure URLAppCheckBoxClick(Sender: TObject);
221     procedure BruwserTabFontButtonClick(Sender: TObject);
222     procedure BrowserTabDefaultButtonClick(Sender: TObject);
223 yoffy 1.22 procedure AddressHistoryCountEditExit(Sender: TObject);
224     procedure PreviewWaitEditExit(Sender: TObject);
225 genyakun 1.57 procedure CSSCheckBoxClick(Sender: TObject); procedure CSSFontButtonClick(Sender: TObject);
226 yoffy 1.22 procedure CSSBackColorButtonClick(Sender: TObject);
227     procedure CSSFontCheckBoxClick(Sender: TObject);
228     procedure CSSBackColorCheckBoxClick(Sender: TObject);
229     procedure CSSListViewChange(Sender: TObject; Item: TListItem;
230     Change: TItemChange);
231     procedure AddURLButtonClick(Sender: TObject);
232     procedure RemoveURLButtonClick(Sender: TObject);
233 h677 1.23 procedure OddResNumCheckBoxClick(Sender: TObject);
234 yoffy 1.49 procedure ResRangeHoldCheckBoxClick(Sender: TObject);
235 genyakun 1.58 procedure CroutOptionClick(Sender: TObject);
236 hi_ 1.1 private
237     { Private 鐃緒申鐃緒申 }
238     FClose: Boolean;
239 q9_ 1.54 FRepaintList: Boolean;
240 h677 1.32 FRepaintThread: Boolean;
241 yoffy 1.22 FCSSFont: TFont;
242     FCSSBackColor: TColor;
243 h677 1.31 FCSSStrings: TStringList;
244 hi_ 1.1 function GetMemoText(font: TFont; text: string): string;
245     // function GetFontText(Font: TFont; Text: string): string;
246     procedure SetValue;
247 h677 1.60 procedure SaveSetting;
248 hi_ 1.1 procedure SettingApply;
249     function CheckFolder: Boolean;
250 yoffy 1.9 procedure SetAbonpropertys;
251     procedure CSSSetContent(Content: string);
252 yoffy 1.22 procedure CSSPreview;
253 hi_ 1.1 public
254     { Public 鐃緒申鐃緒申 }
255     end;
256    
257     var
258     OptionDialog: TOptionDialog;
259    
260     implementation
261    
262     uses
263 genyakun 1.58 Giko, Editor, Setting, ActnList, KuroutSetting;
264 hi_ 1.1
265     const
266     FONT_TEXT: string = '%s %d pt';
267     MEMO_CABINET: string = '鐃?鐃緒申鐃?鐃?鐃?鐃?';
268     MEMO_THREAD: string = '鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃?';
269     MEMO_BROWSERPOPUP: string = '鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃?';
270     MEMO_BROWSERTAB: string = '鐃?鐃緒申鐃?鐃?鐃?鐃?';
271     MEMO_EDITOR: string = '鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃?';
272     DEFAULT_FONT_NAME: string = '鐃?鐃? 鐃?鐃?鐃?鐃?鐃?';
273     DEFAULT_FONT_SIZE: Integer = 9;
274     DEFAULT_TABFONT_NAME: string = '鐃?鐃? 鐃?鐃?鐃?鐃?鐃?';
275     DEFAULT_TABFONT_SIZE: Integer = 9;
276     URL_TORA3: WideString = 'http://2ch.tora3.net/';
277    
278     {$R *.DFM}
279    
280     procedure TOptionDialog.FormCreate(Sender: TObject);
281     begin
282 yoffy 1.14
283     CSSBrowser.Navigate('about:blank');
284 hi_ 1.1 FClose := True;
285    
286     OptionTab.ActivePage := ConnectSheet;
287     SetValue;
288    
289     CabinetMemo.Text := GetMemoText(CabinetMemo.Font, MEMO_CABINET);
290     ListMemo.Text := GetMemoText(ListMemo.Font, MEMO_THREAD);
291     HintMemo.Text := GetMemoText(HintMemo.Font, MEMO_BROWSERPOPUP);
292     BrowserTabMemo.Text := GetMemoText(BrowserTabMemo.Font, MEMO_BROWSERTAB);
293     EditorMemo.Text := GetMemoText(EditorMemo.Font, MEMO_EDITOR);
294    
295     Tora3URLLabel.Cursor := 5;
296     lblSFont.Caption := '鐃緒申鐃?鐃?鐃緒申'#13#10#13#10
297     + '鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃緒申鐃?'#13#10
298 yoffy 1.9 + '鐃?CSS 鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申';
299 h677 1.23
300 deux 1.27 ForcedLoginLabel.Caption := '- 鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?' + #13#10
301 h677 1.26 + '鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?';
302 h677 1.23 CSSCheckBoxClick(Sender);
303 yoffy 1.35 BrowserMaxLabel.Caption :=
304     '鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?'#13#10 +
305     '鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?';
306 yoffy 1.9
307 yoffy 1.22 if OptionTab.PageCount > GikoSys.Setting.OptionDialogTabIndex then begin
308     OptionTab.ActivePageIndex := GikoSys.Setting.OptionDialogTabIndex;
309 yoffy 1.16 OptionTabChange( nil );
310 yoffy 1.22 end;
311    
312 hi_ 1.1 end;
313    
314     procedure TOptionDialog.FormDestroy(Sender: TObject);
315     begin
316 h677 1.31 CSSListView.OnChange := nil;
317     if FCSSStrings <> nil then
318     FCSSStrings.Free;
319     if FCSSFont <> nil then
320     FCSSFont.Free;
321 hi_ 1.1 sndPlaySound(nil, SND_ASYNC);
322 h677 1.31
323 hi_ 1.1 end;
324    
325     procedure TOptionDialog.OkBottonClick(Sender: TObject);
326     begin
327     FClose := True;
328     ReadPortEditExit(Sender);
329     WritePortEditExit(Sender);
330     AddressHistoryCountEditExit(Sender);
331     PreviewWaitEditExit(Sender);
332    
333     if not CheckFolder then begin
334     FClose := False;
335     Exit;
336     end;
337 h677 1.24 SetAbonpropertys;
338 hi_ 1.1 SaveSetting;
339     SettingApply;
340 h677 1.24
341 hi_ 1.1 end;
342    
343     procedure TOptionDialog.ApplyButtonClick(Sender: TObject);
344     begin
345     ReadPortEditExit(Sender);
346     WritePortEditExit(Sender);
347     AddressHistoryCountEditExit(Sender);
348     PreviewWaitEditExit(Sender);
349    
350     if not CheckFolder then begin
351     FClose := False;
352     Exit;
353     end;
354 h677 1.24 SetAbonpropertys;
355 hi_ 1.1 SaveSetting;
356     SettingApply;
357     FClose := False;
358     end;
359    
360     //function TOptionDialog.GetFontText(Font: TFont; Text: string): string;
361     //begin
362     // result := Format(Text, [Font.Name, Font.Size]);
363     //end;
364    
365     function TOptionDialog.GetMemoText(font: TFont; text: string): string;
366     var
367     s: string;
368     begin
369     s := '';
370     if font <> nil then
371     s := Format(FONT_TEXT, [Font.Name, Font.Size]) + #13#10;
372     Result := s + text;
373     end;
374    
375     //鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申
376     procedure TOptionDialog.CabinetFontBottonClick(Sender: TObject);
377     begin
378     FontDialog.Options := [fdAnsiOnly, fdEffects];
379     FontDialog.Font.Assign(CabinetMemo.Font);
380     if FontDialog.Execute then begin
381     FontDialog.Font.Style := FontDialog.Font.Style - [fsUnderline] - [fsStrikeout];
382     CabinetMemo.Font.Assign(FontDialog.Font);
383     CabinetMemo.Text := GetMemoText(CabinetMemo.Font, MEMO_CABINET);
384     CabinetMemo.Font.Charset := SHIFTJIS_CHARSET;
385     end;
386     end;
387    
388     //鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申
389     procedure TOptionDialog.CabinetColorBottonClick(Sender: TObject);
390     begin
391     ColorDialog.Color := CabinetMemo.Color;
392     if ColorDialog.Execute then begin
393     CabinetMemo.Color := ColorDialog.Color;
394     end;
395     end;
396    
397     //鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申
398     procedure TOptionDialog.CabinetDefaultButtonClick(Sender: TObject);
399     begin
400     CabinetMemo.Font.Name := DEFAULT_FONT_NAME;
401     CabinetMemo.Font.Size := DEFAULT_FONT_SIZE;
402     CabinetMemo.Font.Color := clWindowText;
403     CabinetMemo.Font.Style := [];
404     CabinetMemo.Color := clWindow;
405     CabinetMemo.Text := GetMemoText(CabinetMemo.Font, MEMO_CABINET);
406     end;
407    
408     //鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申
409     procedure TOptionDialog.ListFontBottonClick(Sender: TObject);
410     begin
411     FontDialog.Options := [fdAnsiOnly, fdEffects];
412     FontDialog.Font.Assign(ListMemo.Font);
413     if FontDialog.Execute then begin
414     ListMemo.Font.Assign(FontDialog.Font);
415     ListMemo.Text := GetMemoText(ListMemo.Font, MEMO_THREAD);
416     ListMemo.Font.Charset := SHIFTJIS_CHARSET;
417     end;
418     end;
419    
420     //鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申
421     procedure TOptionDialog.ListColorBottonClick(Sender: TObject);
422     begin
423     ColorDialog.Color := ListMemo.Color;
424     if ColorDialog.Execute then begin
425     ListMemo.Color := ColorDialog.Color;
426     end;
427     end;
428    
429     //鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申
430     procedure TOptionDialog.ListDefaultBottonClick(Sender: TObject);
431     begin
432     ListMemo.Font.Name := DEFAULT_FONT_NAME;
433     ListMemo.Font.Size := DEFAULT_FONT_SIZE;
434     ListMemo.Font.Color := clWindowText;
435     ListMemo.Font.Style := [];
436     ListMemo.Color := clWindow;
437     ListMemo.Text := GetMemoText(ListMemo.Font, MEMO_THREAD);
438     end;
439    
440     //鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申
441     procedure TOptionDialog.HintFontButtonClick(Sender: TObject);
442     begin
443     FontDialog.Options := [fdAnsiOnly, fdEffects];
444     FontDialog.Font.Assign(HintMemo.Font);
445     if FontDialog.Execute then begin
446     HintMemo.Font.Assign(FontDialog.Font);
447     HintMemo.Text := GetMemoText(HintMemo.Font, MEMO_BROWSERPOPUP);
448     HintMemo.Font.Charset := SHIFTJIS_CHARSET;
449     end;
450     end;
451    
452     //鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申
453     procedure TOptionDialog.HintBackButtonClick(Sender: TObject);
454     begin
455     ColorDialog.Color := HintMemo.Color;
456     if ColorDialog.Execute then begin
457     HintMemo.Color := ColorDialog.Color;
458     end;
459     end;
460    
461     //鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申
462     procedure TOptionDialog.HintDefaultButtonClick(Sender: TObject);
463     begin
464     HintMemo.Font.Name := DEFAULT_FONT_NAME;
465     HintMemo.Font.Size := DEFAULT_FONT_SIZE;
466     HintMemo.Font.Color := clWindowText;
467     HintMemo.Font.Style := [];
468     HintMemo.Color := clInfoBk;
469     HintMemo.Text := GetMemoText(HintMemo.Font, MEMO_BROWSERPOPUP);
470     end;
471    
472     //鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申
473     procedure TOptionDialog.BruwserTabFontButtonClick(Sender: TObject);
474     begin
475     FontDialog.Options := [fdAnsiOnly];
476     FontDialog.Font.Assign(BrowserTabMemo.Font);
477     if FontDialog.Execute then begin
478     BrowserTabMemo.Font.Assign(FontDialog.Font);
479     BrowserTabMemo.Text := GetMemoText(FontDialog.Font, MEMO_BROWSERTAB);
480     BrowserTabMemo.Font.Charset := SHIFTJIS_CHARSET;
481     end;
482     end;
483    
484     //鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申
485     procedure TOptionDialog.BrowserTabDefaultButtonClick(Sender: TObject);
486     begin
487     BrowserTabMemo.Font.Name := DEFAULT_TABFONT_NAME;
488     BrowserTabMemo.Font.Size := DEFAULT_TABFONT_SIZE;
489     BrowserTabMemo.Font.Color := clWindowText;
490     BrowserTabMemo.Font.Style := [];
491     BrowserTabMemo.Color := clBtnFace;
492     BrowserTabMemo.Text := GetMemoText(BrowserTabMemo.Font, MEMO_BROWSERTAB);
493     end;
494    
495     //鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申
496     procedure TOptionDialog.EditorFontBottonClick(Sender: TObject);
497     begin
498     FontDialog.Options := [fdAnsiOnly, fdEffects];
499     FontDialog.Font.Assign(EditorMemo.Font);
500     if FontDialog.Execute then begin
501     EditorMemo.Font.Assign(FontDialog.Font);
502     EditorMemo.Text := GetMemoText(EditorMemo.Font, MEMO_EDITOR);
503     EditorMemo.Font.Charset := SHIFTJIS_CHARSET;
504     end;
505     end;
506    
507     //鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申
508     procedure TOptionDialog.EditorColorBottonClick(Sender: TObject);
509     begin
510     ColorDialog.Color := EditorMemo.Font.Color;
511     if ColorDialog.Execute then begin
512     EditorMemo.Color := ColorDialog.Color;
513     end;
514     end;
515    
516     //鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申
517     procedure TOptionDialog.EditorDefaultBottonClick(Sender: TObject);
518     begin
519     EditorMemo.Font.Name := DEFAULT_FONT_NAME;
520     EditorMemo.Font.Size := DEFAULT_FONT_SIZE;
521     EditorMemo.Font.Color := clWindowText;
522     EditorMemo.Font.Style := [];
523     EditorMemo.Color := clWindow;
524     EditorMemo.Text := GetMemoText(EditorMemo.Font, MEMO_EDITOR);
525     end;
526    
527     procedure TOptionDialog.SetValue;
528     var
529     i: Integer;
530     Item: TListItem;
531 h677 1.5 // s: string;
532 yoffy 1.2 idx: Integer;
533 hi_ 1.1 FileList: TStringList;
534     begin
535    
536     //鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃?鐃?
537     ReadProxyCheck.Checked := GikoSys.Setting.ReadProxy;
538     ReadProxyCheckClick(nil);
539     ReadProxyAddressEdit.Text := GikoSys.Setting.ReadProxyAddress;
540     ReadPortEdit.Text := IntToStr(GikoSys.Setting.ReadProxyPort);
541     ReadProxyUserIDEdit.Text := GikoSys.Setting.ReadProxyUserID;
542     ReadProxyPasswordEdit.Text := GikoSys.Setting.ReadProxyPassword;
543     //鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃?鐃?
544     WriteProxyCheck.Checked := GikoSys.Setting.WriteProxy;
545     WriteProxyCheckClick(nil);
546     WriteProxyAddressEdit.Text := GikoSys.Setting.WriteProxyAddress;
547     WritePortEdit.Text := IntToStr(GikoSys.Setting.WriteProxyPort);
548     WriteProxyUserIDEdit.Text := GikoSys.Setting.WriteProxyUserID;
549     WriteProxyPasswordEdit.Text := GikoSys.Setting.WriteProxyPassword;
550     //鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?
551     CabinetMemo.Font.Name := GikoSys.Setting.CabinetFontName;
552     CabinetMemo.Font.Size := GikoSys.Setting.CabinetFontSize;
553     CabinetMemo.Font.Color := GikoSys.Setting.CabinetFontColor;
554     CabinetMemo.Color := GikoSys.Setting.CabinetBackColor;
555     //鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃?
556     ListMemo.Font.Name := GikoSys.Setting.ListFontName;
557     ListMemo.Font.Size := GikoSys.Setting.ListFontSize;
558     ListMemo.Font.Color := GikoSys.Setting.ListFontColor;
559     ListMemo.Color := GikoSys.Setting.ListBackColor;
560 h677 1.32 //鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃?
561     OddResNumCheckBox.Checked := GikoSys.Setting.UseOddColorOddResNum;
562     OddResNumColorBox.Selected := GikoSys.Setting.OddColor;
563     OddResNumColorBox.Enabled := OddResNumCheckBox.Checked;
564    
565 hi_ 1.1 //鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?
566     HintMemo.Font.Name := GikoSys.Setting.HintFontName;
567     HintMemo.Font.Size := GikoSys.Setting.HintFontSize;
568     HintMemo.Font.Color := GikoSys.Setting.HintFontColor;
569     HintMemo.Color := GikoSys.Setting.HintBackColor;
570     //鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?
571     BrowserTabMemo.Font.Name := GikoSys.Setting.BrowserTabFontName;
572     BrowserTabMemo.Font.Size := GikoSys.Setting.BrowserTabFontSize;
573     BrowserTabMemo.Font.Style := [];
574     if GikoSys.Setting.BrowserTabFontBold then
575     BrowserTabMemo.Font.Style := BrowserTabMemo.Font.Style + [fsBold];
576     if GikoSys.Setting.BrowserTabFontItalic then
577     BrowserTabMemo.Font.Style := BrowserTabMemo.Font.Style + [fsItalic];
578     //鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃?
579     EditorMemo.Font.Name := GikoSys.Setting.EditorFontName;
580     EditorMemo.Font.Size := GikoSys.Setting.EditorFontSize;
581     EditorMemo.Font.Color := GikoSys.Setting.EditorFontColor;
582     EditorMemo.Color := GikoSys.Setting.EditorBackColor;
583     //CSS鐃?鐃緒申
584     CSSCheckBox.Checked := GikoSys.Setting.UseCSS;
585 h677 1.31 if FCSSFont <> nil then
586     FCSSFont.Free;
587 yoffy 1.22 FCSSFont := TFont.Create;
588     if (GikoSys.Setting.BrowserFontName <> '') or
589     (GikoSys.Setting.BrowserFontSize <> 0) or
590     (GikoSys.Setting.BrowserFontBold <> 0) or
591     (GikoSys.Setting.BrowserFontItalic <> 0) or
592     (GikoSys.Setting.BrowserFontColor <> -1 ) then begin
593     CSSFontCheckBox.Checked := True;
594 h677 1.32 FCSSFont.Name := GikoSys.Setting.BrowserFontName;
595 yoffy 1.22 FCSSFont.Size := GikoSys.Setting.BrowserFontSize;
596     FCSSFont.Style := [];
597     if GikoSys.Setting.BrowserFontBold = 1 then
598     FCSSFont.Style := FCSSFont.Style + [fsBold];
599     if GikoSys.Setting.BrowserFontItalic = 1 then
600     FCSSFont.Style := FCSSFont.Style + [fsItalic];
601     i := GikoSys.Setting.BrowserFontColor;
602     i := (i shr 16) or (i and $ff00) or ((i and $ff) shl 16);
603     FCSSFont.Color := i;
604     end;
605     if GikoSys.Setting.BrowserBackColor <> -1 then begin
606     CSSBackColorCheckBox.Checked := True;
607    
608     i := GikoSys.Setting.BrowserBackColor;
609     i := (i shr 16) or (i and $ff00) or ((i and $ff) shl 16);
610     FCSSBackColor := i;
611     end;
612 hi_ 1.1 //
613     //鐃?鐃?鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申
614     FileList := TStringList.Create;
615     try
616 yoffy 1.2 GikoSys.GetFileList(GikoSys.GetStyleSheetDir, '*.css', FileList, True, True);
617    
618     Idx := Length(GikoSys.GetStyleSheetDir);
619     for i := 0 to FileList.Count - 1 do
620     FileList[i] := Copy(FileList[i], Idx + 1, Length(FileList[i]));
621 hi_ 1.1 FileList.Sort;
622     for i := 0 to FileList.Count - 1 do begin
623 yoffy 1.2 //s := ExtractFileName(FileList[i]);
624     if LowerCase(FileList[i]) = 'default.css' then
625 hi_ 1.1 Item := CSSListView.Items.Insert(0)
626     else
627     Item := CSSListView.Items.Add;
628 yoffy 1.2 Item.Caption := ChangeFileExt(FileList[i], '');
629     if LowerCase(FileList[i]) = LowerCase(GikoSys.Setting.CSSFileName) then
630 hi_ 1.1 Item.Selected := True;
631     end;
632     finally
633     FileList.Free;
634     end;
635 yoffy 1.6 //鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申
636 h677 1.31 //FileList := TStringList.Create;
637     if FCSSStrings <> nil then
638     FCSSStrings.Clear;
639     FCSSStrings := TStringList.Create;
640 yoffy 1.6 try
641 h677 1.31 //GikoSys.GetDirectoryList(GikoSys.GetSkinDir, '*', FileList, False);
642     GikoSys.GetDirectoryList(GikoSys.GetSkinDir, '*', FCSSStrings, False);
643 yoffy 1.6
644 yoffy 1.22 Idx := Length(GikoSys.GetSkinDir);
645 h677 1.31 //FileList.Sort;
646     FCSSStrings.Sort;
647     //for i := 0 to FileList.Count - 1 do begin
648     for i := 0 to FCSSStrings.Count - 1 do begin
649 yoffy 1.6 //s := ExtractFileName(FileList[i]);
650     Item := CSSListView.Items.Add;
651 h677 1.31 {Item.Data := PChar( FileList[i] );
652 yoffy 1.6 Item.Caption := Copy( FileList[i], Idx + 1, Length(FileList[i]) );
653     if LowerCase(FileList[i]) = LowerCase(GikoSys.Setting.CSSFileName) then
654     Item.Selected := True;
655 h677 1.31 }
656     Item.Data := PChar( FCSSStrings[i] );
657     Item.Caption := Copy( FCSSStrings[i], Idx + 1, Length(FCSSStrings[i]) );
658     if LowerCase(FCSSStrings[i]) = LowerCase(GikoSys.Setting.CSSFileName) then
659     Item.Selected := True;
660 yoffy 1.6 end;
661     finally
662 yoffy 1.22 // Item.Data 鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?
663 yoffy 1.6 //FileList.Free;
664     end;
665    
666 hi_ 1.1 if (CSSListView.ItemIndex = -1) and (CSSListView.Items.Count > 0) then
667 h677 1.31 CSSListView.Items[0].Selected := True;
668 hi_ 1.1
669 q9_ 1.53 //Mail鐃緒申鐃?鐃緒申
670     ShowMailCheckBox.Checked := GikoSys.Setting.ShowMail;
671    
672 yoffy 1.49 // 鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
673     ResRangeHoldCheckBox.Checked := GikoSys.Setting.ResRangeHold;
674     case GikoSys.Setting.ResRange of
675     Ord( grrAll ): ResRangeHoldComboBox.ItemIndex := 0;
676     Ord( grrKoko ): ResRangeHoldComboBox.ItemIndex := 2;
677     Ord( grrNew ): ResRangeHoldComboBox.ItemIndex := 3;
678     100: ResRangeHoldComboBox.ItemIndex := 1;
679     end;
680     ResRangeHoldComboBox.Enabled := GikoSys.Setting.ResRangeHold;
681 hi_ 1.1 //鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?
682     TabAddRadioGroup.ItemIndex := Ord(GikoSys.Setting.BrowserTabAppend);
683     //鐃緒申鐃?鐃?URL
684 h677 1.19 //BoardURL2chEdit.Text := GikoSys.Setting.BoardURL2ch;
685 yoffy 1.22 BoardURLComboBox.Clear;
686     BoardURLComboBox.Items.AddStrings(GikoSys.Setting.BoardURLs);
687     try
688     BoardURLComboBox.ItemIndex := GikoSys.Setting.BoardURLSelected - 1;
689     except
690     BoardURLComboBox.ItemIndex := 0;
691     end;
692 hi_ 1.1 //鐃?鐃緒申
693     UserIDEdit.Text := GikoSys.Setting.UserID;
694     PasswordEdit.Text := GikoSys.Setting.Password;
695     AutoLoginCheckBox.Checked := GikoSys.Setting.AutoLogin;
696 h677 1.32 ForcedLoginCheckBox.Checked := GikoSys.Setting.ForcedLogin;
697 hi_ 1.1 //鐃緒申鐃?鐃?鐃?鐃緒申鐃?
698     if GikoSys.Setting.NewLogFolder = '' then
699     LogFolderEdit.Text := GikoSys.Setting.LogFolder
700     else
701     LogFolderEdit.Text := GikoSys.Setting.NewLogFolder;
702     //鐃?鐃?鐃緒申鐃?
703     for i := 0 to GikoSys.Setting.GetSoundCount - 1 do begin
704     Item := SoundListView.Items.Add;
705     Item.Caption := GikoSys.Setting.SoundViewName[i];
706     if FileExists(GikoSys.Setting.SoundFileName[i]) then
707     Item.SubItems.Add(GikoSys.Setting.SoundFileName[i])
708     else
709     Item.SubItems.Add('');
710     end;
711     //URL鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申
712     URLAppCheckBox.Checked := GikoSys.Setting.URLApp;
713     URLAppCheckBoxClick(nil);
714     AppFolderEdit.Text := GikoSys.Setting.URLAppFile;
715    
716     //mailto鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申
717     OpenMailerCheckBox.Checked := GikoSys.Setting.OpenMailer;
718    
719     //鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃?
720     LogDeleteMessageCheckBox.Checked := GikoSys.Setting.DeleteMsg;
721 h677 1.32
722 yoffy 1.22 //鐃?鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?
723     ShowDialogForEndCheckBox.Checked := GikoSys.Setting.ShowDialogForEnd;
724 h677 1.34 //AllTabClose
725     AllTabCloseCheckBox.Checked := GikoSys.Setting.ShowDialogForAllTabClose;
726 h677 1.32 //Samba
727     UseSambaCheckBox.Checked := GikoSys.Setting.UseSamba;
728 h677 1.34 ResAnchorCheckBox.Checked := GikoSys.Setting.ResAnchorJamp;
729 yoffy 1.35 // 鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申
730     BrowserMaxCombo.ItemIndex := Ord( GikoSys.Setting.BrowserAutoMaximize );
731 hi_ 1.1 //鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?
732     case GikoSys.Setting.PopupPosition of
733     gppRightTop: PopupPositionRadioGroup.ItemIndex := 0;
734     gppRight: PopupPositionRadioGroup.ItemIndex := 1;
735     gppRightBottom: PopupPositionRadioGroup.ItemIndex := 2;
736     gppTop: PopupPositionRadioGroup.ItemIndex := 3;
737     gppCenter: PopupPositionRadioGroup.ItemIndex := 4;
738     gppBottom: PopupPositionRadioGroup.ItemIndex := 5;
739     gppLeftTop: PopupPositionRadioGroup.ItemIndex := 6;
740     gppLeft: PopupPositionRadioGroup.ItemIndex := 7;
741     gppLeftBottom: PopupPositionRadioGroup.ItemIndex := 8;
742     end;
743    
744     //鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申
745     UnActivePopupCheckBox.Checked := GikoSys.Setting.UnActivePopup;
746 yoffy 1.2 //鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申
747     ResPopupBoldCheckBox.Checked := GikoSys.Setting.ResPopupHeaderBold;
748 hi_ 1.1
749     //鐃?鐃?鐃緒申鐃?鐃?鐃?
750     URLDisplayCheckBox.Checked := GikoSys.Setting.URLDisplay;
751     TabStopAddressBarCheckBox.Checked := GikoSys.Setting.AddressBarTabStop;
752     LinkAddCheckBox.Checked := GikoSys.Setting.LinkAddAddressBar;
753     AddressHistoryCountEdit.Text := IntToStr(GikoSys.Setting.AddressHistoryCount);
754    
755     //HTML鐃?鐃緒申鐃?鐃緒申鐃?
756     PreviewVisibleCheckBox.Checked := GikoSys.Setting.PreviewVisible;
757     PreviewWaitEdit.Text := IntToStr(GikoSys.Setting.PreviewWait);
758     PreviewSizeComboBox.ItemIndex := 2;
759     case GikoSys.Setting.PreviewSize of
760     gpsXLarge: PreviewSizeComboBox.ItemIndex := 4;
761     gpsLarge: PreviewSizeComboBox.ItemIndex := 3;
762     gpsMedium: PreviewSizeComboBox.ItemIndex := 2;
763     gpsSmall: PreviewSizeComboBox.ItemIndex := 1;
764     gpsXSmall: PreviewSizeComboBox.ItemIndex := 0;
765     end;
766    
767     //鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申
768     ThreadListIconCheckBox.Checked := GikoSys.Setting.ListIconVisible;
769 q9_ 1.42 NonAcquiredCountCheckBox.Checked := GikoSys.Setting.NonAcquiredCount;
770 h677 1.32 CreationTimeLogsCheckBox.Checked := GikoSys.Setting.CreationTimeLogs;
771     FutureThreadCheckBox.Checked := GikoSys.Setting.FutureThread;
772 h677 1.41 SelectIntervalEdit.Text := IntToStr(GikoSys.Setting.SelectInterval);
773 q9_ 1.51
774     //dat鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃緒申
775     case GikoSys.Setting.DatOchiSortIndex of
776 q9_ 1.52 0:
777 q9_ 1.51 if GikoSys.Setting.DatOchiSortOrder then
778     DatOchiSortCombo.ItemIndex := 1
779     else
780     DatOchiSortCombo.ItemIndex := 2;
781 q9_ 1.52 6:
782 q9_ 1.51 if GikoSys.Setting.DatOchiSortOrder then
783     DatOchiSortCombo.ItemIndex := 3
784     else
785     DatOchiSortCombo.ItemIndex := 4;
786 q9_ 1.52 7:
787     if GikoSys.Setting.DatOchiSortOrder then
788     DatOchiSortCombo.ItemIndex := 5
789     else
790     DatOchiSortCombo.ItemIndex := 6;
791 q9_ 1.51 else
792     DatOchiSortCombo.ItemIndex := 0;
793     end;
794 hi_ 1.1
795 genyakun 1.50 //鐃緒申鐃緒申鐃?鐃緒申
796     RloCheckBox.Checked := GikoSys.Setting.AbonDeleterlo;
797     ReplaceulCheckBox.Checked := GikoSys.Setting.AbonReplaceul;
798     PopUpAbonCheckBox.Checked := GikoSys.Setting.PopUpAbon;
799     ShowNGLineCheckBox.Checked := GikoSys.Setting.ShowNGLinesNum;
800     AddResAnchorCheckBox.Checked := GikoSys.Setting.AddResAnchor;
801 yoffy 1.38 DeleteSyriaCheckBox.Checked := GikoSys.Setting.DeleteSyria;
802    
803 genyakun 1.50 //TabAutoLoad
804 genyakun 1.55 TabLoadSave.Checked := Gikosys.Setting.TabAutoLoadSave;
805 genyakun 1.50
806 hi_ 1.1 end;
807    
808     procedure TOptionDialog.SaveSetting;
809     var
810     i: Integer;
811 h677 1.32 tmp: string;
812 hi_ 1.1 // Item: TListItem;
813     begin
814 yoffy 1.22 GikoSys.Setting.OptionDialogTabIndex := OptionTab.TabIndex;
815 yoffy 1.16
816 hi_ 1.1 GikoSys.Setting.ReadProxy := ReadProxyCheck.Checked;
817     GikoSys.Setting.ReadProxyAddress := ReadProxyAddressEdit.Text;
818     GikoSys.Setting.ReadProxyPort := StrToInt(ReadPortEdit.Text);
819     GikoSys.Setting.ReadProxyUserID := ReadProxyUserIDEdit.Text;
820     GikoSys.Setting.ReadProxyPassword := ReadProxyPasswordEdit.Text;
821    
822     GikoSys.Setting.WriteProxy := WriteProxyCheck.Checked;
823     GikoSys.Setting.WriteProxyAddress := WriteProxyAddressEdit.Text;
824     GikoSys.Setting.WriteProxyPort := StrToInt(WritePortEdit.Text);
825     GikoSys.Setting.WriteProxyUserID := WriteProxyUserIDEdit.Text;
826     GikoSys.Setting.WriteProxyPassword := WriteProxyPasswordEdit.Text;
827    
828     GikoSys.Setting.CabinetFontName := CabinetMemo.Font.Name;
829     GikoSys.Setting.CabinetFontSize := CabinetMemo.Font.Size;
830     GikoSys.Setting.CabinetFontColor := CabinetMemo.Font.Color;
831     GikoSys.Setting.CabinetBackColor := CabinetMemo.Color;
832    
833     GikoSys.Setting.ListFontName := ListMemo.Font.Name;
834     GikoSys.Setting.ListFontSize := ListMemo.Font.Size;
835     GikoSys.Setting.ListFontColor := ListMemo.Font.Color;
836     GikoSys.Setting.ListBackColor := ListMemo.Color;
837 h677 1.32 GikoSys.Setting.UseOddColorOddResNum := OddResNumCheckBox.Checked;
838     GikoSys.Setting.OddColor := OddResNumColorBox.Selected;
839 hi_ 1.1
840     GikoSys.Setting.HintFontName := HintMemo.Font.Name;
841     GikoSys.Setting.HintFontSize := HintMemo.Font.Size;
842     GikoSys.Setting.HintFontColor := HintMemo.Font.Color;
843     GikoSys.Setting.HintBackColor := HintMemo.Color;
844    
845     GikoSys.Setting.BrowserTabFontName := BrowserTabMemo.Font.Name;
846     GikoSys.Setting.BrowserTabFontSize := BrowserTabMemo.Font.Size;
847    
848     GikoSys.Setting.EditorFontName := EditorMemo.Font.Name;
849     GikoSys.Setting.EditorFontSize := EditorMemo.Font.Size;
850     GikoSys.Setting.EditorFontColor := EditorMemo.Font.Color;
851     GikoSys.Setting.EditorBackColor := EditorMemo.Color;
852 h677 1.32 {FRepaintThread : 鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申
853     鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?true鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申
854     鐃?鐃緒申鐃?鐃?鐃緒申Repaint鐃緒申true鐃緒申鐃緒申鐃緒申
855     }
856 hi_ 1.1 //CSS鐃?鐃緒申
857 h677 1.32 if GikoSys.Setting.UseCSS <> CSSCheckBox.Checked then FRepaintThread := true;
858 hi_ 1.1 GikoSys.Setting.UseCSS := CSSCheckBox.Checked;
859     //CSS鐃?鐃?鐃?鐃緒申鐃緒申
860 h677 1.32 tmp := GikoSys.Setting.CSSFileName;
861 hi_ 1.1 GikoSys.Setting.CSSFileName := 'default.css';
862     if CSSListView.Items.Count > 0 then begin
863     try
864 yoffy 1.22 if CSSListView.Items[CSSListView.ItemIndex].Data <> nil then
865 yoffy 1.6 GikoSys.Setting.CSSFileName := string( CSSListView.Items[CSSListView.ItemIndex].data )
866 yoffy 1.22 else
867 yoffy 1.6 GikoSys.Setting.CSSFileName := CSSListView.Items[CSSListView.ItemIndex].Caption + '.css';
868 hi_ 1.1 except
869     end;
870     end;
871 h677 1.32 if tmp <> GikoSys.Setting.CSSFileName then FRepaintThread := true;
872 yoffy 1.22 // CSS 鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃緒申
873     if CSSFontCheckBox.Checked then begin
874 h677 1.32 if GikoSys.Setting.BrowserFontName <> FCSSFont.Name then FRepaintThread := true;
875 yoffy 1.22 GikoSys.Setting.BrowserFontName := FCSSFont.Name;
876 h677 1.32 if GikoSys.Setting.BrowserFontSize <> FCSSFont.Size then FRepaintThread := true;
877 yoffy 1.22 GikoSys.Setting.BrowserFontSize := FCSSFont.Size;
878 h677 1.32 if fsBold in FCSSFont.Style then begin
879     if GikoSys.Setting.BrowserFontBold <> 1 then FRepaintThread := true;
880     GikoSys.Setting.BrowserFontBold := 1;
881     end else begin
882     if GikoSys.Setting.BrowserFontBold <> -1 then FRepaintThread := true;
883 yoffy 1.22 GikoSys.Setting.BrowserFontBold := -1;
884 h677 1.32 end;
885     if fsItalic in FCSSFont.Style then begin
886     if GikoSys.Setting.BrowserFontItalic <> 1 then FRepaintThread := true;
887     GikoSys.Setting.BrowserFontItalic := 1;
888     end else begin
889     if GikoSys.Setting.BrowserFontItalic <> -1 then FRepaintThread := true;
890 yoffy 1.22 GikoSys.Setting.BrowserFontItalic := -1;
891 h677 1.32 end;
892 yoffy 1.22 i := ColorToRGB( FCSSFont.Color );
893 h677 1.32 if (GikoSys.Setting.BrowserFontColor <> (i shr 16) or (i and $ff00) or ((i and $ff) shl 16)) then
894     FRepaintThread := true;
895 yoffy 1.22 GikoSys.Setting.BrowserFontColor := (i shr 16) or (i and $ff00) or ((i and $ff) shl 16);
896     end else begin
897 h677 1.32 if GikoSys.Setting.BrowserFontName <> '' then FRepaintThread := true;
898 yoffy 1.22 GikoSys.Setting.BrowserFontName := '';
899 h677 1.32 if GikoSys.Setting.BrowserFontSize <> 0 then FRepaintThread := true;
900 yoffy 1.22 GikoSys.Setting.BrowserFontSize := 0;
901 h677 1.32 if GikoSys.Setting.BrowserFontBold <> 0 then FRepaintThread := true;
902 yoffy 1.22 GikoSys.Setting.BrowserFontBold := 0;
903 h677 1.32 if GikoSys.Setting.BrowserFontItalic <> 0 then FRepaintThread := true;
904 yoffy 1.22 GikoSys.Setting.BrowserFontItalic := 0;
905 h677 1.32 if GikoSys.Setting.BrowserFontColor <> -1 then FRepaintThread := true;
906 yoffy 1.22 GikoSys.Setting.BrowserFontColor := -1;
907     end;
908     if CSSBackColorCheckBox.Checked then begin
909     i := ColorToRGB( FCSSBackColor );
910 h677 1.32 if(GikoSys.Setting.BrowserBackColor <> (i shr 16) or (i and $ff00) or ((i and $ff) shl 16)) then
911     FRepaintThread := true;
912 yoffy 1.22 GikoSys.Setting.BrowserBackColor := (i shr 16) or (i and $ff00) or ((i and $ff) shl 16);
913     end else begin
914 h677 1.32 if GikoSys.Setting.BrowserBackColor <> -1 then FRepaintThread := true;
915 yoffy 1.22 GikoSys.Setting.BrowserBackColor := -1;
916     end;
917 hi_ 1.1
918     //Mail鐃緒申鐃?鐃緒申
919 h677 1.32 if GikoSys.Setting.ShowMail <> ShowMailCheckBox.Checked then FRepaintThread := true;
920 hi_ 1.1 GikoSys.Setting.ShowMail := ShowMailCheckBox.Checked;
921 yoffy 1.49 // 鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
922     GikoSys.Setting.ResRangeHold := ResRangeHoldCheckBox.Checked;
923     case ResRangeHoldComboBox.ItemIndex of
924     0: GikoSys.Setting.ResRange := Ord( grrAll );
925     1: GikoSys.Setting.ResRange := 100;
926     2: GikoSys.Setting.ResRange := Ord( grrKoko );
927     3: GikoSys.Setting.ResRange := Ord( grrNew );
928     end;
929 hi_ 1.1
930     GikoSys.Setting.BrowserTabAppend := TGikoTabAppend(TabAddRadioGroup.ItemIndex);
931    
932 h677 1.19 // GikoSys.Setting.BoardURL2ch := BoardURL2chEdit.Text;
933 yoffy 1.22 GikoSys.Setting.BoardURLs.Clear;
934     GikoSys.Setting.BoardURLs.AddStrings(BoardURLComboBox.Items);
935     GikoSys.Setting.BoardURLSelected := BoardURLComboBox.ItemIndex + 1;
936 hi_ 1.1 GikoSys.Setting.UserID := UserIDEdit.Text;
937     GikoSys.Setting.Password := PasswordEdit.Text;
938     GikoSys.Setting.AutoLogin := AutoLoginCheckBox.Checked;
939 h677 1.32 GikoSys.Setting.ForcedLogin := ForcedLoginCheckBox.Checked;
940 hi_ 1.1 GikoSys.Setting.URLApp := URLAppCheckBox.Checked;
941     GikoSys.Setting.URLAppFile := AppFolderEdit.Text;
942    
943     GikoSys.Setting.OpenMailer := OpenMailerCheckBox.Checked;
944     GikoSys.Setting.DeleteMsg := LogDeleteMessageCheckBox.Checked;
945 yoffy 1.22 //鐃?鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?
946     GikoSys.Setting.ShowDialogForEnd := ShowDialogForEndCheckBox.Checked;
947 h677 1.34 //AllTabClose
948     GikoSys.Setting.ShowDialogForAllTabClose := AllTabCloseCheckBox.Checked;
949 h677 1.30 //Samba
950 h677 1.34 GikoSys.Setting.UseSamba := UseSambaCheckBox.Checked;
951     GikoSys.Setting.ResAnchorJamp := ResAnchorCheckBox.Checked;
952 yoffy 1.35 // 鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申
953     GikoSys.Setting.BrowserAutoMaximize := TGikoBrowserAutoMaximize( BrowserMaxCombo.ItemIndex );
954 hi_ 1.1 //鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?
955     case PopupPositionRadioGroup.ItemIndex of
956     0: GikoSys.Setting.PopupPosition := gppRightTop;
957     1: GikoSys.Setting.PopupPosition := gppRight;
958     2: GikoSys.Setting.PopupPosition := gppRightBottom;
959     3: GikoSys.Setting.PopupPosition := gppTop;
960     4: GikoSys.Setting.PopupPosition := gppCenter;
961     5: GikoSys.Setting.PopupPosition := gppBottom;
962     6: GikoSys.Setting.PopupPosition := gppLeftTop;
963     7: GikoSys.Setting.PopupPosition := gppLeft;
964     8: GikoSys.Setting.PopupPosition := gppLeftBottom;
965     end;
966    
967     //鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申
968     GikoSys.Setting.UnActivePopup := UnActivePopupCheckBox.Checked;
969 yoffy 1.2 //鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申
970     GikoSys.Setting.ResPopupHeaderBold := ResPopupBoldCheckBox.Checked;
971 hi_ 1.1
972     //鐃?鐃?鐃緒申鐃?鐃?鐃?
973     GikoSys.Setting.URLDisplay := URLDisplayCheckBox.Checked;
974     GikoSys.Setting.AddressBarTabStop := TabStopAddressBarCheckBox.Checked;
975     GikoSys.Setting.LinkAddAddressBar := LinkAddCheckBox.Checked;
976     if GikoSys.IsNumeric(AddressHistoryCountEdit.Text) then
977     GikoSys.Setting.AddressHistoryCount := StrToInt(AddressHistoryCountEdit.Text)
978     else
979     GikoSys.Setting.AddressHistoryCount := 100;
980    
981     //HTML鐃?鐃緒申鐃?鐃緒申鐃?
982     GikoSys.Setting.PreviewVisible := PreviewVisibleCheckBox.Checked;
983     if GikoSys.IsNumeric(PreviewWaitEdit.Text) then
984     GikoSys.Setting.PreviewWait := StrToInt(PreviewWaitEdit.Text)
985     else
986     GikoSys.Setting.PreviewWait := 500;
987     case PreviewSizeComboBox.ItemIndex of
988     0: GikoSys.Setting.PreviewSize := gpsXSmall;
989     1: GikoSys.Setting.PreviewSize := gpsSmall;
990     2: GikoSys.Setting.PreviewSize := gpsMedium;
991     3: GikoSys.Setting.PreviewSize := gpsLarge;
992     4: GikoSys.Setting.PreviewSize := gpsXLarge;
993     end;
994    
995     //鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申
996     GikoSys.Setting.ListIconVisible := ThreadListIconCheckBox.Checked;
997 q9_ 1.54
998     //鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申
999     if (GikoSys.Setting.NonAcquiredCount <> NonAcquiredCountCheckBox.Checked) and (GikoForm.ActiveList Is TBoard) then
1000     FRepaintList := true;
1001 q9_ 1.42 GikoSys.Setting.NonAcquiredCount := NonAcquiredCountCheckBox.Checked;
1002 q9_ 1.54
1003     GikoSys.Setting.CreationTimeLogs := CreationTimeLogsCheckBox.Checked;
1004 h677 1.41 GikoSys.Setting.FutureThread := FutureThreadCheckBox.Checked;
1005     if StrToIntDef(SelectIntervalEdit.Text, 110) > 55 then
1006     GikoSys.Setting.SelectInterval := StrToIntDef(SelectIntervalEdit.Text, 110)
1007     else
1008     GikoSys.Setting.SelectInterval := 55;
1009 q9_ 1.51
1010     //dat鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃緒申
1011     case DatOchiSortCombo.ItemIndex of
1012     0: GikoSys.Setting.DatOchiSortIndex := -1; //鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1013 q9_ 1.52 1: begin //鐃?鐃緒申鐃緒申鐃緒申(鐃緒申鐃緒申)
1014     GikoSys.Setting.DatOchiSortOrder := true;
1015     GikoSys.Setting.DatOchiSortIndex := 0;
1016     end;
1017     2: begin //鐃?鐃緒申鐃緒申鐃緒申(鐃?鐃緒申)
1018     GikoSys.Setting.DatOchiSortOrder := false;
1019     GikoSys.Setting.DatOchiSortIndex := 0;
1020     end;
1021     3: begin //鐃緒申鐃緒申鐃緒申鐃緒申(鐃緒申鐃緒申)
1022 q9_ 1.51 GikoSys.Setting.DatOchiSortOrder := true;
1023     GikoSys.Setting.DatOchiSortIndex := 6;
1024     end;
1025 q9_ 1.52 4: begin //鐃緒申鐃緒申鐃緒申鐃緒申(鐃?鐃緒申)
1026 q9_ 1.51 GikoSys.Setting.DatOchiSortOrder := false;
1027     GikoSys.Setting.DatOchiSortIndex := 6;
1028     end;
1029 q9_ 1.52 5: begin //鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申(鐃緒申鐃緒申)
1030 q9_ 1.51 GikoSys.Setting.DatOchiSortOrder := true;
1031     GikoSys.Setting.DatOchiSortIndex := 7;
1032     end;
1033 q9_ 1.52 6: begin //鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申(鐃?鐃緒申)
1034 q9_ 1.51 GikoSys.Setting.DatOchiSortOrder := false;
1035     GikoSys.Setting.DatOchiSortIndex := 7;
1036     end;
1037     end;
1038    
1039 hi_ 1.1 GikoSys.Setting.WriteSystemSettingFile;
1040 yoffy 1.22 GikoSys.Setting.WriteBoardURLSettingFile;
1041 hi_ 1.1 // GikoForm.SetBrowserTabState;
1042    
1043     if LogFolderEdit.Text <> '' then begin
1044     GikoSys.Setting.NewLogFolder := LogFolderEdit.Text;
1045     GikoSys.Setting.WriteFolderSettingFile;
1046     end;
1047    
1048     for i := 0 to SoundListView.Items.Count - 1 do begin
1049     if FileExists(SoundListView.Items[i].SubItems[0]) then
1050     GikoSys.Setting.SoundFileName[i] := SoundListView.Items[i].SubItems[0]
1051     else
1052     GikoSys.Setting.SoundFileName[i] := '';
1053     end;
1054 h677 1.3
1055 h677 1.17 //鐃緒申鐃緒申鐃?鐃緒申
1056     GikoSys.Setting.AbonDeleterlo := RloCheckBox.Checked;
1057     GikoSys.Setting.AbonReplaceul := ReplaceulCheckBox.Checked;
1058     GikoSys.Setting.PopUpAbon := PopUpAbonCheckBox.Checked;
1059     GikoSys.Setting.ShowNGLinesNum := ShowNGLineCheckBox.Checked;
1060 yoffy 1.22 GikoSys.Setting.AddResAnchor := AddResAnchorCheckBox.Checked;
1061 genyakun 1.46 GikoSys.Setting.DeleteSyria := DeleteSyriaCheckBox.Checked;
1062    
1063     //Tab鐃緒申鐃緒申鐃緒申鐃緒申
1064 genyakun 1.55 GikoSys.Setting.TabAutoLoadSave := TabLoadSave.Checked;
1065 hi_ 1.1 end;
1066    
1067     procedure TOptionDialog.SettingApply;
1068     var
1069     i: Integer;
1070     begin
1071     GikoForm.TreeView.Items.BeginUpdate;
1072 yoffy 1.22 GikoForm.FavoriteTreeView.Items.BeginUpdate;
1073 hi_ 1.1 GikoForm.ListView.Items.BeginUpdate;
1074     try
1075     GikoForm.TreeView.Font.Name := GikoSys.Setting.CabinetFontName;
1076     GikoForm.TreeView.Font.Size := GikoSys.Setting.CabinetFontSize;
1077     GikoForm.TreeView.Font.Color := GikoSys.Setting.CabinetFontColor;
1078     GikoForm.TreeView.Color := GikoSys.Setting.CabinetBackColor;
1079    
1080 yoffy 1.16 GikoForm.FavoriteTreeView.Font.Name := GikoSys.Setting.CabinetFontName;
1081     GikoForm.FavoriteTreeView.Font.Size := GikoSys.Setting.CabinetFontSize;
1082     GikoForm.FavoriteTreeView.Font.Color := GikoSys.Setting.CabinetFontColor;
1083     GikoForm.FavoriteTreeView.Color := GikoSys.Setting.CabinetBackColor;
1084    
1085 hi_ 1.1 GikoForm.ListView.Font.Name := GikoSys.Setting.ListFontName;
1086     GikoForm.ListView.Font.Size := GikoSys.Setting.ListFontSize;
1087     GikoForm.ListView.Font.Color := GikoSys.Setting.ListFontColor;
1088 h677 1.23 //GikoForm.ListView.Color := GikoSys.Setting.ListBackColor;
1089 h677 1.32 GikoForm.ListViewBackGroundColor := GikoSys.Setting.ListBackColor;
1090 h677 1.23 GikoForm.UseOddResOddColor := GikoSys.Setting.UseOddColorOddResNum;
1091     GikoForm.OddColor := GikoSys.Setting.OddColor;
1092 hi_ 1.1
1093     GikoForm.BrowserTab.Font.Name := GikoSys.Setting.BrowserTabFontName;
1094     GikoForm.BrowserTab.Font.Size := GikoSys.Setting.BrowserTabFontSize;
1095     // GikoForm.BrowserTab.Height := (GikoSys.Setting.BrowserTabFontSize * 2) + 1;
1096     // GikoForm.BrowserBottomPanel.Height := GikoForm.BrowserTab.Height;
1097    
1098     for i := 0 to Screen.CustomFormCount - 1 do begin
1099     if TObject(Screen.CustomForms[i]) is TEditorForm then begin
1100     TEditorForm(Screen.CustomForms[i]).SetFont;
1101     end;
1102     end;
1103    
1104     finally
1105     GikoForm.TreeView.Items.EndUpdate;
1106 yoffy 1.22 GikoForm.FavoriteTreeView.Items.EndUpdate;
1107 hi_ 1.1 GikoForm.ListView.Items.EndUpdate;
1108     end;
1109    
1110     //鐃?鐃?鐃緒申鐃?鐃?鐃?
1111     for i := GikoForm.AddressComboBox.Items.Count - 1 downto 0 do begin
1112     if GikoSys.Setting.AddressHistoryCount >= GikoForm.AddressComboBox.Items.Count then
1113     Break;
1114     GikoForm.AddressComboBox.Items.Delete(i);
1115     end;
1116     GikoForm.AddressComboBox.TabStop := GikoSys.Setting.AddressBarTabStop;
1117 yoffy 1.15
1118 q9_ 1.54 //鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申
1119     if FRepaintList then begin
1120     // SetActiveList鐃緒申鐃緒申鐃?
1121     GikoForm.ActiveList := GikoForm.ActiveList;
1122     end;
1123    
1124 yoffy 1.22 // 鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申
1125 h677 1.32 if FRepaintThread then begin
1126     for i := GikoForm.BrowserTab.Tabs.Count - 1 downto 0 do begin
1127     TBrowserRecord(GikoForm.BrowserTab.Tabs.Objects[i]).Repaint := true;
1128     end;
1129     GikoForm.BrowserTab.OnChange(nil);
1130     end;
1131 hi_ 1.1 end;
1132    
1133     procedure TOptionDialog.ReadProxyCheckClick(Sender: TObject);
1134     begin
1135     ReadProxyAddressEdit.Enabled := ReadProxyCheck.Checked;
1136     ReadPortEdit.Enabled := ReadProxyCheck.Checked;
1137     ReadProxyUserIDEdit.Enabled := ReadProxyCheck.Checked;
1138     ReadProxyPasswordEdit.Enabled := ReadProxyCheck.Checked;
1139    
1140     ReadAddressLabel.Enabled := ReadProxyCheck.Checked;
1141     ReadPortLabel.Enabled := ReadProxyCheck.Checked;
1142     ReadUserIDLabel.Enabled := ReadProxyCheck.Checked;
1143     ReadPasswordLabel.Enabled := ReadProxyCheck.Checked;
1144     end;
1145    
1146     procedure TOptionDialog.ReadPortEditExit(Sender: TObject);
1147     begin
1148     if not GikoSys.IsNumeric(ReadPortEdit.Text) then
1149     ReadPortEdit.Text := '0';
1150     end;
1151    
1152     procedure TOptionDialog.LogFolderButtonClick(Sender: TObject);
1153     var
1154     Root: WideString;
1155     Dir: string;
1156     begin
1157     Root := '';
1158     if SelectDirectory('鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申', Root, Dir) then begin
1159     LogFolderEdit.Text := Dir;
1160     end;
1161     end;
1162    
1163     function TOptionDialog.CheckFolder: Boolean;
1164     begin
1165     if Trim(LogFolderEdit.Text) = '' then
1166     LogFolderEdit.Text := ExtractFilePath(Application.ExeName) + 'Log';
1167    
1168     if DirectoryExists(LogFolderEdit.Text) then begin
1169     Result := True;
1170     end else begin
1171     if MsgBox(Handle, '鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?', '鐃?鐃?鐃?鐃?', MB_YESNO or MB_ICONQUESTION) = IDYES then begin
1172     //鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申
1173     try
1174     GikoSys.ForceDirectoriesEx(LogFolderEdit.Text);
1175     Result := True
1176     except
1177     MsgBox(Handle, '鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?', '鐃?鐃緒申鐃?', MB_OK or MB_ICONSTOP);
1178     OptionTab.ActivePage := FolderSheet;
1179     LogFolderEdit.SetFocus;
1180     Result := False;
1181     end;
1182     end else
1183     Result := False;
1184     end;
1185     end;
1186    
1187     procedure TOptionDialog.FormClose(Sender: TObject; var Action: TCloseAction);
1188     begin
1189     if not FClose then
1190     Action := caNone;
1191     FClose := True;
1192     end;
1193    
1194     procedure TOptionDialog.SoundReferButtonClick(Sender: TObject);
1195     begin
1196     OpenDialog.Filter := '鐃?鐃?鐃緒申鐃? (*.wav)|*.wav|鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申 (*.*)|*.*';
1197     sndPlaySound(nil, SND_ASYNC);
1198     if OpenDialog.Execute then begin
1199     SoundFileEdit.Text := OpenDialog.FileName;
1200     end;
1201     end;
1202    
1203     procedure TOptionDialog.SoundPlayButtonClick(Sender: TObject);
1204     begin
1205     if not FileExists(SoundFileEdit.Text) then begin
1206     MsgBox(Handle, '鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申', '鐃?鐃緒申鐃?', MB_ICONSTOP or MB_OK);
1207     SoundFileEdit.Text := '';
1208     Exit;
1209     end;
1210     if not sndPlaySound(PChar(SoundFileEdit.Text), SND_ASYNC or SND_NOSTOP) then begin
1211     sndPlaySound(nil, SND_ASYNC);
1212     end;
1213     end;
1214    
1215     procedure TOptionDialog.SoundListViewChanging(Sender: TObject;
1216 yoffy 1.22 Item: TListItem; Change: TItemChange; var AllowChange: Boolean);
1217 hi_ 1.1 begin
1218     if Item.SubItems.Count > 0 then
1219     SoundFileEdit.Text := Item.SubItems[0];
1220     end;
1221    
1222     procedure TOptionDialog.SoundFileEditChange(Sender: TObject);
1223     var
1224     Item: TListItem;
1225     begin
1226     sndPlaySound(nil, SND_ASYNC);
1227     Item := SoundListView.Selected;
1228     if Item = nil then Exit;
1229    
1230     if FileExists(SoundFileEdit.Text) then
1231     Item.SubItems[0] := SoundFileEdit.Text;
1232     if Trim(SoundFileEdit.Text) = '' then
1233     Item.SubItems[0] := '';
1234     end;
1235    
1236     procedure TOptionDialog.OptionTabChange(Sender: TObject);
1237     begin
1238     sndPlaySound(nil, SND_ASYNC);
1239 yoffy 1.11
1240 yoffy 1.22 if OptionTab.ActivePage = CSSTabSheet then
1241     CSSPreview;
1242 hi_ 1.1 end;
1243    
1244     procedure TOptionDialog.AppFolderButtonClick(Sender: TObject);
1245     begin
1246     OpenDialog.Filter := '鐃緒申鐃?鐃?鐃?鐃?鐃緒申 (*.exe)|*.exe|鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申 (*.*)|*.*';
1247     if OpenDialog.Execute then
1248     AppFolderEdit.Text := OpenDialog.FileName;
1249     end;
1250    
1251     procedure TOptionDialog.WriteProxyCheckClick(Sender: TObject);
1252     begin
1253     WriteProxyAddressEdit.Enabled := WriteProxyCheck.Checked;
1254     WritePortEdit.Enabled := WriteProxyCheck.Checked;
1255     WriteProxyUserIDEdit.Enabled := WriteProxyCheck.Checked;
1256     WriteProxyPasswordEdit.Enabled := WriteProxyCheck.Checked;
1257    
1258     WriteAddressLabel.Enabled := WriteProxyCheck.Checked;
1259     WritePortLabel.Enabled := WriteProxyCheck.Checked;
1260     WriteUserIDLabel.Enabled := WriteProxyCheck.Checked;
1261     WritePasswordLabel.Enabled := WriteProxyCheck.Checked;
1262     end;
1263    
1264     procedure TOptionDialog.WritePortEditExit(Sender: TObject);
1265     begin
1266     if not GikoSys.IsNumeric(WritePortEdit.Text) then
1267     WritePortEdit.Text := '0';
1268     end;
1269    
1270     procedure TOptionDialog.Tora3URLLabelClick(Sender: TObject);
1271     begin
1272     GikoSys.OpenBrowser(URL_TORA3, gbtAuto);
1273     end;
1274    
1275     procedure TOptionDialog.HotKeyEnter(Sender: TObject);
1276     begin
1277     OkBotton.Default := False;
1278     CancelBotton.Cancel := False;
1279     end;
1280    
1281     procedure TOptionDialog.HotKeyExit(Sender: TObject);
1282     begin
1283     OkBotton.Default := True;
1284     CancelBotton.Cancel := True;
1285     end;
1286    
1287     procedure TOptionDialog.URLAppCheckBoxClick(Sender: TObject);
1288     begin
1289     AppFolderLabel.Enabled := URLAppCheckBox.Checked;
1290     AppFolderEdit.Enabled := URLAppCheckBox.Checked;
1291     AppFolderButton.Enabled := URLAppCheckBox.Checked;
1292     end;
1293    
1294     procedure TOptionDialog.AddressHistoryCountEditExit(Sender: TObject);
1295     begin
1296     if not GikoSys.IsNumeric(AddressHistoryCountEdit.Text) then
1297     AddressHistoryCountEdit.Text := '100';
1298     end;
1299    
1300     procedure TOptionDialog.PreviewWaitEditExit(Sender: TObject);
1301     begin
1302     if not GikoSys.IsNumeric(PreviewWaitEdit.Text) then
1303     PreviewWaitEdit.Text := '500';
1304     if StrToInt(PreviewWaitEdit.Text) < 500 then
1305     PreviewWaitEdit.Text := '500';
1306     if StrToInt(PreviewWaitEdit.Text) > 9999 then
1307     PreviewWaitEdit.Text := '9999';
1308     end;
1309    
1310     procedure TOptionDialog.CSSCheckBoxClick(Sender: TObject);
1311     begin
1312     CSSListLabel.Enabled := CSSCheckBox.Checked;
1313     CSSListView.Enabled := CSSCheckBox.Checked;
1314     end;
1315    
1316 h677 1.3 procedure TOptionDialog.SetAbonpropertys;
1317     begin
1318 yoffy 1.22 //鐃緒申鐃緒申鐃?鐃緒申
1319     GikoSys.FAbon.Deleterlo := RloCheckBox.Checked;
1320     GikoSys.FAbon.Replaceul := ReplaceulCheckBox.Checked;
1321     GikoSys.FAbon.AbonPopupRes := PopUpAbonCheckBox.Checked;
1322 h677 1.17 GikoSys.FAbon.ReturnNGwordLineNum := ShowNGLineCheckBox.Checked;
1323 yoffy 1.22 GikoSys.FAbon.SetNGResAnchor := AddResAnchorCheckBox.Checked;
1324 h677 1.29 GikoSys.FAbon.DeleteSyria := DeleteSyriaCheckBox.Checked;
1325 h677 1.3 end;
1326 yoffy 1.8 procedure TOptionDialog.CSSFontButtonClick(Sender: TObject);
1327     begin
1328    
1329     FontDialog.Options := [fdAnsiOnly, fdEffects];
1330 yoffy 1.9 FontDialog.Font.Assign(FCSSFont);
1331 yoffy 1.8 if FontDialog.Execute then begin
1332     FontDialog.Font.Style := FontDialog.Font.Style - [fsUnderline] - [fsStrikeout];
1333 h677 1.31 FCSSFont.Assign(FontDialog.Font);
1334     //FCSSFont := FontDialog.Font;
1335 yoffy 1.8 end;
1336    
1337 yoffy 1.22 CSSPreview;
1338 yoffy 1.11
1339 yoffy 1.8 end;
1340    
1341     procedure TOptionDialog.CSSBackColorButtonClick(Sender: TObject);
1342     begin
1343    
1344 yoffy 1.9 ColorDialog.Color := FCSSBackColor;
1345 yoffy 1.8 if ColorDialog.Execute then begin
1346 yoffy 1.22 FCSSBackColor := ColorDialog.Color;
1347 yoffy 1.8 end;
1348    
1349 yoffy 1.22 CSSPreview;
1350 yoffy 1.11
1351 yoffy 1.8 end;
1352    
1353     procedure TOptionDialog.CSSFontCheckBoxClick(Sender: TObject);
1354     begin
1355    
1356     CSSFontButton.Enabled := CSSFontCheckBox.Checked;
1357 yoffy 1.22 CSSPreview;
1358 yoffy 1.8
1359     end;
1360    
1361     procedure TOptionDialog.CSSBackColorCheckBoxClick(Sender: TObject);
1362     begin
1363    
1364     CSSBackColorButton.Enabled := CSSBackColorCheckBox.Checked;
1365 yoffy 1.22 CSSPreview;
1366 yoffy 1.9
1367     end;
1368    
1369     procedure TOptionDialog.CSSSetContent(Content: string);
1370     var
1371     doc : Variant;
1372     begin
1373 h677 1.13 if CSSBrowser.Document <> nil then begin
1374     doc := CSSBrowser.Document;
1375     doc.open;
1376 yoffy 1.22 doc.Clear;
1377 h677 1.13 doc.charset := 'Shift_JIS';
1378     doc.Write(Content);
1379     doc.Close;
1380 yoffy 1.22 end;
1381 yoffy 1.9 end;
1382    
1383     procedure TOptionDialog.CSSPreview;
1384     var
1385 yoffy 1.15 Board: TBoard;
1386 yoffy 1.9 ThreadItem: TThreadItem;
1387     html: string;
1388 yoffy 1.22 Res: array [0..1] of TResRec;
1389     UserOptionalStyle: string;
1390     i: Integer;
1391     fileName: string;
1392 yoffy 1.11 begin
1393    
1394     fileName := GikoSys.Setting.CSSFileName;
1395    
1396     GikoSys.Setting.CSSFileName := 'default.css';
1397     if CSSListView.Items.Count > 0 then begin
1398     try
1399 h677 1.13 if CSSListView.ItemIndex >= 0 then begin
1400     if CSSListView.Items[CSSListView.ItemIndex].Data <> nil then
1401     GikoSys.Setting.CSSFileName := string( CSSListView.Items[CSSListView.ItemIndex].data )
1402     else
1403     GikoSys.Setting.CSSFileName := CSSListView.Items[CSSListView.ItemIndex].Caption + '.css';
1404 yoffy 1.22 end;
1405 yoffy 1.11 except
1406     end;
1407     end;
1408 yoffy 1.10
1409 yoffy 1.25 Board := TBoard.Create( nil, 'about://sample/' );
1410     ThreadItem := TThreadItem.Create( nil, 'about://sample/test/read.cgi/sample/' );
1411 yoffy 1.9
1412 yoffy 1.22 try
1413     Board.Title := '鐃?鐃緒申鐃?鐃緒申鐃緒申';
1414     ThreadItem.ParentBoard := Board;
1415     ThreadItem.AllResCount := High( Res );
1416     ThreadItem.NewResCount := 1;
1417     ThreadItem.NewReceive := 2;
1418     ThreadItem.Title := '鐃?鐃緒申鐃?鐃緒申鐃?鐃緒申鐃?鐃緒申鐃?';
1419    
1420     Res[0].FName := '鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申';
1421     Res[0].FMailTo := 'sage';
1422     Res[0].FDateTime := 'ID:Sample';
1423     Res[0].FBody := 'CSS 鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申';
1424     Res[1].FName := '鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申';
1425     Res[1].FMailTo := 'age';
1426     Res[1].FDateTime := 'ID:Sample';
1427     Res[1].FBody := '鐃?鐃?鐃?鐃緒申鐃?鐃?';
1428    
1429     // 鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申
1430     if CSSFontCheckBox.Checked then begin
1431     i := ColorToRGB( FCSSFont.Color );
1432     i := (i shr 16) or (i and $ff00) or ((i and $ff) shl 16);
1433    
1434     UserOptionalStyle := UserOptionalStyle +
1435     'font-family:"' + FCSSFont.Name + '";' +
1436     'font-size:' + IntToStr( FCSSFont.Size ) + 'pt;' +
1437     'color:#' + IntToHex( i, 6 ) + ';';
1438     if fsBold in FCSSFont.Style then
1439     UserOptionalStyle := UserOptionalStyle + 'font-weight:bold;'
1440     else
1441     UserOptionalStyle := UserOptionalStyle + 'font-weight:normal;';
1442     if fsItalic in FCSSFont.Style then
1443     UserOptionalStyle := UserOptionalStyle + 'font-style:italic;'
1444     else
1445     UserOptionalStyle := UserOptionalStyle + 'font-style:normal;';
1446     end;
1447     if CSSBackColorCheckBox.Checked then begin
1448     i := ColorToRGB( FCSSBackColor );
1449     i := (i shr 16) or (i and $ff00) or ((i and $ff) shl 16);
1450    
1451     UserOptionalStyle := UserOptionalStyle +
1452     'background-color:#' + IntToHex( i, 6 ) + ';';
1453     end;
1454    
1455     if FileExists( GikoSys.GetSkinHeaderFileName ) then begin
1456     html :=
1457     GikoSys.LoadFromSkin( GikoSys.GetSkinHeaderFileName, ThreadItem, 0 ) +
1458     '<a name="top"></a>' +
1459     GikoSys.SkinedRes( GikoSYs.LoadFromSkin( GikoSys.GetSkinResFileName, ThreadItem, 0 ), Res[0], '1' ) +
1460     GikoSys.SkinedRes( GikoSYs.LoadFromSkin( GikoSys.GetSkinNewResFileName, ThreadItem, 0 ), Res[1], '2' ) +
1461     '<a name="bottom"></a>' +
1462     GikoSys.LoadFromSkin( GikoSys.GetSkinFooterFileName, ThreadItem, 0 );
1463    
1464     html := StringReplace( html, '</head>',
1465     '<style type="text/css">body {' + UserOptionalStyle + '}</style></head>', [rfReplaceAll] );
1466     end else begin
1467     html :=
1468     '<html><head>' +
1469     '<meta http-equiv="Content-type" content="text/html; charset=Shift_JIS">' +
1470     '<title>' + ThreadItem.Title + '</title>' +
1471     '<link rel="stylesheet" href="' + GikoSys.GetStyleSheetDir + GikoSys.Setting.CSSFileName + '" type="text/css">' +
1472     '<style type="text/css">body {' + UserOptionalStyle + '}</style>' +
1473     '</head><body>' +
1474     '<div class="title">' + ThreadItem.Title + '</div>';
1475    
1476     for i := 0 to High( Res ) do
1477     begin
1478     html := html +
1479     '<div class="header"><span class="no">' + IntToStr( i + 1 ) + '</span>' +
1480     '<span class="name_label"> 鐃緒申鐃?鐃? </span>' +
1481     '<a class="name_mail" href="mailto:' + Res[i].FMailTo + '">' +
1482     '<b>' + Res[i].FName + '</b></a><span class="mail"> [' + Res[i].FMailTo + ']</span>' +
1483     '<span class="date_label"> 鐃緒申鐃?鐃緒申鐃?</span>' +
1484     '<span class="date"> ' + Res[i].FDateTime+ '</span></div>' +
1485     '<div class="mes">' + Res[i].FBody + ' </div>';
1486     end;
1487    
1488     html := html + '</body></html>';
1489     end;
1490    
1491     try
1492     CSSSetContent( html );
1493     except
1494     end;
1495    
1496     finally
1497     ThreadItem.Free;
1498     Board.Free;
1499     GikoSys.Setting.CSSFileName := fileName;
1500     end;
1501 yoffy 1.11
1502     end;
1503    
1504     procedure TOptionDialog.CSSListViewChange(Sender: TObject; Item: TListItem;
1505 yoffy 1.22 Change: TItemChange);
1506 yoffy 1.11 begin
1507    
1508 yoffy 1.14 if OptionTab.ActivePage = CSSTabSheet then
1509     CSSPreview;
1510 yoffy 1.11
1511 h677 1.19 end;
1512    
1513     procedure TOptionDialog.AddURLButtonClick(Sender: TObject);
1514     begin
1515     BoardURLComboBox.Items.Append(BoardURLComboBox.Text);
1516 yoffy 1.22 BoardURLComboBox.ItemIndex := BoardURLComboBox.Items.Count - 1;
1517 h677 1.19 end;
1518    
1519     procedure TOptionDialog.RemoveURLButtonClick(Sender: TObject);
1520     begin
1521     BoardURLComboBox.DeleteSelected;
1522 h677 1.23 end;
1523    
1524     procedure TOptionDialog.OddResNumCheckBoxClick(Sender: TObject);
1525     begin
1526     OddResNumColorBox.Enabled := OddResNumCheckBox.Checked;
1527 yoffy 1.8 end;
1528    
1529 yoffy 1.49 procedure TOptionDialog.ResRangeHoldCheckBoxClick(Sender: TObject);
1530     begin
1531     ResRangeHoldComboBox.Enabled := ResRangeHoldCheckBox.Checked;
1532     end;
1533    
1534 genyakun 1.58 procedure TOptionDialog.CroutOptionClick(Sender: TObject);
1535 h677 1.59 var
1536     KuroutOption: TKuroutOption;
1537 genyakun 1.58 begin
1538 h677 1.60 KuroutOption := TKuroutOption.Create(Self);
1539 h677 1.59 try
1540 h677 1.60 KuroutOption.ShowModal;
1541 h677 1.59 finally
1542 h677 1.60 KuroutOption.Release;
1543 h677 1.59 end;
1544 genyakun 1.58 end;
1545    
1546 hi_ 1.1 end.
1547    

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26