Purpose |
To create an edit box and display a floating point value that can be updated. |
Syntax |
winio@('%nrf[option]', value) |
Modifiers |
Grave accent (`) - makes the control read-only (no box is supplied, see %co (Options for Edit)). Caret (^) - the call-back is called when a change is made (see also %co). Question mark (?) - a help string is supplied. Tilde (~) - adds a variable that controls the grey (enable/disable) state. |
Description |
n is optional and specifies the number of average width characters in the displayed output. Only values in range can be entered (see %co (Options for Edit)). The range can be set using %fl (Float Limit). Values are entered in decimal or exponent form. If %`rf is specified, then the value presented can only be changed by the program using WINDOW_UPDATE@(value). grey_ctrl is 1 (enabled) or 0 (disable/greyed). A call-back function (if present) is placed after this control variable. option can be set to the keyword initially_blank in order to create an edit box that is initially empty (see notes below). It can additionally take a format specifier to provide greater control in how the value is displayed. This takes the form [fmt=<format_specifier>] and is analagous to the formatting of %wf (Display Real), %we (Display Real) and %wg (Display Real). For example %rf[fmt=0.4e] is equivalent to %0.4we. In other words, we simply omit the '%' and the 'w'. The result in this case is an exponent form with 4 decimal places and 5 significant figures. See %wf for more details on the format_specifier. The standard call-back functions 'COPY', 'CUT', and 'PASTE' can be used in this context by attaching them to menu items and/or accelerator keys. When %df (Spin for Float) is used before %rf, a spin wheel is added (see %df (Spin for Float) for details). The subroutine SET_HIGHLIGHTED@ can be called to select all of the text in the edit box. It takes one INTEGER(7) argument which is the handle given by %lc (Handle of Last Control). |
Notes |
The [intially_blank] option can be reset dynamically using a call to the routine: SUBROUTINE UNBLANK_CONTROL@( HWND ) W is the handle for the control obtained using %lc (Handle of Last Control). The routine is used to selectively switch off this property at runtime. %rf accepts the input of a comma. This is transcribed to a decimal point. |
See also |
%fl (Float Limit), %df (Spin for Float), %co (Options for Edit), %tc (Text Colour), SET_HIGHLIGHTED@, SET_CONTROL_TEXT_COLOUR@ |