Some changes in fileserver test that i do not want to loose.
[brdnet.git] / gui / Forms1.pas
blobb716fd2c4569df018ce597b36ccac100f9ed1511
1 unit Forms1;
3 {$mode objfpc}{$H+}
5 interface
7 uses
8 SysUtils, Classes, fpg_base, fpg_main,
9 fpg_form, fpg_button, fpg_tab, fpg_edit,
10 fpg_label, fpg_checkbox,fpg_gauge, fpg_panel,fpg_dialogs;
11 type
13 TFormTestFS = class(TfpgForm)
14 private
15 {@VFD_HEAD_BEGIN: FormTestFS}
16 GroupBox1: TfpgGroupBox;
17 EditFID: TfpgEdit;
18 ButtonDelete: TfpgButton;
19 ButtonLookup: TfpgButton;
20 EditSRC: TfpgEdit;
21 CheckStart: TfpgCheckBox;
22 Label1: TfpgLabel;
23 Label2: TfpgLabel;
24 GroupBox2: TfpgGroupBox;
25 LabelTotal: TfpgLabel;
26 LabelRate: TfpgLabel;
27 LabelMiss: TfpgLabel;
28 GaugeProgress: TfpgGauge;
29 Label3: TfpgLabel;
30 Label4: TfpgLabel;
31 Label5: TfpgLabel;
32 {@VFD_HEAD_END: FormTestFS}
33 public
34 procedure AfterCreate; override;
35 end;
37 TFormRoot = class(TfpgForm)
38 private
39 {@VFD_HEAD_BEGIN: FormRoot}
40 Label2: TfpgLabel;
41 ConnStatus: TfpgLabel;
42 PageControl1: TfpgPageControl;
43 TabSheetInfo: TfpgTabSheet;
44 Label1: TfpgLabel;
45 TabSheetDebug: TfpgTabSheet;
46 ButtonTestFS: TfpgButton;
47 TabSheetConn: TfpgTabSheet;
48 {@VFD_HEAD_END: FormRoot}
49 FormTestFS: tFormTestFS;
50 procedure ClickDebugDownload(Sender: TObject);
51 procedure evClose(Sender: TObject;var CloseAction: TCloseAction);
52 public
53 procedure AfterCreate; override;
54 end;
56 {@VFD_NEWFORM_DECL}
58 implementation
60 {@VFD_NEWFORM_IMPL}
62 procedure TFormTestFS.AfterCreate;
63 begin
64 {%region 'Auto-generated GUI code' -fold}
65 {@VFD_BODY_BEGIN: FormTestFS}
66 Name := 'FormTestFS';
67 SetPosition(762, 190, 350, 329);
68 WindowTitle := 'BrodNet - TestFS';
69 Hint := '';
70 IconName := '';
72 GroupBox1 := TfpgGroupBox.Create(self);
73 with GroupBox1 do
74 begin
75 Name := 'GroupBox1';
76 SetPosition(0, 2, 350, 160);
77 Anchors := [anLeft,anRight,anTop];
78 Alignment := taCenter;
79 FontDesc := '#Label1';
80 Hint := '';
81 Text := 'FileServer Test Parameters';
82 end;
84 EditFID := TfpgEdit.Create(GroupBox1);
85 with EditFID do
86 begin
87 Name := 'EditFID';
88 SetPosition(10, 32, 330, 24);
89 ExtraHint := '';
90 FontDesc := 'FreeMono-10:bold:antialias=true';
91 Hint := '';
92 ParentShowHint := False;
93 ShowHint := True;
94 TabOrder := 1;
95 Text := '9cb70c44932a00dbe74ca392b3694329fa894768';
96 end;
98 ButtonDelete := TfpgButton.Create(GroupBox1);
99 with ButtonDelete do
100 begin
101 Name := 'ButtonDelete';
102 SetPosition(100, 59, 52, 23);
103 Text := 'Delete';
104 FontDesc := '#Label1';
105 Hint := 'Delete local file, so it can be downloaded again.';
106 ImageName := '';
107 ParentShowHint := False;
108 ShowHint := True;
109 TabOrder := 2;
110 end;
112 ButtonLookup := TfpgButton.Create(GroupBox1);
113 with ButtonLookup do
114 begin
115 Name := 'ButtonLookup';
116 SetPosition(12, 59, 80, 23);
117 Text := 'Lookup';
118 Enabled := False;
119 FontDesc := '#Label1';
120 Hint := 'Lookup source in DHT';
121 ImageName := '';
122 ParentShowHint := False;
123 ShowHint := True;
124 TabOrder := 3;
125 end;
127 EditSRC := TfpgEdit.Create(GroupBox1);
128 with EditSRC do
129 begin
130 Name := 'EditSRC';
131 SetPosition(12, 100, 284, 24);
132 ExtraHint := '';
133 FontDesc := '#Edit1';
134 Hint := 'From whom to download. In NetAddr format.';
135 ParentShowHint := False;
136 ShowHint := True;
137 TabOrder := 4;
138 Text := '//ip4/127.162.32.220/7778';
139 end;
141 CheckStart := TfpgCheckBox.Create(GroupBox1);
142 with CheckStart do
143 begin
144 Name := 'CheckStart';
145 SetPosition(24, 132, 60, 19);
146 FontDesc := '#Label1';
147 Hint := 'Check to start, uncheck to stop.';
148 ParentShowHint := False;
149 ShowHint := True;
150 TabOrder := 5;
151 Text := 'Start';
152 end;
154 Label1 := TfpgLabel.Create(GroupBox1);
155 with Label1 do
156 begin
157 Name := 'Label1';
158 SetPosition(12, 15, 120, 15);
159 FontDesc := '#Label1';
160 Hint := '';
161 Text := 'FileID:';
162 end;
164 Label2 := TfpgLabel.Create(GroupBox1);
165 with Label2 do
166 begin
167 Name := 'Label2';
168 SetPosition(12, 83, 80, 15);
169 FontDesc := '#Label1';
170 Hint := '';
171 Text := 'Source:';
172 end;
174 GroupBox2 := TfpgGroupBox.Create(self);
175 with GroupBox2 do
176 begin
177 Name := 'GroupBox2';
178 SetPosition(0, 170, 350, 133);
179 Anchors := [anLeft,anRight,anTop,anBottom];
180 Alignment := taCenter;
181 FontDesc := '#Label1';
182 Hint := '';
183 Text := 'Progress and Results';
184 end;
186 LabelTotal := TfpgLabel.Create(GroupBox2);
187 with LabelTotal do
188 begin
189 Name := 'LabelTotal';
190 SetPosition(80, 20, 80, 15);
191 FontDesc := '#Label1';
192 Hint := 'Size of the file';
193 ParentShowHint := False;
194 ShowHint := True;
195 Text := '--';
196 end;
198 LabelRate := TfpgLabel.Create(GroupBox2);
199 with LabelRate do
200 begin
201 Name := 'LabelRate';
202 SetPosition(80, 60, 80, 15);
203 FontDesc := '#Label1';
204 Hint := 'Blocks that need to be redownloaded.';
205 ParentShowHint := False;
206 ShowHint := True;
207 Text := '--';
208 end;
210 LabelMiss := TfpgLabel.Create(GroupBox2);
211 with LabelMiss do
212 begin
213 Name := 'LabelMiss';
214 SetPosition(80, 40, 80, 15);
215 FontDesc := '#Label1';
216 Hint := 'Speed of the transfer';
217 ParentShowHint := False;
218 ShowHint := True;
219 Text := '--';
220 end;
222 GaugeProgress := TfpgGauge.Create(GroupBox2);
223 with GaugeProgress do
224 begin
225 Name := 'GaugeProgress';
226 SetPosition(16, 100, 320, 25);
227 Color := TfpgColor($BFBFBEC4);
228 FirstColor := TfpgColor($BF000000);
229 Hint := '%Total Bytes';
230 ShowHint := True;
231 Progress := 0;
232 SecondColor := TfpgColor($BF434FFF);
233 end;
235 Label3 := TfpgLabel.Create(GroupBox2);
236 with Label3 do
237 begin
238 Name := 'Label3';
239 SetPosition(12, 40, 60, 15);
240 FontDesc := '#Label1';
241 Hint := '';
242 Text := 'Rate:';
243 end;
245 Label4 := TfpgLabel.Create(GroupBox2);
246 with Label4 do
247 begin
248 Name := 'Label4';
249 SetPosition(12, 60, 60, 15);
250 FontDesc := '#Label1';
251 Hint := '';
252 Text := 'Missed:';
253 end;
255 Label5 := TfpgLabel.Create(GroupBox2);
256 with Label5 do
257 begin
258 Name := 'Label5';
259 SetPosition(12, 20, 60, 15);
260 FontDesc := '#Label1';
261 Hint := '';
262 Text := 'Total:';
263 end;
265 {@VFD_BODY_END: FormTestFS}
266 {%endregion}
267 end;
270 procedure TFormRoot.AfterCreate;
271 begin
272 {%region 'Auto-generated GUI code' -fold}
273 {@VFD_BODY_BEGIN: FormRoot}
274 Name := 'FormRoot';
275 SetPosition(334, 209, 329, 292);
276 WindowTitle := 'BrodNet - root';
277 Hint := '';
278 IconName := '';
279 OnClose:=@evClose;
281 Label2 := TfpgLabel.Create(self);
282 with Label2 do
283 begin
284 Name := 'Label2';
285 SetPosition(8, 271, 88, 20);
286 Anchors := [anLeft,anBottom];
287 FontDesc := '#Label1';
288 Hint := '';
289 Text := 'Connection: ';
290 end;
292 ConnStatus := TfpgLabel.Create(self);
293 with ConnStatus do
294 begin
295 Name := 'ConnStatus';
296 SetPosition(104, 272, 80, 15);
297 Anchors := [anLeft,anBottom];
298 FontDesc := '#Label1';
299 Hint := '';
300 Text := '---';
301 end;
303 PageControl1 := TfpgPageControl.Create(self);
304 with PageControl1 do
305 begin
306 Name := 'PageControl1';
307 SetPosition(0, 0, 331, 268);
308 Anchors := [anLeft,anRight,anTop,anBottom];
309 Hint := '';
310 TabOrder := 0;
311 end;
313 TabSheetInfo := TfpgTabSheet.Create(PageControl1);
314 with TabSheetInfo do
315 begin
316 Name := 'TabSheetInfo';
317 SetPosition(3, 24, 325, 241);
318 Anchors := [anLeft,anRight,anTop,anBottom];
319 Text := 'Main';
320 end;
322 Label1 := TfpgLabel.Create(TabSheetInfo);
323 with Label1 do
324 begin
325 Name := 'Label1';
326 SetPosition(24, 16, 140, 15);
327 FontDesc := '#Label1';
328 Hint := '';
329 Text := 'Welcome to Brodnet.';
330 end;
332 TabSheetDebug := TfpgTabSheet.Create(PageControl1);
333 with TabSheetDebug do
334 begin
335 Name := 'TabSheetDebug';
336 SetPosition(3, 24, 325, 241);
337 Anchors := [anLeft,anRight,anTop,anBottom];
338 Text := 'Debug/Testing';
339 end;
341 ButtonTestFS := TfpgButton.Create(TabSheetDebug);
342 with ButtonTestFS do
343 begin
344 Name := 'ButtonTestFS';
345 SetPosition(10, 10, 80, 30);
346 Text := 'Download';
347 FontDesc := '#Label1';
348 Hint := '';
349 ImageName := '';
350 TabOrder := 4;
351 OnClick:=@ClickDebugDownload;
352 end;
354 TabSheetConn := TfpgTabSheet.Create(PageControl1);
355 with TabSheetConn do
356 begin
357 Name := 'TabSheetConn';
358 SetPosition(3, 24, 325, 241);
359 Anchors := [anLeft,anRight,anTop,anBottom];
360 Text := 'Daemon';
361 end;
363 {@VFD_BODY_END: FormRoot}
364 {%endregion}
365 FormTestFS := tFormTestFS.Create(fpgApplication);
366 end;
368 procedure tFormRoot.evClose(Sender: TObject;var CloseAction: TCloseAction);
369 begin
370 end;
372 procedure tFormRoot.ClickDebugDownload(Sender: TObject);
373 begin
374 FormTestFS.Show;
375 end;
378 end.