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
;
21 CheckStart
: TfpgCheckBox
;
24 GroupBox2
: TfpgGroupBox
;
25 LabelTotal
: TfpgLabel
;
28 GaugeProgress
: TfpgGauge
;
32 {@VFD_HEAD_END: FormTestFS}
34 procedure AfterCreate
; override;
37 TFormRoot
= class(TfpgForm
)
39 {@VFD_HEAD_BEGIN: FormRoot}
41 ConnStatus
: TfpgLabel
;
42 PageControl1
: TfpgPageControl
;
43 TabSheetInfo
: TfpgTabSheet
;
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
);
53 procedure AfterCreate
; override;
62 procedure TFormTestFS
.AfterCreate
;
64 {%region 'Auto-generated GUI code' -fold}
65 {@VFD_BODY_BEGIN: FormTestFS}
67 SetPosition(762, 190, 350, 329);
68 WindowTitle
:= 'BrodNet - TestFS';
72 GroupBox1
:= TfpgGroupBox
.Create(self
);
76 SetPosition(0, 2, 350, 160);
77 Anchors
:= [anLeft
,anRight
,anTop
];
78 Alignment
:= taCenter
;
79 FontDesc
:= '#Label1';
81 Text := 'FileServer Test Parameters';
84 EditFID
:= TfpgEdit
.Create(GroupBox1
);
88 SetPosition(10, 32, 330, 24);
90 FontDesc
:= 'FreeMono-10:bold:antialias=true';
92 ParentShowHint
:= False;
95 Text := '9cb70c44932a00dbe74ca392b3694329fa894768';
98 ButtonDelete
:= TfpgButton
.Create(GroupBox1
);
101 Name
:= 'ButtonDelete';
102 SetPosition(100, 59, 52, 23);
104 FontDesc
:= '#Label1';
105 Hint
:= 'Delete local file, so it can be downloaded again.';
107 ParentShowHint
:= False;
112 ButtonLookup
:= TfpgButton
.Create(GroupBox1
);
115 Name
:= 'ButtonLookup';
116 SetPosition(12, 59, 80, 23);
119 FontDesc
:= '#Label1';
120 Hint
:= 'Lookup source in DHT';
122 ParentShowHint
:= False;
127 EditSRC
:= TfpgEdit
.Create(GroupBox1
);
131 SetPosition(12, 100, 284, 24);
133 FontDesc
:= '#Edit1';
134 Hint
:= 'From whom to download. In NetAddr format.';
135 ParentShowHint
:= False;
138 Text := '//ip4/127.162.32.220/7778';
141 CheckStart
:= TfpgCheckBox
.Create(GroupBox1
);
144 Name
:= 'CheckStart';
145 SetPosition(24, 132, 60, 19);
146 FontDesc
:= '#Label1';
147 Hint
:= 'Check to start, uncheck to stop.';
148 ParentShowHint
:= False;
154 Label1
:= TfpgLabel
.Create(GroupBox1
);
158 SetPosition(12, 15, 120, 15);
159 FontDesc
:= '#Label1';
164 Label2
:= TfpgLabel
.Create(GroupBox1
);
168 SetPosition(12, 83, 80, 15);
169 FontDesc
:= '#Label1';
174 GroupBox2
:= TfpgGroupBox
.Create(self
);
178 SetPosition(0, 170, 350, 133);
179 Anchors
:= [anLeft
,anRight
,anTop
,anBottom
];
180 Alignment
:= taCenter
;
181 FontDesc
:= '#Label1';
183 Text := 'Progress and Results';
186 LabelTotal
:= TfpgLabel
.Create(GroupBox2
);
189 Name
:= 'LabelTotal';
190 SetPosition(80, 20, 80, 15);
191 FontDesc
:= '#Label1';
192 Hint
:= 'Size of the file';
193 ParentShowHint
:= False;
198 LabelRate
:= TfpgLabel
.Create(GroupBox2
);
202 SetPosition(80, 60, 80, 15);
203 FontDesc
:= '#Label1';
204 Hint
:= 'Blocks that need to be redownloaded.';
205 ParentShowHint
:= False;
210 LabelMiss
:= TfpgLabel
.Create(GroupBox2
);
214 SetPosition(80, 40, 80, 15);
215 FontDesc
:= '#Label1';
216 Hint
:= 'Speed of the transfer';
217 ParentShowHint
:= False;
222 GaugeProgress
:= TfpgGauge
.Create(GroupBox2
);
223 with GaugeProgress
do
225 Name
:= 'GaugeProgress';
226 SetPosition(16, 100, 320, 25);
227 Color
:= TfpgColor($BFBFBEC4);
228 FirstColor
:= TfpgColor($BF000000);
229 Hint
:= '%Total Bytes';
232 SecondColor
:= TfpgColor($BF434FFF);
235 Label3
:= TfpgLabel
.Create(GroupBox2
);
239 SetPosition(12, 40, 60, 15);
240 FontDesc
:= '#Label1';
245 Label4
:= TfpgLabel
.Create(GroupBox2
);
249 SetPosition(12, 60, 60, 15);
250 FontDesc
:= '#Label1';
255 Label5
:= TfpgLabel
.Create(GroupBox2
);
259 SetPosition(12, 20, 60, 15);
260 FontDesc
:= '#Label1';
265 {@VFD_BODY_END: FormTestFS}
270 procedure TFormRoot
.AfterCreate
;
272 {%region 'Auto-generated GUI code' -fold}
273 {@VFD_BODY_BEGIN: FormRoot}
275 SetPosition(334, 209, 329, 292);
276 WindowTitle
:= 'BrodNet - root';
281 Label2
:= TfpgLabel
.Create(self
);
285 SetPosition(8, 271, 88, 20);
286 Anchors
:= [anLeft
,anBottom
];
287 FontDesc
:= '#Label1';
289 Text := 'Connection: ';
292 ConnStatus
:= TfpgLabel
.Create(self
);
295 Name
:= 'ConnStatus';
296 SetPosition(104, 272, 80, 15);
297 Anchors
:= [anLeft
,anBottom
];
298 FontDesc
:= '#Label1';
303 PageControl1
:= TfpgPageControl
.Create(self
);
306 Name
:= 'PageControl1';
307 SetPosition(0, 0, 331, 268);
308 Anchors
:= [anLeft
,anRight
,anTop
,anBottom
];
313 TabSheetInfo
:= TfpgTabSheet
.Create(PageControl1
);
316 Name
:= 'TabSheetInfo';
317 SetPosition(3, 24, 325, 241);
318 Anchors
:= [anLeft
,anRight
,anTop
,anBottom
];
322 Label1
:= TfpgLabel
.Create(TabSheetInfo
);
326 SetPosition(24, 16, 140, 15);
327 FontDesc
:= '#Label1';
329 Text := 'Welcome to Brodnet.';
332 TabSheetDebug
:= TfpgTabSheet
.Create(PageControl1
);
333 with TabSheetDebug
do
335 Name
:= 'TabSheetDebug';
336 SetPosition(3, 24, 325, 241);
337 Anchors
:= [anLeft
,anRight
,anTop
,anBottom
];
338 Text := 'Debug/Testing';
341 ButtonTestFS
:= TfpgButton
.Create(TabSheetDebug
);
344 Name
:= 'ButtonTestFS';
345 SetPosition(10, 10, 80, 30);
347 FontDesc
:= '#Label1';
351 OnClick
:=@ClickDebugDownload
;
354 TabSheetConn
:= TfpgTabSheet
.Create(PageControl1
);
357 Name
:= 'TabSheetConn';
358 SetPosition(3, 24, 325, 241);
359 Anchors
:= [anLeft
,anRight
,anTop
,anBottom
];
363 {@VFD_BODY_END: FormRoot}
365 FormTestFS
:= tFormTestFS
.Create(fpgApplication
);
368 procedure tFormRoot
.evClose(Sender
: TObject
;var CloseAction
: TCloseAction
);
372 procedure tFormRoot
.ClickDebugDownload(Sender
: TObject
);