GUI

Basic Controls

The basic control layer covers the standard form widgets: buttons, editable text fields, combos, popup selectors, sliders, progress bars, and spinner-like up/down controls. These are the main native-backed building blocks used throughout the demos and the higher-level layout system.

Relevant Source Files

Action and State Controls

button.h exposes multiple shapes behind one type: push, check, tri-state check, radio, flat, and flatgle. A button can carry text, alternate text, image, alternate image, tooltip, font, tag value, and custom padding, then report activation through button_OnClick(...).

The stateful variants reuse the same API surface through button_state(...) and button_get_state(...), which is why DBind enum/bool integration can map naturally into them.

Editable Text Controls

Edit covers both single-line and multiline text entry. The API includes filter, change, and focus listeners, text/font/alignment configuration, password mode, editable toggling, autoselect, explicit selection, placeholder text and style, separate normal/focus colors, padding, and clipboard commands.

Combo combines an editable text surface with a list model. It keeps the edit-style APIs for filtering, focus, placeholder, clipboard, and text selection, then adds item management and a distinct OnSelect event for list choices.

Choice Controls

Control Main API Shape Best Fit
PopUp List management plus popup_OnSelect, tooltip, selected index, and per-item text/image. Fixed selection from a dropdown without free typing.
Combo Edit-like text API plus list elements and combo_OnSelect. Hybrid input where the user can type or choose from known values.
Button groups Radio/check state through the shared button API. Compact boolean or mutually exclusive choices inside layouts.

Range, Increment, and Status Widgets

Slider supports horizontal or vertical orientation, logical step count, length, tooltip, and normalized value access. Progress focuses on display only, with explicit width, determinate value, and an undefined/running mode for busy state.

UpDown is intentionally small: it is an increment/decrement trigger that exposes a click listener and tooltip, and it often works in concert with DBind numeric metadata instead of carrying its own full numeric model.

Binding and Layout Implications

The layout/binding layer adds some behavior automatically. When an edit box is bound to a numeric member, layout.c enables edit_autoselect(...). When a popup or listbox is bound to an enum and currently has no items, the binding layer can populate the choices from DBind aliases.

That is why these controls remain simple at the header level: richer behavior often comes from the surrounding layout and DBind context.