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.21 - (hide annotations) (download) (as text)
Thu Oct 9 10:59:07 2003 UTC (20 years, 6 months ago) by h677
Branch: MAIN
CVS Tags: b43
Branch point for: stable
Changes since 1.20: +6 -0 lines
File MIME type: text/x-pascal
ギコナビを終了するときに確認ダイアログを出すオプションを追加

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

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