ToggleButtonEx

www.progui.co.uk  Top  Previous  Next

ToggleButtonEx()

Syntax

WindowsID = ToggleButtonEx(WindowID.i, ToggleButtonID.l, X.l, Y.l, Width.l, Height.l, Text$, *NormalImageID, *HotImageID, *PressedImageID, *SelectedImageID, *HotSelectedImageID, PressedSelectedImageID, *DisabledImageID, Skin.i)

Description

Creates a skinned toggle state ButtonEx in the specified WindowID.i.

ToggleButtonID.l specifies the internal ID of the ToggleButtonEx and if #ProGUI_Any is used then the returned value will be the new ToggleButtonEx ID. X.l, Y.l, Width.l and Height.l are the position and dimensions of the ToggleButtonEx.

Text$ is the text that will be displayed in the ToggleButtonEx and can be an empty string.

*NormalImageID, *HotImageID, *PressedImageID and *DisabledImageID are pointers to the image data for the various unselected states.

*SelectedImageID, *HotSelectedImageID and *PressedSelectedImageID are pointers to the image data for the various selected states.

Skin.i specifies what skin the ToggleButtonEx will use and can be a handle to a skin or one of the following values: zero will render the ToggleButtonEx using the default system button skin and #BUTTONEX_STICKYSKIN will also render using the system button skin except make the button stay pressed when selected. Please see Skin States & Properties for creating/editing ToggleButtonEx skins.

When the ToggleButtonEx is clicked, a #WM_COMMAND message will be posted to WindowID's message queue containing the ToggleButtonID, which can be detected as a PureBasic #PB_Event_Menu event.

The current "toggled" state can be retrieved or set using the GetButtonExState and SetButtonExState commands.

 

Returns the WindowsID (HWND) of the ToggleButtonEx (or if #ProGUI_Any is used the ToggleButtonEx ID) or zero for failure.

 

 

ButtonEx Index