Continuing with the recent focus on Button controls, this time we’re going to take a look at another new Button feature: Split-Buttons.
This button style was introduced with Windows Vista (*) and basically divides the button into two parts: The main part behaves like a normal push-button and fires a CLICK event when pressed, whilst the other part (normally drawn with a down arrow) fires a DROPDOWN event instead of a CLICK (if a context menu is linked to the button then this is displayed instead).
Split-Button support in OpenInsight 10 is exposed via the following properties:
- SPLITBUTTON
- SPLITWIDTH
- SPLITSEPARATOR
SPLITBUTTON property
To enable Split-Button functionality the SPLITBUTTON property can be set to one of the following values:
- “R” – creates a Split-Button with the main part to the left and the drop-down arrow part on the right.
- “L” – creates a Split-Button with the main part to the right and the drop-down arrow part on the left.
Setting the SPLITBUTTON property to NULL (“”) removes the Split-Button styling from the control.
SPLITWIDTH property
This property specifies the size in pixels of the arrow part of the control.
SPLITSEPARATOR property
The functionality of a Split-Button can be changed by the SPLITSEPARATOR property. By default the property is TRUE (“1”), but when set to FALSE (“0”) the line between the two parts of the button is removed and the entire button then behaves as a “drop-down button” – i.e. clicking the button displays a context menu or fires a DROPDOWN event.
The Split-Glyph API
For those of you who really can’t help customizing as much as possible the Split-Button also supports an API to allow you to change the default down arrow in the drop-down part of the control. This is the “Split-Glyph API” and mirrors most of the normal Button control “Glyph API” described previously. The only difference is the name of the properties – they are all prefixed with “SPLIT”, i.e.
- SPLITGLYPH
- SPLITGLYPHCOLORKEY
- SPLITGLYPHCOUNT
- SPLITGLYPHFRAMECOUNT
- SPLITGLYPHFRAMENUMBER
- SPLITGLYPHOFFSET
- SPLITGLYPHORIGIN
- SPLITGLYPHSIZE
- SPLITGLYPHTRANSLUCENCY
(*) Although Microsoft only introduced Split-Buttons into Windows with the release of Vista, (and then only with visual styles enabled) it should be noted that the OpenInsight Split-Button issupported on XP as well, even running under the Windows Classic theme.
(Disclaimer: This article is based on preliminary information and may be subject to change in the final release version of OpenInsight 10).