Please enable JavaScript to view this site.

ESL Documentation

Definition

Define a spin button.

[enabled|disabled] [visible|invisible]

[editable|readonly] [[color] BG_COLOR]

[numeric|alphanumeric]

spin button SPINBUTTON_NAME

size WIDTH HEIGHT at [position] X Y in DB_NAME

[[color] FG_COLOR foreground]

[parameter is PAR_STRING]

[helpid is HELP_ID]

[group is GROUP_NAME]

[font FONT_NAME]

[{left|center|right} align]

[border|no border]

[zero pad]

[range is MIN_VAL MAX_VAL

| insert VAL1 [VAL2 ...]

| insert file FILENAME]

enabled | disabled

Define the spin button as selectable or not. If you define a spin button as disabled, it is displayed grayed and cannot be selected. The default is enabled.

Query using: is enabled, selectability of

Modify using: enable disable

visible | invisible

A visible object is displayed when it is defined. An invisible object is not displayed until you specifically make it visible. The default is visible.

Query using: is visible, visibility of

Modify using: make visible, make invisible

editable | readonly

Make the spin button editable or read-only. When a spin button can be edited, a user can alter the value of the spin button either by editing the contents of the entry field portion of the spin button or by using the arrow buttons. When a spin button is read-only, a user must use the arrow buttons to change the value of the spin button. The default is editable.

color BG_COLOR

The background color of the spin button. Use a color keyword, a string value representing a color keyword, or an integer value representing a color number corresponding to a color available on your system.

Query using: background of

Modify using: make background

numeric | alphanumeric

Define the spin button as numeric to scroll through a range of integer values. The value of the spin button is incremented or decremented by 1 each time the user presses an arrow key.

Define the spin button as alphanumeric to scroll through a set list of values.

The default is numeric.

spin button SPINBUTTON_NAME

The identifier for a spin button.

size WIDTH HEIGHT

Integer values representing the dimensions of the spin button in dialog units.

Query using: xsize of, ysize of

Modify using: change size

at position X Y

Integer values representing the position of the spin button in dialog units.

Query using: xposition of, yposition of

Modify using: change position

in DB_NAME

The identifier for the dialog box or dialog region parent object.

Query using: ancestry of

color FG_COLOR foreground

The foreground color of the spin button. Use a color keyword, a string value representing a color keyword, or an integer value representing a color number corresponding to a color available on your system.

Query using: foreground of

Modify using: make foreground

parameter is PAR_STRING

A string value representing the parameter of the spin button. The default parameter string is "".

Query using: parameter of

Modify using: make parameter

helpid is HELP_ID

A string or integer value representing the identifier of the help panel you want displayed when the user requests help for this spin button. This should match the help panel defined in the library specified by the help library declaration. The default HELP_ID is "". If your application will run under Windows 3.0, HELP_ID must be an integer.

Query using: helpid of

Modify using: make helpid

group is GROUP_NAME

An identifier for the group of dialog control objects to which the spin button belongs.

font FONT_NAME

The name of the font in which you want the text to appear. You may use either system or ESL fonts. (See the description of the font is Font Reference Definition.)

You cannot change the font of a control at runtime.

left | center | right align

Align the text in the entry field portion of the spin button to the left, center or right. The default is left.

border | no border

Display the entry field portion of the spin button with or without a border. The default is border.

zero pad

Pad values in a numeric spin button with leading zeros. Enough leading zeros will be added to display the eleven digits of an ESL integer.

range is MIN_VAL MAX_VAL

Integer values representing the minimum and maximum for the range of a numeric spin button. Use for numeric spin buttons only.

Query using: minimum, maximum

Modify using: change minimum or maximum

insert TEXT_STRING

A string value representing the text you want inserted in the spin button. Separate entries for the spin button with '\n'. Use for alphanumeric spin buttons only.

insert file FILENAME

A string value representing the name, including the extension, of an ASCII file you want inserted into the spin button. Use only for alphanumeric spin buttons.

Description

A spin button is a dialog control and must have a dialog box or dialog region as its parent.

Only the spin button keywords, the identifier, the at specification, the size specification, and in DB_NAME are required in the definition, in the order shown in the model.

Note that the insert statement(s), if any, must come last in the spin button definition.

The values in a numeric spin button increase or decrease by 1 as the user scrolls. If another increment is desired, use an alphanumeric spin button.

If a spin button is defined as editable and a user types in a new value (one not included in a numerc spin button's range or in the list of values for an alphanumeric spin button), that new value is not added to the list of existing values. (This functionality can be implemented in the ESL program itself.) If the user then presses the up or down arrow, the next value displayed will be increased or decreased from the value which was previously displayed in the entry field.

An error will be generated at runtime if the range is or insert statement is used with the incorrect type of spin button.

In addition to the generic response for spin buttons, response to spin button, an on spin response will be taken each time the value in a spin button has changed, and an on validation response will be taken when the focus leaves the spin button. The on vscroll on clause is not valid for spin buttons.

All the attributes of a spin button are maintained when it is made temporary and permanent. When a save program as action is executed, the current state of the spin button, including all attributes and data, is saved.

Do not repeat text in a spin button with statements such as: "insert text," "insert file," or "read file into." Due to a limitation in Windows, repeating text in a spin buttton will cause scrolling to be only within the repeated text. In the following example, the values which will be scrolled are: "Red," "blue," and "Black."

enabled visible alphanumeric spin button ColorList_SB

size 100 12 at 10 75 in Display_DR

insert "Red\nBlue\nBlack\nRed\nWhite"

Example

enabled visible editable numeric spin button Year_SB

size 80 12 at position 150 50 in DB

red foreground

center align

range is 1980 2001

enabled visible readonly blue numeric spin button Day_SB

size 40 12 at position 40 50 in DB

fast spin

master is YEAR_SB

range is 1 31

enabled visible readonly alphanumeric spin button Month_SB

size 50 12 at position 90 50 in DB

left align

no border

master is YEAR_SB

insert

"Jan\nFeb\nMar\n"

"Apr\nMay\nJun\n"

"Jul\nAug\nSep\n"

"Oct\n"

"Nov\n"

"Dec\n"

See Also

change minimum and change maximum Action Statement

font is Font Reference Definition

minimum of and maximum of Object Inquiry Built-in Functions