Split-Button controls
Published 29 JUL 2013 at 12:01:31AM
Updated on 26 JUL 2013 at 12:01:31AM
Continuing with the recent focus on Button controls, this time we're going to take a look at another new Button feature: Split-Buttons.
[caption id="attachment_997" align="aligncenter" width="239"] Split-Button using Aero styling[/caption]
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.
[caption id="attachment_998" align="aligncenter" width="239"] Left-aligned Split-Button using XP-styling[/caption]
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.
[caption id="attachment_999" align="aligncenter" width="239"] Aero-style Split-Button without separator[/caption]
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
[caption id="attachment_1003" align="aligncenter" width="249"] Split-Button with split-glyph using XP styling[/caption]
(*) 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 is supported on XP as well, even running under the Windows Classic theme.
[caption id="attachment_1006" align="aligncenter" width="249"] Classic mode Split-Button[/caption]
(Disclaimer: This article is based on preliminary information and may be subject to change in the final release version of OpenInsight 10).