%rd - Edit Integer


To create an edit box and display an integer that can be updated.


winio@('%nrd[option]', value)
winio@('%~nrd[option]', value, grey_ctrl)
integer value         (input/output)
integer grey_ctrl     (input)


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 (Options for Edit)).

Question mark (?) - a help string is supplied.

Tilde (~) - adds a variable that controls the grey (enable/disable) state.


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 %il (Integer Limit).

If %`rd 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). In addition it can also take the keyword radix=n where n is the number base for the displayed value. n must be in the range 2 to 36.

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 %dd (Spin for Integer) is used before %rd, a spin wheel is added (see %dd (Spin for Integer) 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).


The [intially_blank] option can be reset dynamically using a call to the routine:


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.

See also

%il (Integer Limit), %dd (Spin for Integer), %co (Options for Edit), %tc (Text Colour), SET_HIGHLIGHTED@, SET_CONTROL_TEXT_COLOUR@




Copyright © 1999-2022 Silverfrost Limited