The SpinBox item consists of a text field and up-down arrows. The arrows may be used to increment or decrement the numeric value in the text field.
The DialogItemRsc field extent specifies the location and size of the SpinBox item. The x position specifies the location of the left side of the text field, and the y position specifies either the top of the text field or, if the 'label on top' attribute is set, the top of the label. If width is 0, the width of the SpinBox is calculated using the maximum number of characters the text field can contain. Specifying an explicit width is recommended. If height is 0, the height is calculated using the current dialog font.
The type field should contain SpinBox.
The ID determines the DItem_SpinBoxRsc instance to load.
The attributes field can be ON or OFF, and optionally combined with hidden. It will usually be ON.
The itemArg field is unused and should usually be set to 0.
The label field can override the label contained in the DItem_SpinBoxRsc instance.
The auxInfo field can currently override only the access string contained in the DItem_SpinBoxRsc instance.
The following is an example of an item list specification for the SpinBox item:
The SpinBox resource is defined in a resource file with the following structure:
For consistency with MicroStation's dialog boxes, a SpinBox item's label should end with a colon.
The following fields are described in the Text Item resource specification and are functionally identical in the SpinBox: maxSize, formatToDisplay, formatToInternal, minValue, maxValue and mask.
The DItem_SpinBoxRsc structure has the following unique fields. (See "Common item resource fields" for a description of any field not in this table.)
Field | Description |
---|---|
attributes | Specifies the attributes of the SpinBox item. |
Valid constants for use with the attributes field:
Constant | Description |
---|---|
SPINATTR_LABELABOVE | Place the label above the text field. |
The following is an example of a SpinBox item resource.
The following messages are sent to item hook functions that are attached to SpinBox items: DITEM_MESSAGE_CREATE, DITEM_MESSAGE_DESTROY, DITEM_MESSAGE_SYNCHRONIZE, DITEM_MESSAGE_BUTTON, DITEM_MESSAGE_KEYSTROKE, DITEM_MESSAGE_STATECHANGED, DITEM_MESSAGE_GETSTATE and DITEM_MESSAGE_SETSTATE.