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

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