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.13 - (hide annotations) (download) (as text)
Fri Sep 26 17:30:31 2003 UTC (20 years, 6 months ago) by h677
Branch: MAIN
Changes since 1.12: +16 -11 lines
File MIME type: text/x-pascal
ホ羌ー、ャスミ、ハ、、、隍ヲ、ヒス、タオ

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

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