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.12 - (hide annotations) (download) (as text)
Fri Sep 26 10:57:00 2003 UTC (20 years, 6 months ago) by yoffy
Branch: MAIN
CVS Tags: b41
Changes since 1.11: +3 -1 lines
File MIME type: text/x-pascal
・スキンのプレビューが一部 javascript エラーを出すので修正。
・CSS のプレビューでレス番号が全て 1 になってがので修正。

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

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