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.41 - (hide annotations) (download) (as text)
Sat Jun 19 13:37:23 2004 UTC (19 years, 10 months ago) by h677
Branch: MAIN
CVS Tags: v1_48_0_510
Changes since 1.40: +13 -3 lines
File MIME type: text/x-pascal
ブラウザタブ非表示の時のスレ一覧選択のTimerの秒数の設定項目追加

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

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