NumDialog

Declaration: NumDialog (var Value: double; Format: TInFormat; Prec: integer; Caption, LeftText, RightText: string; ButInc, GaugeLow, GaugeHigh: double): integer;
The function NumDialog displays a simple numeric input dialog allowing you to enter a numeric value of different formats. The variable parameter Value controls the intial value which is pre-set when opening the dialog and returns the value input by the user. The parameter Format determines the format of the numeric data accepted by the input dialog:

itInt Integer numbers.
itFloat Floating point numbers.
itFixPoint Fixed point decimal numbers. The number of decimal places is determined by the parameter Prec.
itExp Exponential notation. The number of significant digits is controlled by the parameter Prec.
itBin Binary format.
itOct Octal format.
itHex Hexadecimal format.
itDynamic Leaves the choice of the numeric format to the user. Any of the above formats may be used. Binary, octal, or hexadecimal values may be entered by using one of the following prefix characters: % for binary numbers, & for octal, and $ for hexadecimal numbers. Negative numbers may only be entered using a decimal format.

The parameter Caption specifies the caption of the dialog, the parameters LeftText and RightText the texts which are displayed left and right to the input field. The parameter ButInc controls the increment of the numeric value when the user clicks the up or down button. The parameters GaugeLow and GaugeHigh control the numeric range of the input field. If you enter a value less than GaugeLow or greater than GaugeHigh the background of the input field changes its color to warn you that the input is outside the accepted range.

The function returns the following error codes:

 0 ... returned value in the variable parameter Value is valid
-1 ... the user clicked the close icon or pressed <ESC>, the variable parameter Value is not valid
-2 ... the specified precision (parameter Prec) in invalid (valid range: 1..15)

Example: The following code snipped displays a numeric dialog as shown below:
var
  fac : double;
...
...
fac := 3;
NumDialog (fac, itInt, 0, 'Please specify the reduction',
           'Resampling Factor', 'times', 1, 1, 10);
...