Develop and Download Open Source Software

Browse CVS Repository

Annotation of /gikonavigoeson/gikonavi/KuroutSetting.pas

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.5 - (hide annotations) (download) (as text)
Sun Oct 17 16:09:42 2004 UTC (19 years, 6 months ago) by genyakun
Branch: MAIN
CVS Tags: v1_50_0_561
Changes since 1.4: +14 -2 lines
File MIME type: text/x-pascal
ローカル・リモートフシアナ警告オプションを追加

1 genyakun 1.1 unit KuroutSetting;
2    
3     interface
4    
5     uses
6     Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
7     Dialogs, StdCtrls, ComCtrls, GikoSystem, GikoUtil;
8    
9     type
10     TKuroutOption = class(TForm)
11 h677 1.3 PageControl1: TPageControl;
12     TabSheet1: TTabSheet;
13     GroupBox11: TGroupBox;
14     Label17: TLabel;
15     Label18: TLabel;
16     RecvBufferSize: TEdit;
17     ProxyProtocolCheckBox: TCheckBox;
18     ProtocolCheckBox: TCheckBox;
19     GroupBox13: TGroupBox;
20     Label24: TLabel;
21     Label25: TLabel;
22     PostTimeLabel: TLabel;
23     Label27: TLabel;
24     PostTimeCheckBox: TCheckBox;
25     PostTimeEdit: TEdit;
26     PutPostTimeRadioButton: TRadioButton;
27     BackPostTimeRadioButton: TRadioButton;
28     OkBotton: TButton;
29     CancelBotton: TButton;
30     ApplyButton: TButton;
31     ColumnTabSheet: TTabSheet;
32     CategoryColumnGroupBox: TGroupBox;
33     CUnVisibledListBox: TListBox;
34     CVisibledListBox: TListBox;
35     CAddButton: TButton;
36     CDeleteButton: TButton;
37     BoardColumnGroupBox: TGroupBox;
38     BUnVisibledListBox: TListBox;
39     BVisibledListBox: TListBox;
40     BAddButton: TButton;
41     BDeleteButton: TButton;
42     Label1: TLabel;
43     Label2: TLabel;
44     Label3: TLabel;
45     Label4: TLabel;
46     CUpButton: TButton;
47     CDownButton: TButton;
48     BUpButton: TButton;
49     BDownButton: TButton;
50 genyakun 1.4 GroupBox1: TGroupBox;
51     GengoSupport: TCheckBox;
52     Label5: TLabel;
53 genyakun 1.5 GroupBox2: TGroupBox;
54     LocalTrapAtt: TCheckBox;
55     RemoteTrapAtt: TCheckBox;
56 h677 1.3 procedure OkBottonClick(Sender: TObject);
57     procedure FormCreate(Sender: TObject);
58     procedure CDeleteButtonClick(Sender: TObject);
59     procedure CAddButtonClick(Sender: TObject);
60     procedure BAddButtonClick(Sender: TObject);
61     procedure BDeleteButtonClick(Sender: TObject);
62     procedure CUpButtonClick(Sender: TObject);
63     procedure CDownButtonClick(Sender: TObject);
64     procedure BUpButtonClick(Sender: TObject);
65     procedure BDownButtonClick(Sender: TObject);
66 genyakun 1.1 private
67 h677 1.3 { Private 鐃緒申鐃緒申 }
68 h677 1.2 procedure SetValue;
69     procedure SaveSetting;
70     procedure RecvBufferSizeExit(Sender: TObject);
71     procedure PostTimeEditExit(Sender: TObject);
72     procedure PostTimeCheckBoxClick(Sender: TObject);
73 h677 1.3 procedure SetColumnData();
74     procedure PostColumnData();
75 genyakun 1.1 public
76 h677 1.2 { Public 鐃緒申鐃緒申 }
77 genyakun 1.1 end;
78    
79     var
80     KuroutOption: TKuroutOption;
81    
82     implementation
83    
84 h677 1.3 uses
85     Giko, Setting;
86    
87 genyakun 1.1 {$R *.dfm}
88    
89     procedure TKuroutOption.SetValue;
90     begin
91     //鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃?
92     RecvBufferSize.Text := IntToStr(Gikosys.Setting.RecvBufferSize);
93     //HTTP1.1鐃?鐃?
94     ProtocolCheckBox.Checked := GikoSys.Setting.Protocol;
95     //鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申HTTP1.1鐃?鐃?
96     ProxyProtocolCheckBox.Checked := Gikosys.Setting.ProxyProtocol;
97    
98 h677 1.2 //鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申
99 genyakun 1.1 PostTimeCheckBox.Checked := GikoSys.Setting.UseMachineTime;
100     PostTimeEdit.Text := IntToStr(GikoSys.Setting.TimeAdjustSec);
101     if GikoSys.Setting.TimeAdjust then
102     PutPostTimeRadioButton.Checked := True
103     else
104     BackPostTimeRadioButton.Checked := True;
105 h677 1.3
106     SetColumnData();
107    
108     PageControl1.ActivePageIndex := GikoSys.Setting.KuroutSettingTabIndex;
109 genyakun 1.5
110     //2chAnnai
111     GengoSupport.Checked := GikoSys.Setting.GengoSupport;
112     //FusianaSet
113     LocalTrapAtt.Checked := GikoSys.Setting.LocalTrapAtt;
114     RemoteTrapAtt.Checked := GikoSys.Setting.RemoteTrapAtt;
115 genyakun 1.1 end;
116    
117     procedure TKuroutOption.SaveSetting;
118     begin
119     //鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃?
120     Gikosys.Setting.RecvBufferSize := StrToInt(RecvBufferSize.Text);
121     //HTTP1.1鐃?鐃?
122     GikoSys.Setting.Protocol := ProtocolCheckBox.Checked;
123     //鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申HTTP1.1鐃?鐃?
124     Gikosys.Setting.ProxyProtocol := ProxyProtocolCheckBox.Checked;
125     //鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申
126     GikoSys.Setting.UseMachineTime := PostTimeCheckBox.Checked;
127     if GikoSys.IsNumeric(PostTimeEdit.Text) then
128     GikoSys.Setting.TimeAdjustSec := StrToInt(PostTimeEdit.Text)
129     else
130     GikoSys.Setting.TimeAdjustSec := 0;
131     GikoSys.Setting.TimeAdjust := PutPostTimeRadioButton.Checked;
132 genyakun 1.5 //2ch鐃緒申鐃緒申鐃?鐃?鐃?鐃?
133 genyakun 1.4 GikoSys.Setting.GengoSupport := GengoSupport.Checked;
134 genyakun 1.5 //鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃緒申
135     GikoSys.Setting.LocalTrapAtt := LocalTrapAtt.Checked;
136     GikoSys.Setting.RemoteTrapAtt := RemoteTrapAtt.Checked;
137 genyakun 1.4
138 h677 1.3 GikoSys.Setting.KuroutSettingTabIndex := PageControl1.ActivePageIndex;
139 genyakun 1.1 end;
140    
141     procedure TKuroutOption.RecvBufferSizeExit(Sender: TObject);
142     begin
143     if not GikoSys.IsNumeric(RecvBufferSize.Text) then
144     RecvBufferSize.Text := '4096';
145     if StrToInt(RecvBufferSize.Text) < 256 then
146     RecvBufferSize.Text := '4096';
147     end;
148    
149     procedure TKuroutOption.PostTimeEditExit(Sender: TObject);
150     begin
151     if not GikoSys.IsNumeric(PostTimeEdit.Text) then
152     PostTimeEdit.Text := '0';
153     end;
154    
155     procedure TKuroutOption.PostTimeCheckBoxClick(Sender: TObject);
156     begin
157     PostTimeLabel.Enabled := PostTimeCheckBox.Checked;
158     PostTimeEdit.Enabled := PostTimeCheckBox.Checked;
159     PutPostTimeRadioButton.Enabled := PostTimeCheckBox.Checked;
160     BackPostTimeRadioButton.Enabled := PostTimeCheckBox.Checked;
161     end;
162    
163     procedure TKuroutOption.OkBottonClick(Sender: TObject);
164     begin
165     RecvBufferSizeExit(Sender);
166 h677 1.2 PostTimeEditExit(Sender);
167 genyakun 1.5 PostColumnData();
168 h677 1.2 SaveSetting;
169 genyakun 1.1 end;
170    
171 h677 1.2 procedure TKuroutOption.FormCreate(Sender: TObject);
172 genyakun 1.1 begin
173 h677 1.2 SetValue;
174     PostTimeCheckBoxClick(Sender);
175 genyakun 1.1
176     end;
177 h677 1.3 procedure TKuroutOption.SetColumnData();
178     var
179     i, j : Integer;
180     flag : Boolean;
181     begin
182    
183     //===== 鐃緒申鐃緒申鐃?鐃? =====
184     for i := 0 to GikoSys.Setting.CategoryColumnOrder.Count - 1 do begin
185     for j := 1 to Length( GikoCategoryColumnCaption ) - 1 do begin
186     if GikoSys.Setting.CategoryColumnOrder[ i ] = TGikoCategoryColumnID( j ) then begin
187     CVisibledListBox.AddItem(GikoCategoryColumnCaption[ j ], nil);
188     break;
189     end;
190     end;
191     end;
192    
193     for i := 1 to Length( GikoCategoryColumnCaption ) - 1 do begin
194     flag := false;
195     for j := 0 to GikoSys.Setting.CategoryColumnOrder.Count - 1 do begin
196     if GikoSys.Setting.CategoryColumnOrder[ j ] = TGikoCategoryColumnID( i ) then begin
197     flag := true;
198     break;
199     end;
200     end;
201     if not flag then
202     CUnVisibledListBox.AddItem(GikoCategoryColumnCaption[ i ], nil);
203     end;
204    
205     //===== 鐃?鐃緒申鐃緒申鐃?鐃? =====
206     for i := 0 to GikoSys.Setting.BoardColumnOrder.Count - 1 do begin
207     for j := 1 to Length( GikoBoardColumnCaption ) - 1 do begin
208     if GikoSys.Setting.BoardColumnOrder[ i ] = TGikoBoardColumnID( j ) then begin
209     BVisibledListBox.AddItem(GikoBoardColumnCaption[ j ], nil);
210     Break;
211     end;
212     end;
213     end;
214    
215     for i := 1 to Length( GikoBoardColumnCaption ) - 1 do begin
216     flag := false;
217     for j := GikoSys.Setting.BoardColumnOrder.Count - 1 downto 0 do begin
218     if GikoSys.Setting.BoardColumnOrder[ j ] = TGikoBoardColumnID( i ) then begin
219     flag := true;
220     Break;
221     end;
222     end;
223     if not flag then
224     BUnVisibledListBox.AddItem(GikoBoardColumnCaption[ i ], nil);
225    
226     end;
227     end;
228     procedure TKuroutOption.CDeleteButtonClick(Sender: TObject);
229     var
230     i: Integer;
231     begin
232     for i := 0 to CVisibledListBox.Count - 1 do begin
233     if CVisibledListBox.Selected[i] then begin
234     CUnVisibledListBox.AddItem( CVisibledListBox.Items.Strings[ i ], nil);
235     CVisibledListBox.DeleteSelected;
236     break;
237     end;
238     end;
239     end;
240    
241     procedure TKuroutOption.CAddButtonClick(Sender: TObject);
242     var
243     i: Integer;
244     begin
245     for i := 0 to CUnVisibledListBox.Count - 1 do begin
246     if CUnVisibledListBox.Selected[i] then begin
247     CVisibledListBox.AddItem( CUnVisibledListBox.Items.Strings[ i ], nil);
248     CUnVisibledListBox.DeleteSelected;
249     break;
250     end;
251     end;
252     end;
253    
254     procedure TKuroutOption.BAddButtonClick(Sender: TObject);
255     var
256     i: Integer;
257     begin
258     for i := 0 to BUnVisibledListBox.Count - 1 do begin
259     if BUnVisibledListBox.Selected[i] then begin
260     BVisibledListBox.AddItem( BUnVisibledListBox.Items.Strings[ i ], nil);
261     BUnVisibledListBox.DeleteSelected;
262     break;
263     end;
264     end;
265     end;
266    
267     procedure TKuroutOption.BDeleteButtonClick(Sender: TObject);
268     var
269     i: Integer;
270     begin
271     for i := 0 to BVisibledListBox.Count - 1 do begin
272     if BVisibledListBox.Selected[i] then begin
273     BUnVisibledListBox.AddItem( BVisibledListBox.Items.Strings[ i ], nil);
274     BVisibledListBox.DeleteSelected;
275     break;
276     end;
277     end;
278     end;
279    
280     procedure TKuroutOption.CUpButtonClick(Sender: TObject);
281     var
282     i: Integer;
283     begin
284     for i := 1 to CVisibledListBox.Count - 1 do begin
285     if CVisibledListBox.Selected[i] then begin
286     CVisibledListBox.Items.Exchange(i, i -1);
287     break;
288     end;
289     end;
290     end;
291    
292     procedure TKuroutOption.CDownButtonClick(Sender: TObject);
293     var
294     i: Integer;
295     begin
296     for i := 0 to CVisibledListBox.Count - 2 do begin
297     if CVisibledListBox.Selected[i] then begin
298     CVisibledListBox.Items.Exchange(i, i + 1);
299     break;
300     end;
301     end;
302     end;
303    
304     procedure TKuroutOption.BUpButtonClick(Sender: TObject);
305     var
306     i: Integer;
307     begin
308     for i := 1 to BVisibledListBox.Count - 1 do begin
309     if BVisibledListBox.Selected[i] then begin
310     BVisibledListBox.Items.Exchange(i, i -1);
311     break;
312     end;
313     end;
314     end;
315    
316     procedure TKuroutOption.BDownButtonClick(Sender: TObject);
317     var
318     i: Integer;
319     begin
320     for i := 0 to BVisibledListBox.Count - 2 do begin
321     if BVisibledListBox.Selected[i] then begin
322     BVisibledListBox.Items.Exchange(i, i + 1);
323     break;
324     end;
325     end;
326     end;
327    
328    
329     procedure TKuroutOption.PostColumnData();
330     var
331     i, j : Integer;
332     begin
333     GikoForm.ActiveListColumnSave;
334    
335     //===== 鐃緒申鐃緒申鐃?鐃? =====
336     for i := GikoSys.Setting.CategoryColumnOrder.Count -1 downto 1 do
337     GikoSys.Setting.CategoryColumnOrder.Delete(i);
338    
339     for i := 0 to CVisibledListBox.Count - 1 do begin
340     for j := 1 to Length( GikoCategoryColumnCaption ) - 1 do begin
341     if CVisibledListBox.Items.Strings[ i ] = GikoCategoryColumnCaption[ j ] then begin
342     GikoSys.Setting.CategoryColumnOrder.Add( TGikoCategoryColumnID(j) );
343     break;
344     end;
345     end;
346     end;
347    
348     //===== 鐃?鐃緒申鐃緒申鐃?鐃? =====
349     for i := GikoSys.Setting.BoardColumnOrder.Count - 1 downto 1 do
350     GikoSys.Setting.BoardColumnOrder.Delete(i);
351    
352     for i := 0 to BVisibledListBox.Count - 1 do begin
353     for j := 1 to Length( GikoBoardColumnCaption ) - 1 do begin
354     if BVisibledListBox.Items.Strings[ i ] = GikoBoardColumnCaption[ j ] then begin
355     GikoSys.Setting.BoardColumnOrder.Add( TGikoBoardColumnID(j) );
356     Break;
357     end;
358     end;
359     end;
360     //鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃?鐃?
361     GikoForm.SetActiveList(GikoForm.ActiveList);
362     end;
363 genyakun 1.1
364     end.

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