Develop and Download Open Source Software

Browse CVS Repository

Contents of /gikonavigoeson/gikonavi/KuroutSetting.pas

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


Revision 1.3 - (show annotations) (download) (as text)
Wed Sep 15 14:52:00 2004 UTC (19 years, 7 months ago) by h677
Branch: MAIN
CVS Tags: v1_49_0_545, v1_49_0_544
Changes since 1.2: +248 -23 lines
File MIME type: text/x-pascal
詳細設定オプションフォームでカラムの表示・非表示・順番を設定できるようにした。

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 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 procedure OkBottonClick(Sender: TObject);
51 procedure FormCreate(Sender: TObject);
52 procedure CDeleteButtonClick(Sender: TObject);
53 procedure CAddButtonClick(Sender: TObject);
54 procedure BAddButtonClick(Sender: TObject);
55 procedure BDeleteButtonClick(Sender: TObject);
56 procedure CUpButtonClick(Sender: TObject);
57 procedure CDownButtonClick(Sender: TObject);
58 procedure BUpButtonClick(Sender: TObject);
59 procedure BDownButtonClick(Sender: TObject);
60 private
61 { Private 鐃緒申鐃緒申 }
62 procedure SetValue;
63 procedure SaveSetting;
64 procedure RecvBufferSizeExit(Sender: TObject);
65 procedure PostTimeEditExit(Sender: TObject);
66 procedure PostTimeCheckBoxClick(Sender: TObject);
67 procedure SetColumnData();
68 procedure PostColumnData();
69 public
70 { Public 鐃緒申鐃緒申 }
71 end;
72
73 var
74 KuroutOption: TKuroutOption;
75
76 implementation
77
78 uses
79 Giko, Setting;
80
81 {$R *.dfm}
82
83 procedure TKuroutOption.SetValue;
84 begin
85 //鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃?
86 RecvBufferSize.Text := IntToStr(Gikosys.Setting.RecvBufferSize);
87 //HTTP1.1鐃?鐃?
88 ProtocolCheckBox.Checked := GikoSys.Setting.Protocol;
89 //鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申HTTP1.1鐃?鐃?
90 ProxyProtocolCheckBox.Checked := Gikosys.Setting.ProxyProtocol;
91
92 //鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申
93 PostTimeCheckBox.Checked := GikoSys.Setting.UseMachineTime;
94 PostTimeEdit.Text := IntToStr(GikoSys.Setting.TimeAdjustSec);
95 if GikoSys.Setting.TimeAdjust then
96 PutPostTimeRadioButton.Checked := True
97 else
98 BackPostTimeRadioButton.Checked := True;
99
100 SetColumnData();
101
102 PageControl1.ActivePageIndex := GikoSys.Setting.KuroutSettingTabIndex;
103 end;
104
105 procedure TKuroutOption.SaveSetting;
106 begin
107 //鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃?
108 Gikosys.Setting.RecvBufferSize := StrToInt(RecvBufferSize.Text);
109 //HTTP1.1鐃?鐃?
110 GikoSys.Setting.Protocol := ProtocolCheckBox.Checked;
111 //鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申HTTP1.1鐃?鐃?
112 Gikosys.Setting.ProxyProtocol := ProxyProtocolCheckBox.Checked;
113 //鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申
114 GikoSys.Setting.UseMachineTime := PostTimeCheckBox.Checked;
115 if GikoSys.IsNumeric(PostTimeEdit.Text) then
116 GikoSys.Setting.TimeAdjustSec := StrToInt(PostTimeEdit.Text)
117 else
118 GikoSys.Setting.TimeAdjustSec := 0;
119 GikoSys.Setting.TimeAdjust := PutPostTimeRadioButton.Checked;
120
121 GikoSys.Setting.KuroutSettingTabIndex := PageControl1.ActivePageIndex;
122 end;
123
124 procedure TKuroutOption.RecvBufferSizeExit(Sender: TObject);
125 begin
126 if not GikoSys.IsNumeric(RecvBufferSize.Text) then
127 RecvBufferSize.Text := '4096';
128 if StrToInt(RecvBufferSize.Text) < 256 then
129 RecvBufferSize.Text := '4096';
130 end;
131
132 procedure TKuroutOption.PostTimeEditExit(Sender: TObject);
133 begin
134 if not GikoSys.IsNumeric(PostTimeEdit.Text) then
135 PostTimeEdit.Text := '0';
136 end;
137
138 procedure TKuroutOption.PostTimeCheckBoxClick(Sender: TObject);
139 begin
140 PostTimeLabel.Enabled := PostTimeCheckBox.Checked;
141 PostTimeEdit.Enabled := PostTimeCheckBox.Checked;
142 PutPostTimeRadioButton.Enabled := PostTimeCheckBox.Checked;
143 BackPostTimeRadioButton.Enabled := PostTimeCheckBox.Checked;
144 end;
145
146 procedure TKuroutOption.OkBottonClick(Sender: TObject);
147 begin
148 RecvBufferSizeExit(Sender);
149 PostTimeEditExit(Sender);
150 PostColumnData();
151 SaveSetting;
152 end;
153
154 procedure TKuroutOption.FormCreate(Sender: TObject);
155 begin
156 SetValue;
157 PostTimeCheckBoxClick(Sender);
158
159 end;
160 procedure TKuroutOption.SetColumnData();
161 var
162 i, j : Integer;
163 flag : Boolean;
164 begin
165
166 //===== 鐃緒申鐃緒申鐃?鐃? =====
167 for i := 0 to GikoSys.Setting.CategoryColumnOrder.Count - 1 do begin
168 for j := 1 to Length( GikoCategoryColumnCaption ) - 1 do begin
169 if GikoSys.Setting.CategoryColumnOrder[ i ] = TGikoCategoryColumnID( j ) then begin
170 CVisibledListBox.AddItem(GikoCategoryColumnCaption[ j ], nil);
171 break;
172 end;
173 end;
174 end;
175
176 for i := 1 to Length( GikoCategoryColumnCaption ) - 1 do begin
177 flag := false;
178 for j := 0 to GikoSys.Setting.CategoryColumnOrder.Count - 1 do begin
179 if GikoSys.Setting.CategoryColumnOrder[ j ] = TGikoCategoryColumnID( i ) then begin
180 flag := true;
181 break;
182 end;
183 end;
184 if not flag then
185 CUnVisibledListBox.AddItem(GikoCategoryColumnCaption[ i ], nil);
186 end;
187
188 //===== 鐃?鐃緒申鐃緒申鐃?鐃? =====
189 for i := 0 to GikoSys.Setting.BoardColumnOrder.Count - 1 do begin
190 for j := 1 to Length( GikoBoardColumnCaption ) - 1 do begin
191 if GikoSys.Setting.BoardColumnOrder[ i ] = TGikoBoardColumnID( j ) then begin
192 BVisibledListBox.AddItem(GikoBoardColumnCaption[ j ], nil);
193 Break;
194 end;
195 end;
196 end;
197
198 for i := 1 to Length( GikoBoardColumnCaption ) - 1 do begin
199 flag := false;
200 for j := GikoSys.Setting.BoardColumnOrder.Count - 1 downto 0 do begin
201 if GikoSys.Setting.BoardColumnOrder[ j ] = TGikoBoardColumnID( i ) then begin
202 flag := true;
203 Break;
204 end;
205 end;
206 if not flag then
207 BUnVisibledListBox.AddItem(GikoBoardColumnCaption[ i ], nil);
208
209 end;
210 end;
211 procedure TKuroutOption.CDeleteButtonClick(Sender: TObject);
212 var
213 i: Integer;
214 begin
215 for i := 0 to CVisibledListBox.Count - 1 do begin
216 if CVisibledListBox.Selected[i] then begin
217 CUnVisibledListBox.AddItem( CVisibledListBox.Items.Strings[ i ], nil);
218 CVisibledListBox.DeleteSelected;
219 break;
220 end;
221 end;
222 end;
223
224 procedure TKuroutOption.CAddButtonClick(Sender: TObject);
225 var
226 i: Integer;
227 begin
228 for i := 0 to CUnVisibledListBox.Count - 1 do begin
229 if CUnVisibledListBox.Selected[i] then begin
230 CVisibledListBox.AddItem( CUnVisibledListBox.Items.Strings[ i ], nil);
231 CUnVisibledListBox.DeleteSelected;
232 break;
233 end;
234 end;
235 end;
236
237 procedure TKuroutOption.BAddButtonClick(Sender: TObject);
238 var
239 i: Integer;
240 begin
241 for i := 0 to BUnVisibledListBox.Count - 1 do begin
242 if BUnVisibledListBox.Selected[i] then begin
243 BVisibledListBox.AddItem( BUnVisibledListBox.Items.Strings[ i ], nil);
244 BUnVisibledListBox.DeleteSelected;
245 break;
246 end;
247 end;
248 end;
249
250 procedure TKuroutOption.BDeleteButtonClick(Sender: TObject);
251 var
252 i: Integer;
253 begin
254 for i := 0 to BVisibledListBox.Count - 1 do begin
255 if BVisibledListBox.Selected[i] then begin
256 BUnVisibledListBox.AddItem( BVisibledListBox.Items.Strings[ i ], nil);
257 BVisibledListBox.DeleteSelected;
258 break;
259 end;
260 end;
261 end;
262
263 procedure TKuroutOption.CUpButtonClick(Sender: TObject);
264 var
265 i: Integer;
266 begin
267 for i := 1 to CVisibledListBox.Count - 1 do begin
268 if CVisibledListBox.Selected[i] then begin
269 CVisibledListBox.Items.Exchange(i, i -1);
270 break;
271 end;
272 end;
273 end;
274
275 procedure TKuroutOption.CDownButtonClick(Sender: TObject);
276 var
277 i: Integer;
278 begin
279 for i := 0 to CVisibledListBox.Count - 2 do begin
280 if CVisibledListBox.Selected[i] then begin
281 CVisibledListBox.Items.Exchange(i, i + 1);
282 break;
283 end;
284 end;
285 end;
286
287 procedure TKuroutOption.BUpButtonClick(Sender: TObject);
288 var
289 i: Integer;
290 begin
291 for i := 1 to BVisibledListBox.Count - 1 do begin
292 if BVisibledListBox.Selected[i] then begin
293 BVisibledListBox.Items.Exchange(i, i -1);
294 break;
295 end;
296 end;
297 end;
298
299 procedure TKuroutOption.BDownButtonClick(Sender: TObject);
300 var
301 i: Integer;
302 begin
303 for i := 0 to BVisibledListBox.Count - 2 do begin
304 if BVisibledListBox.Selected[i] then begin
305 BVisibledListBox.Items.Exchange(i, i + 1);
306 break;
307 end;
308 end;
309 end;
310
311
312 procedure TKuroutOption.PostColumnData();
313 var
314 i, j : Integer;
315 begin
316 GikoForm.ActiveListColumnSave;
317
318 //===== 鐃緒申鐃緒申鐃?鐃? =====
319 for i := GikoSys.Setting.CategoryColumnOrder.Count -1 downto 1 do
320 GikoSys.Setting.CategoryColumnOrder.Delete(i);
321
322 for i := 0 to CVisibledListBox.Count - 1 do begin
323 for j := 1 to Length( GikoCategoryColumnCaption ) - 1 do begin
324 if CVisibledListBox.Items.Strings[ i ] = GikoCategoryColumnCaption[ j ] then begin
325 GikoSys.Setting.CategoryColumnOrder.Add( TGikoCategoryColumnID(j) );
326 break;
327 end;
328 end;
329 end;
330
331 //===== 鐃?鐃緒申鐃緒申鐃?鐃? =====
332 for i := GikoSys.Setting.BoardColumnOrder.Count - 1 downto 1 do
333 GikoSys.Setting.BoardColumnOrder.Delete(i);
334
335 for i := 0 to BVisibledListBox.Count - 1 do begin
336 for j := 1 to Length( GikoBoardColumnCaption ) - 1 do begin
337 if BVisibledListBox.Items.Strings[ i ] = GikoBoardColumnCaption[ j ] then begin
338 GikoSys.Setting.BoardColumnOrder.Add( TGikoBoardColumnID(j) );
339 Break;
340 end;
341 end;
342 end;
343 //鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃?鐃?
344 GikoForm.SetActiveList(GikoForm.ActiveList);
345 end;
346
347 end.

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