UIPopups.h file
Popups: content drawn above everything else, outside its parent's clip.
ui.Tooltip("What this does."); // on hover after a delay, or at once on keyboard focus ui.Menu([](UI& ui) { ui.MenuItem("Rebuild", [] { ... }); }); // on click, or accept when focused ui.ContextMenu([](UI& ui) { ... }); // on right click, at the pointer ui.Popup(open, {}, [](UI& ui) { ... }); // while `open` is true
Declare one inside the element it belongs to, or right after a widget with no inside (button, label, slider). Content is built when the popup opens and destroyed when it closes; capture by value.
A popup is its own small document. The host decides whether it is a layer over the owning document or a separate OS window; authoring code is the same either way.
Menus and Popups capture the pointer and keyboard while open: arrows and Tab move within, accept activates, and Escape or a press outside closes and restores focus. Tooltips take no input.
Namespaces
- namespace GGUI
Classes
- struct GGUI::PopupProps
- Properties of a popup: where it goes by what it belongs to.
- struct GGUI::DialogProps
- Properties of ui.Dialog: a modal dialog, centred in the window. Nothing behind it takes input until it closes.
- struct GGUI::AskProps
- Properties of ui.Ask: a dialog with a message and one button per choice.
- struct GGUI::MenuItemProps
- Properties of ui.MenuItem.
- struct GGUI::CarouselProps
- Properties of ui.Carousel: one option shown, with arrows to the others.
- struct GGUI::DropdownProps
- Properties of ui.Dropdown: the chosen option, and a menu of the others.
- struct GGUI::ChoiceProps
- Properties of ui.Choice: every option shown, one chosen.