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.35 - (hide annotations) (download) (as text)
Thu Jun 3 11:54:51 2004 UTC (19 years, 10 months ago) by yoffy
Branch: MAIN
Changes since 1.34: +10 -0 lines
File MIME type: text/x-pascal
スレッド一覧からスレをクリックした際にブラウザを最大化するかどうかの設定を追加。

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

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