Button
int guiAddButton(int gui_id, int pos_x, int pos_y, int width, int height, string text,
color text_color = clrBlack,
uint text_style = GUI_TEXT_NONE,
string font_name = "Segoe UI",
int font_size = 10,
color bg_color = clrWhite,
int border_style = GUI_BORDER_3D,
int border_width = 2,
color border_color1 = GUI_AUTO,
color border_color2 = GUI_AUTO);
| Topic | Notes |
|---|---|
| Defaults | 3D border, width 2; GUI_OBJPROP_BORDER_COLOR2 affects inner bevel shadow on 3D buttons only. |
| Clicks | guiIsClicked edge-triggered. |
| State | GUI_OBJPROP_ENABLED. |
int button = guiAddButton(gui_id, 10, 10, 100, 30, "OK");
Checkbox
int guiAddCheckbox(int gui_id, int pos_x, int pos_y, int width, int height, string text,
color text_color = clrBlack,
uint text_style = GUI_TEXT_NONE,
string font_name = "Segoe UI",
int font_size = 10,
color bg_color = clrWhite,
int border_style = GUI_BORDER_FLAT,
int border_width = 2,
color border_color1 = GUI_AUTO,
color border_color2 = GUI_AUTO,
bool initial_checked = false);
| Topic | Notes |
|---|---|
initial_checked |
Applied only on first attach (skipped when autostate restored a value). |
| State | GUI_OBJPROP_CHECKED (0/1), GUI_OBJPROP_ENABLED. |
| Clicks | guiIsClicked on toggle. |
int checkbox = guiAddCheckbox(gui_id, 10, 50, 140, 24, "Enable feature", clrBlack, GUI_TEXT_NONE,
"Segoe UI", 10, clrWhite, GUI_BORDER_FLAT, 2, GUI_AUTO, GUI_AUTO, true);
Radio (+ Groups)
int guiAddRadio(int gui_id, int pos_x, int pos_y, int width, int height, string text,
color text_color = clrBlack,
uint text_style = GUI_TEXT_NONE,
string font_name = "Segoe UI",
int font_size = 10,
color bg_color = clrWhite,
int radio_group = 0,
int border_style = GUI_BORDER_FLAT,
int border_width = 2,
color border_color1 = GUI_AUTO,
color border_color2 = GUI_AUTO,
bool initial_selected = false);
int guiAddRadioGroup(int gui_id);
| Topic | Notes |
|---|---|
initial_selected |
First attach only; use on one radio per group. |
| Groups | Set GUI_OBJPROP_RADIO_GROUP or pass radio_group parameter. |
| State | GUI_OBJPROP_CHECKED (selected), GUI_OBJPROP_RADIO_GROUP. |
int radio_group = guiAddRadioGroup(gui_id);
int radio1 = guiAddRadio(gui_id, 10, 10, 80, 22, "A", clrBlack, GUI_TEXT_NONE,
"Segoe UI", 10, clrWhite, grp, GUI_BORDER_FLAT, 2, GUI_AUTO, GUI_AUTO, true);
int radio2 = guiAddRadio(gui_id, 10, 36, 80, 22, "B", clrBlack, GUI_TEXT_NONE,
"Segoe UI", 10, clrWhite, grp);
Label
int guiAddLabel(int gui_id, int pos_x, int pos_y, int width, int height, string text,
color text_color = clrBlack,
uint text_style = GUI_TEXT_NONE,
string font_name = "Segoe UI",
int font_size = 10,
color bg_color = clrWhite,
int border_style = GUI_BORDER_FLAT,
int border_width = 2,
color border_color1 = GUI_AUTO,
color border_color2 = GUI_AUTO);
Static text; not clickable via guiIsClicked. Default alignment: left + top.
Text
int guiAddText(int gui_id, int pos_x, int pos_y, int width, int height, string text,
color text_color = clrBlack,
uint text_style = GUI_TEXT_NONE,
string font_name = "Segoe UI",
int font_size = 10,
color bg_color = clrWhite,
int border_style = GUI_BORDER_FLAT,
int border_width = 2,
color border_color1 = GUI_AUTO,
color border_color2 = GUI_AUTO);
Custom-painted filled region (useful for status lines). Not in the guiIsClicked set.
Edit
int guiAddEditbox(int gui_id, int pos_x, int pos_y, int width, int height, string text,
color text_color = clrBlack,
uint text_style = GUI_TEXT_NONE,
string font_name = "Segoe UI",
int font_size = 10,
color bg_color = clrWhite,
int border_style = GUI_BORDER_FLAT,
int border_width = 2,
color border_color1 = GUI_AUTO,
color border_color2 = GUI_AUTO);
| Topic | Notes |
|---|---|
| Live text | guiObjectGetString(..., GUI_OBJPROP_TEXT) reads the live field content while the user types. |
| Alignment | GUI_OBJPROP_TEXT_H_ALIGN applied; GUI_OBJPROP_TEXT_V_ALIGN is stored but not applied by the native edit field. |
| Clicks | guiIsClicked on focus click. |
int edit_h = guiAddEditbox(gui_id, 10, 10, 200, 24, "default");
// Later in OnCalculate:
string s = guiObjectGetString(gui_id, edit_h, GUI_OBJPROP_TEXT);
DropDown
int guiAddDropDown(int gui_id, int pos_x, int pos_y, int width, int drop_down_max_height,
string &dropdown_items[],
int selected_index = -1,
string placeholder = "",
color text_color = clrBlack,
uint text_style = GUI_TEXT_NONE,
string font_name = "Segoe UI",
int font_size = 10,
color bg_color = clrWhite,
int border_style = GUI_BORDER_3D,
int border_width = 2,
color border_color1 = GUI_AUTO,
color border_color2 = GUI_AUTO);
| Topic | Notes |
|---|---|
drop_down_max_height |
Max height of the drop list in logical pixels (closed field height is separate). |
| Rows | Use row helpers (DropDown lists); do not set row text via guiObjectSetString on GUI_OBJPROP_DROPDOWN_ITEM. |
| Selection | GUI_OBJPROP_DROPDOWN_SEL (-1 = none); GUI_OBJPROP_DROPDOWN_PLACEHOLDER when none selected. |
| Clicks | guiIsClicked on selection change / list open. |
string items[] = {"One", "Two", "Three"};
int dd = guiAddDropDown(gui_id, 10, 80, 160, 120, items, 0, "Pick one…");
Link
int guiAddLink(int gui_id, int pos_x, int pos_y, int width, int height,
string text, string url,
color text_color = clrBlack,
uint text_style = GUI_TEXT_UNDERLINE,
string font_name = "Segoe UI",
int font_size = 10,
color bg_color = clrWhite,
int border_style = GUI_BORDER_FLAT,
int border_width = 2,
color border_color1 = GUI_AUTO,
color border_color2 = GUI_AUTO);
Default text_style includes GUI_TEXT_UNDERLINE. Set GUI_OBJPROP_URL. Click opens the URL in your browser; guiIsClicked fires.
GroupBox
int guiAddGroupBox(int gui_id, int pos_x, int pos_y, int width, int height,
string text = "",
color text_color = clrBlack,
uint text_style = GUI_TEXT_NONE,
string font_name = "Segoe UI",
int font_size = 10,
color bg_color = clrWhite,
int border_width = 1,
color border_color = GUI_AUTO);
Decorative only — objects placed visually inside the frame are not children; they remain siblings. Use for visual grouping only. Empty text draws a captionless frame.