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
;
13 TFormTestFS
= class(TfpgForm
)
15 {@VFD_HEAD_BEGIN: FormTestFS}
16 GroupBox1
: TfpgGroupBox
;
18 ButtonDelete
: TfpgButton
;
19 ButtonLookup
: TfpgButton
;
23 GroupBox2
: TfpgGroupBox
;
24 LabelTotal
: TfpgLabel
;
27 GaugeProgress
: TfpgGauge
;
31 LabelError
: TfpgLabel
;
32 ButtonStart
: TfpgButton
;
33 ButtonAbort
: TfpgButton
;
34 CheckAttach
: TfpgCheckBox
;
35 {@VFD_HEAD_END: FormTestFS}
37 procedure AfterCreate
; override;
40 TFormRoot
= class(TfpgForm
)
42 {@VFD_HEAD_BEGIN: FormRoot}
44 ConnStatus
: TfpgLabel
;
45 PageControl1
: TfpgPageControl
;
46 TabSheetInfo
: TfpgTabSheet
;
48 TabSheetDebug
: TfpgTabSheet
;
49 ButtonTestFS
: TfpgButton
;
50 TabSheetConn
: TfpgTabSheet
;
51 {@VFD_HEAD_END: FormRoot}
52 FormTestFS
: tFormTestFS
;
53 procedure ClickDebugDownload(Sender
: TObject
);
54 procedure evClose(Sender
: TObject
;var CloseAction
: TCloseAction
);
56 procedure AfterCreate
; override;
65 procedure TFormTestFS
.AfterCreate
;
67 {%region 'Auto-generated GUI code' -fold}
68 {@VFD_BODY_BEGIN: FormTestFS}
70 SetPosition(762, 190, 350, 329);
71 WindowTitle
:= 'BrodNet - TestFS';
75 GroupBox1
:= TfpgGroupBox
.Create(self
);
79 SetPosition(0, 2, 350, 160);
80 Anchors
:= [anLeft
,anRight
,anTop
];
81 Alignment
:= taCenter
;
82 FontDesc
:= '#Label1';
84 Text := 'FileServer Test Parameters';
87 EditFID
:= TfpgEdit
.Create(GroupBox1
);
91 SetPosition(10, 32, 330, 24);
93 FontDesc
:= 'FreeMono-10:bold:antialias=true';
95 ParentShowHint
:= False;
98 Text := '9cb70c44932a00dbe74ca392b3694329fa894768';
101 ButtonDelete
:= TfpgButton
.Create(GroupBox1
);
104 Name
:= 'ButtonDelete';
105 SetPosition(100, 59, 52, 23);
107 FontDesc
:= '#Label1';
108 Hint
:= 'Delete local file, so it can be downloaded again.';
110 ParentShowHint
:= False;
115 ButtonLookup
:= TfpgButton
.Create(GroupBox1
);
118 Name
:= 'ButtonLookup';
119 SetPosition(12, 59, 80, 23);
122 FontDesc
:= '#Label1';
123 Hint
:= 'Lookup source in DHT';
125 ParentShowHint
:= False;
130 EditSRC
:= TfpgEdit
.Create(GroupBox1
);
134 SetPosition(12, 100, 284, 24);
136 FontDesc
:= '#Edit1';
137 Hint
:= 'From whom to download. In NetAddr format.';
138 ParentShowHint
:= False;
141 Text := '//ip4/127.162.32.220/7778';
144 Label1
:= TfpgLabel
.Create(GroupBox1
);
148 SetPosition(12, 15, 120, 15);
149 FontDesc
:= '#Label1';
154 Label2
:= TfpgLabel
.Create(GroupBox1
);
158 SetPosition(12, 83, 80, 15);
159 FontDesc
:= '#Label1';
164 GroupBox2
:= TfpgGroupBox
.Create(self
);
168 SetPosition(0, 170, 350, 133);
169 Anchors
:= [anLeft
,anRight
,anTop
,anBottom
];
170 Alignment
:= taCenter
;
171 FontDesc
:= '#Label1';
173 Text := 'Progress and Results';
176 LabelTotal
:= TfpgLabel
.Create(GroupBox2
);
179 Name
:= 'LabelTotal';
180 SetPosition(80, 20, 80, 15);
181 FontDesc
:= '#Label1';
182 Hint
:= 'Size of the file';
183 ParentShowHint
:= False;
188 LabelRate
:= TfpgLabel
.Create(GroupBox2
);
192 SetPosition(80, 60, 80, 15);
193 FontDesc
:= '#Label1';
194 Hint
:= 'Blocks that need to be redownloaded.';
195 ParentShowHint
:= False;
200 LabelMiss
:= TfpgLabel
.Create(GroupBox2
);
204 SetPosition(80, 40, 80, 15);
205 FontDesc
:= '#Label1';
206 Hint
:= 'Speed of the transfer';
207 ParentShowHint
:= False;
212 GaugeProgress
:= TfpgGauge
.Create(GroupBox2
);
213 with GaugeProgress
do
215 Name
:= 'GaugeProgress';
216 SetPosition(16, 100, 320, 25);
217 Color
:= TfpgColor($BFBFBEC4);
218 FirstColor
:= TfpgColor($BF000000);
219 Hint
:= '%Total Bytes';
220 ParentShowHint
:= False;
222 SecondColor
:= TfpgColor($BF434FFF);
226 Label3
:= TfpgLabel
.Create(GroupBox2
);
230 SetPosition(12, 40, 60, 15);
231 FontDesc
:= '#Label1';
236 Label4
:= TfpgLabel
.Create(GroupBox2
);
240 SetPosition(12, 60, 60, 15);
241 FontDesc
:= '#Label1';
246 Label5
:= TfpgLabel
.Create(GroupBox2
);
250 SetPosition(12, 20, 60, 15);
251 FontDesc
:= '#Label1';
256 LabelError
:= TfpgLabel
.Create(GroupBox2
);
259 Name
:= 'LabelError';
260 SetPosition(180, 20, 80, 50);
261 FontDesc
:= '#Label1';
266 ButtonStart
:= TfpgButton
.Create(GroupBox1
);
269 Name
:= 'ButtonStart';
270 SetPosition(12, 130, 80, 23);
272 FontDesc
:= '#Label1';
278 ButtonAbort
:= TfpgButton
.Create(GroupBox1
);
281 Name
:= 'ButtonAbort';
282 SetPosition(100, 130, 80, 23);
285 FontDesc
:= '#Label1';
291 CheckAttach
:= TfpgCheckBox
.Create(GroupBox1
);
294 Name
:= 'CheckAttach';
295 SetPosition(163, 60, 76, 19);
296 BoxLayout
:= tbRightBox
;
298 FontDesc
:= '#Label1';
304 {@VFD_BODY_END: FormTestFS}
309 procedure TFormRoot
.AfterCreate
;
311 {%region 'Auto-generated GUI code' -fold}
312 {@VFD_BODY_BEGIN: FormRoot}
314 SetPosition(334, 209, 329, 292);
315 WindowTitle
:= 'BrodNet - root';
320 Label2
:= TfpgLabel
.Create(self
);
324 SetPosition(8, 271, 88, 20);
325 Anchors
:= [anLeft
,anBottom
];
326 FontDesc
:= '#Label1';
328 Text := 'Connection: ';
331 ConnStatus
:= TfpgLabel
.Create(self
);
334 Name
:= 'ConnStatus';
335 SetPosition(104, 272, 80, 15);
336 Anchors
:= [anLeft
,anBottom
];
337 FontDesc
:= '#Label1';
342 PageControl1
:= TfpgPageControl
.Create(self
);
345 Name
:= 'PageControl1';
346 SetPosition(0, 0, 331, 268);
347 Anchors
:= [anLeft
,anRight
,anTop
,anBottom
];
352 TabSheetInfo
:= TfpgTabSheet
.Create(PageControl1
);
355 Name
:= 'TabSheetInfo';
356 SetPosition(3, 24, 325, 241);
357 Anchors
:= [anLeft
,anRight
,anTop
,anBottom
];
361 Label1
:= TfpgLabel
.Create(TabSheetInfo
);
365 SetPosition(24, 16, 140, 15);
366 FontDesc
:= '#Label1';
368 Text := 'Welcome to Brodnet.';
371 TabSheetDebug
:= TfpgTabSheet
.Create(PageControl1
);
372 with TabSheetDebug
do
374 Name
:= 'TabSheetDebug';
375 SetPosition(3, 24, 325, 241);
376 Anchors
:= [anLeft
,anRight
,anTop
,anBottom
];
377 Text := 'Debug/Testing';
380 ButtonTestFS
:= TfpgButton
.Create(TabSheetDebug
);
383 Name
:= 'ButtonTestFS';
384 SetPosition(10, 10, 80, 30);
386 FontDesc
:= '#Label1';
390 OnClick
:=@ClickDebugDownload
;
393 TabSheetConn
:= TfpgTabSheet
.Create(PageControl1
);
396 Name
:= 'TabSheetConn';
397 SetPosition(3, 24, 325, 241);
398 Anchors
:= [anLeft
,anRight
,anTop
,anBottom
];
402 {@VFD_BODY_END: FormRoot}
404 FormTestFS
:= tFormTestFS
.Create(fpgApplication
);
407 procedure tFormRoot
.evClose(Sender
: TObject
;var CloseAction
: TCloseAction
);
411 procedure tFormRoot
.ClickDebugDownload(Sender
: TObject
);