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.49 - (hide annotations) (download) (as text)
Wed Aug 4 03:36:53 2004 UTC (19 years, 8 months ago) by yoffy
Branch: MAIN
Changes since 1.48: +26 -7 lines
File MIME type: text/x-pascal
起動時に最新100レスのみ表示に設定するオプションが、
他の表示範囲も選べるようになった。

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

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