WinXToolbar_AddButton


WinXToolbar_AddButton (hToolbar, commandId, iImage, STRING tooltipText, buttonType, optional, moveable)

Adds a button to a toolbar.

Parameter Description
hToolbar The handle to the toolbar to add the button to
commandId The unique identifier to associate with this button. When the button is clicked, the onCommand callback is invoked (assuming it has been registered) with the id parameter set to this value.
iImage The 0 based index of the image to use for this button
STRING tooltipText The text to appear in the tooltip assosiated with this button. If you are not using tooltips, set this to the empty string.
optional NOT IMPLEMENTED, SET TO $$FALSE
moveable NOT IMPLEMENTED, SET TO $$FALSE

Returns

$$TRUE on success or $$FALSE on fail

Remarks

The toolbar displays buttons in the order they are added.

The iImage parameter is a 0 based index to the button image. If you created the toolbar with WinXNewToolbarUsingIls, this is the index into the image list. If you created the toolbar with WinXNewToolbar this is the index of the image in the bitmap specified in the hBmpButtons parameter. The button images are arranged in a row in that bitmap, the first is button 0, the next button 1 etc.

Tooltips are strictly one line only, don't make them too long.

Examples

'define a constant for the command id
$$ID_BUTTON1 = 100

'add a button to a toolbar
WinXToolbar_AddButton (hToolbar, $$ID_BUTTON1, 0, "This is the first button", 0, $$FALSE, $$FALSE)

Related Links

WinXNewToolbar
WinXNewToolbarUsingIls
WinXToolbar_AddToggleButton
WinXToolbar_AddSeperator
WinXToolbar_AddControl