/
createNumBox
createNumBox
Description
Creates a num box user control on the user window specified by windowID
.
A num box is the same as text box user control, except it only allows the user to specify a number. A spinner is also available to change the value of the number.
The control is initially placed in the top-left corner of the user window, and must be placed by using the -pos
option, or by using the setControlPos command.
The command returns the Control ID of the user control, which should be saved for later operations on the control.
Functional area
User Window
Command syntax
Syntax
createNumBox parentWindowID[-hidden] [-pos integer array] [-form integer] [-flt] [-spin] [-num float] |
Arguments
Name | Type | Required | Comments |
---|---|---|---|
windowId | int | yes | ID of user window to place the control on. |
Flags
Name | Flag arguments | Argument type | Exclusive to | Comments |
---|---|---|---|---|
flt | 0 | — | — | Specifies that the number should be evaluated as a floating point number. |
spin | 0 | — | — | Specifies that a spin control be attached to the control. |
hidden | 0 | — | — | Specifies that the control should be hidden initially. Call showControl to subsequently make it visible. The default is for it to be visible. |
num | 1 | float | — | Specifies the initial value of the control. Can be either a float or int. |
pos | 1 | integer array | — | A four-element int array representing a rectangle, which specifies the initial size/position of the control relative to the top left corner of the user window. The element order is Left, Top, Right, and Bottom. The default is a text box 20 units high by 50 units wide. |
form | 1 | integer | — | Control ID of the form user control which will dynamically position this control. |
Return value
integer
Examples
// Create a Check Box user control. int $windowId; int $controlId; float $value = 5.25; // First create a user window to place the Control on $windowId = `createWindow "MyWindow"`; // Create the Control on the Window, passing // in the Window Id of the user window we // just created. Make floating point, specifying the initial // value and a spinner $controlId = `createNumBox $windowId -num $value -spin -flt`;
Additional information
Related commands
, multiple selections available,