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

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