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.44 - (hide annotations) (download) (as text)
Mon Jul 12 08:03:20 2004 UTC (19 years, 9 months ago) by genyakun
Branch: MAIN
Changes since 1.43: +2 -2 lines
File MIME type: text/x-pascal
FormCreateの部分でAccessVoが出る問題を修正

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

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