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.46 - (hide annotations) (download) (as text)
Tue Jul 13 14:05:21 2004 UTC (19 years, 9 months ago) by genyakun
Branch: MAIN
Changes since 1.45: +8 -4 lines
File MIME type: text/x-pascal
Tab自動保存・復元ルーチン追加(復元機能は未完全)

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

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