Sample program: |
The following script displays a dialog with four elements which allow for the input of a name and three body parameters:
program AskBodyDimensions;
var
DlgResults : TVariantArray;
begin
CreateDialog (150,10,'Sample Dialog',
[gcEdit, gcCheckbox, gcNumio, gcNumio],
['Name', 'Left handed', 'Body height [cm]', 'Show size [cm]']);
DlgResults := ShowDialog;
if DlgResults[0] = 0 then
begin
couts ('Name: '+DlgResults[1]);
couts ('Left handed: '+boolToStr(DlgResults[2],0));
coutf ('Body height: ',DlgResults[3]);
coutf ('Shoe size: ',DlgResults[4]);
end;
end.
This dialog exhibits a few weaknesses: (1) the range of allowed parameters is given by the default values (0..1000) which is not meaningful, (2) no initial values are displayed and (3) the precision of the numeric input values is two decimal places by default (which is nonsense because the daily variations are much higher than 0.1 mm). The function ConfigDlgComponent can be used to adjust the input components accordingly.
|