Creates a clickable push button control.
Takes text (String), x (Int), y (Int), width (Int), height (Int), and parentWin (Int).
Returns gizmo ID on success, 0 if parent not found.
BGI GUI
Parameters & Returns
Parameters
textString
xInt
yInt
widthInt
heightInt
parentWinInt
Returns
Int
Quick Summary
Creates a clickable push button control.
Takes text (String), x (Int), y (Int), width (Int), height (Int), and parentWin (Int).
Returns gizmo ID on success, 0 if parent not found.
Technical Exegesis...
Creates a standard push button control. Searches gizmoMap for parent window HWND. Handles scroll panel parents with GetActualParentHWND. Auto-increments gizmoIDCount. Creates button using CreateWindow with "BUTTON" class and WS_TABSTOP | WS_VISIBLE | WS_CHILD | BS_PUSHBUTTON style. Sets global GUI font with WM_SETFONT. Creates CGizmo structure with GIZMO_BUTTON type, stores position, dimensions, text, and state (visible=true, enabled=true, checkable=false).
Creates a standard push button control. Searches gizmoMap for parent window HWND. Handles scroll panel parents with GetActualParentHWND. Auto-increments gizmoIDCount. Creates button using CreateWindow with "BUTTON" class and WS_TABSTOP | WS_VISIBLE | WS_CHILD | BS_PUSHBUTTON style. Sets global GUI font with WM_SETFONT. Creates CGizmo structure with GIZMO_BUTTON type, stores position, dimensions, text, and state (visible=true, enabled=true, checkable=false). Returns gizmo ID on success, 0 if parent not found.
Buttons generate BGI_EVENT_COMMAND_CLICK events when clicked. The event ID will be the button's gizmo ID (retrieve with bgiGetEventID). Use bgiSetGizmoText to change button text. Use bgiSetGizmoVisibility to show/hide. Buttons use the default GUI font set in bgiInitBGI. Position is relative to parent window/panel.