skip to main content
OpenEdge Development: AppBuilder
Data-Display/Capture Objects : Spin controls (ActiveX)
 
Spin controls (ActiveX)
The Spin‑Control widget consists of two buttons marked with arrowheads, optionally attached to a readout field that displays an INTEGER value. You can think of the buttons as being a form of scroll bar, without the actual bar or thumb. Pressing one of the buttons causes the value in the readout fields to change by some amount you set (default 1) within the subrange –10000 to 10000. Unlike a scroll bar or a slider control, a spin control offers no analog, at‑a‑glance information. You might use a spin control in cases where you wish to allow the user to set some value that changes in integer steps other than 1.
Creating a spin control instance
To create a spin control:
1. Click CSSpin in the Object Palette.
2. Move the mouse cursor over a bare spot in your workspace and click to place the new object. It will almost certainly be too large, so resize it temporarily:
3. Configure it, and make final adjustments to its size and position.
Configuring a spin‑control instance
The spin control has a number of properties you can change if the default settings do not meet your needs. Double‑click the instance to open its Property Editor sheet:
Minimal configuration
Although you can accept many default settings, you should at least make the following changes:
*Replace the default identifier (shown in AppBuilder’s main window) with one that more clearly identifies the role of this object in your application. This identifier belongs to the control frame interface. For more information about control frame objects, see the “ActiveX control frame properties” section. Max and Min—normally 10000 and –10000 should have their properties set to the upper and lower INTEGER bounds of the range you want the spin control to use. You cannot set a value smaller than –10000 or larger than 10000. Note that if you set Min to be larger than Max, the meaning of the buttons will reverse, which may confuse the user.
*Increment — Normally 1. Set this property to be the size of the INTEGER change to be made per button press. This is an unsigned (absolute) value.
Optional configuration
You may wish to make changes to some or all of the following settings, or to others not discussed here:
*Value — Normally 0. Set this property to initialize the object; read it to detect user changes.
*Spin Rate — Normally 10. This property represents the number of increments per second when the user holds down one of the buttons. Thus, if the increment value is 100, and you set the Spin Rate to 12, you can expect the value to change by 1200 over a second’s time, when a button is held down.
*GetArrows — Normally TRUE. Setting this property to FALSE prevents the object from responding to keyboard arrow‑key presses. Normally, pressing one of the arrow keys has the same effect as pressing one of the spin control buttons.
*ValueDisplay — Normally AutoSized. Setting this property to None prevents the object from displaying the integrated readout. Turning off the readout in this way is useful if you wish to bind the buttons to some other object for display.
*Style — Normally 3D Vertical. There are four possible settings, combining Normal versus 3D, and Horizontal versus Vertical. Setting this property to Normal flattens out the 3D effect, and setting it to Horizontal changes the orientation of the buttons such that they point left and right rather than up and down.
Combining Horizontal orientation with reversed Min and Max meanings may be appropriate in some international contexts.
*Alignment — Normally Right Justify. Applies to how the integrated readout displays the object’s INTEGER value. Possible settings are Left Justify, Center, and Right Justify.