widgets
widgets
Section titled “widgets”Classes
Section titled “Classes”| Name | Description |
|---|---|
Button | A clickable button widget. |
Container | A widget that arranges child widgets using a layout engine. |
Dropdown | A focusable widget that shows a popup list of options when opened. |
DropdownPopup | The floating list that appears when a Dropdown is opened. Managed by OverlayManager, not added to the widget tree directly. |
Input | A text input widget for user text entry. |
Label | A read-only text display widget. |
Modal | A full-screen dimmed overlay with a centered content box. |
Navigator | A screen navigation widget that manages a stack of screens. |
ScrollView | A clipping container that lets a child widget be scrolled inside a fixed viewport. |
TextArea | A multiline text input widget. |
TextView | A read-only multiline text widget. |
DialogButton | Describes a button in a dialog. |
Enumerations
Section titled “Enumerations”| Name | Description |
|---|---|
TextFlowMode | Determines how text is displayed when it exceeds the available width. |
TextFlowMode
Section titled “TextFlowMode”enum TextFlowModeDetermines how text is displayed when it exceeds the available width.
| Value | Description |
|---|---|
Scroll | |
Wrap |
Functions
Section titled “Functions”| Return | Name | Description |
|---|---|---|
void | showDialog | Shows a modal dialog with a title, message, and buttons. |
void | showModal | Helper to push a modal onto the overlay stack. |
void | closeModal | Helper to close the topmost overlay (modal or otherwise). |
showDialog
Section titled “showDialog”void showDialog(const std::string & title, const std::string & message, std::vector< DialogButton > buttons)Shows a modal dialog with a title, message, and buttons.
The dialog closes automatically when any button is clicked. Pressing Escape closes it if a cancel/close button exists.
Example Usage:
showDialog("Confirm", "Are you sure?", { {"Yes", [&](/api/widgets) { doThing(); }, true}, {"No", [](/api/widgets) {} }});showModal
Section titled “showModal”void showModal(std::shared_ptr< core::Widget > content, std::function< void()> onClose, bool dismissable)Helper to push a modal onto the overlay stack.
closeModal
Section titled “closeModal”void closeModal()Helper to close the topmost overlay (modal or otherwise).