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.64 - (hide annotations) (download) (as text)
Sun Sep 26 14:39:49 2004 UTC (19 years, 6 months ago) by genyakun
Branch: MAIN
Changes since 1.63: +0 -1 lines
File MIME type: text/x-pascal
2ch言語サポート機能の実装(中途半端)

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

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