ASPiK SDK
|
COptionMenu
In many cases we will need to display a string-list parameter for the user. There are multiple objects that can encode this information for the user, but the simplest and easiest to use is the COptionMenu object (called Option Menu in the GUI designer) which implements a drop-list control for the user. The GUI object displays the currently selected item’s text and upon clicking, a drop-down menu appears showing the other options as text strings. This object is easy to use because it does not require a graphics file to work. You may optionally include a background graphic file to display behind the text if you like, but we are going to use the control in its simplest version.
When you setup a drop-list object in the GUI designer, you will drag and drop a COptionMenu onto the canvas. You will then need to set the following parameters in the control’s attribute fields:
• font-color: the text color
• back-color: the color behind the text
• frame-color: the color of an outer frame (usually we just make this the same as the back-color
• frame-width: the width of the frame in pixels; when the frame-color and back-color are identical, this attribute has no meaning
• control-tag: the controlID value that links this control to a plugin parameter
There are several more optional style settings that you may apply depending on your personal taste. These attributes are selected or de-selected with check-boxes and the most common of the styles are:
• transparent: the background of the control is transparent; this is typically only used when the frame is present as it will otherwise be confusing for the user
• style-no-frame: when checked, the frame-color and frame-width are ignored
• style-round-rect: rounds the corners of the control; the curvature is set with the round-rect-radius attribute – the larger this value, the more rounded the corners appear
The nice thing about this object is that you may simply resize the object with the mouse, stretching and pulling it into the desired size. With auto-sizing turned on, you don’t have to enter any size attributes.