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.39 - (hide annotations) (download) (as text)
Sat Jun 5 14:34:11 2004 UTC (19 years, 10 months ago) by yoffy
Branch: MAIN
Changes since 1.38: +4 -1 lines
File MIME type: text/x-pascal
「&」を & に置換するようになった。

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

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