Silverfrost Logo About Us | Contact Us
 

%rd - Edit Integer

Purpose

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

Syntax

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

Modifiers

Grave accent (`) - makes the control read-only (no box is supplied, see %co).

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). The range can be set using %il.

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

The subroutine set_highlighted@ can be called to select all of the text in the edit box. It takes one argument which is the handle given by %lc.

Notes

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

SUBROUTINE UNBLANK_CONTROL@( W )
INTEGER W

W is the handle for the control obtained using %lc. 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-2017 Silverfrost Limited