Adds an icon button to the toolbar with specified properties.
Takes toolbarID (Int), text (String), buttonID (Int), imageIndex (Int), and enabled (Int).
Returns 1 on success, 0 if toolbar not found.
BGI GUI
Parameters & Returns
Parameters
toolbarIDInt
textString
buttonIDInt
imageIndexInt
enabledInt
Returns
Int
Quick Summary
Adds an icon button to the toolbar with specified properties.
Takes toolbarID (Int), text (String), buttonID (Int), imageIndex (Int), and enabled (Int).
Returns 1 on success, 0 if toolbar not found.
Technical Exegesis...
Adds an icon button to a toolbar control with specified image, command ID, and enabled state. Searches gizmoMap for the toolbar ID. Creates TBBUTTON structure with ZeroMemory initialization. Sets iBitmap to imageIndex (icon from image strip). Sets idCommand to buttonID (command ID sent in click events). Sets fsState to TBSTATE_ENABLED if enabled is non-zero, 0 if disabled. Sets fsStyle to BTNS_BUTTON (standard button, no autosize). Sets iString to -1 (no text label, icon only).
Adds an icon button to a toolbar control with specified image, command ID, and enabled state. Searches gizmoMap for the toolbar ID. Creates TBBUTTON structure with ZeroMemory initialization. Sets iBitmap to imageIndex (icon from image strip). Sets idCommand to buttonID (command ID sent in click events). Sets fsState to TBSTATE_ENABLED if enabled is non-zero, 0 if disabled. Sets fsStyle to BTNS_BUTTON (standard button, no autosize). Sets iString to -1 (no text label, icon only). Sends TB_ADDBUTTONS message with button structure. Returns 1 on success, 0 if toolbar not found.
This function adds a button to the toolbar using an icon from the image strip loaded with bgiSetToolbarImageStrip. imageIndex is 0-based (0 = first icon, 1 = second icon, etc.). buttonID is a user-defined command identifier sent in BGI_EVENT_COMMAND_CLICK events when clicked. enabled controls initial state (non-zero = enabled/clickable, 0 = disabled/grayed). Buttons are added sequentially left-to-right. Text parameter currently unused (icon-only buttons). Use bgiEnableToolbarButton to change enabled state later. Disabled buttons appear grayed and don't respond to clicks.