|
TachyonUI 0.1.0
High-performance UI for building tools.
|
The application: owns the windows, the systems and the frame loop. More...
#include <gui_controls/gui_application.h>
Classes | |
| struct | FrameTimingSample |
| Rolling per-frame timing history in ms, recorded only while profiling is enabled. More... | |
| class | Scope |
| A container's scope: its End runs when the scope leaves (or at End()). More... | |
| struct | SettingsPanelState |
| What RenderSettingsPanel shows: its pages, the selected one and the tree width. More... | |
Public Attributes | |
| std::unique_ptr< InputManager > | inputManager |
| Routes input events to the elements; also holds global handlers. Created by Initialize. | |
| std::unique_ptr< LayoutEngine > | layoutEngine |
| Lays out the elements each frame. Created by Initialize. | |
| std::unique_ptr< OSWindowManager > | windowManager |
| The OS windows and their render contexts. Created by Initialize. | |
| std::unique_ptr< TextAtlasManager > | textAtlasManager |
| The glyph atlas. Created by Initialize. | |
| std::unique_ptr< IClipboard > | clipboard |
| from SetClipboard | |
| ITextSystem * | textSystem { nullptr } |
| Shapes, measures and edits text. Created by Initialize. | |
| IWindowBackend * | windowBackend { nullptr } |
| SetWindowBackend's windows plus render-to-image windows. | |
| GraphicsContext * | graphicsContext { nullptr } |
| the backend from SetGraphicsBackend | |
| GUIRenderer * | guiRenderer { nullptr } |
| The graphics backend's renderer. | |
| IDManager | idManager {} |
| Element IDs: static ones (CreateStaticID), call-site ones (AllocateDynamicID) and parent scopes (PushParent / PopParent). | |
| GUIStateManager | guiStateManager {} |
| Per-element interaction state (hover, focus, clicks) and the construction stacks (disabled, selected). | |
| TransitionManager | transitionManager {} |
| In-progress visual state transitions, per element. | |
| TabChainManager | tabChainManager {} |
| The Tab-key focus order, rebuilt each frame. | |
| MenuManager | menuManager {} |
| The open menus and the menu bar's triggers. | |
| TooltipManager | tooltipManager {} |
| When a tooltip shows (delaySeconds) and for which element. | |
Friends | |
| class | GUIApplicationInternals |
| GUIApplicationInternals (gui_application_internal.h) re-exposes these to the library's own code and the tests. | |
Setup and resources | |
| using | InitializeOptions = GUIApplicationInitializeOptions |
| See GUIApplicationInitializeOptions. | |
| virtual | ~GUIApplication ()=default |
| See GUIApplicationInitializeOptions. | |
| virtual Result< void > | Initialize (const InitializeOptions &options={}) |
| Creates the backends not set before, the window manager, the text system and the subsystems, and loads the theme. | |
| virtual void | Cleanup () |
| Releases what Initialize created, including the backends set before it. | |
| Result< void > | InitializeStyles () |
| Loads the current theme at the current font scale; an error when it can't be opened. | |
| virtual void | OnStylesReloaded () |
| Called after every successful theme/font reload (and by subclasses at startup) to re-register styles/icons the reload wiped. | |
| void | RequestReloadTheme (std::string_view themePath, float fontScale) |
| Deferred to the start of the next frame; safe from event handlers. | |
| const Result< void > & | ThemeReloadResult () const |
| How the last reload went; on an error the previous theme stays. | |
| const std::string & | GetThemePath () const |
| See GUIApplicationInitializeOptions. | |
| void | SetResourceRoot (std::string_view root) |
| The folder the resources load from: compiled shaders, default fonts and relative theme paths. | |
| const std::string & | GetResourceRoot () const |
| See GUIApplicationInitializeOptions. | |
State | |
| GradientManager | gradientManager {} |
| GPU pages for the gradients styles use. | |
| StyleManager | styleManager { gradientManager } |
| The registered styles; Px converts CSS pixels to pixels at the UI scale. | |
| ElementStorage | elementStorage { styleManager, &guiStateManager.GetElementDataStore() } |
| This frame's element tree. | |
| WindowRegistry | windowRegistry {} |
| The elements of each window, filled as the windows are built. | |
| CommandManager | commandManager {} |
| Commands, their shortcuts and the undo history. | |
| InputHandlerBroadcaster | inputBroadcaster {} |
| Sends each platform input event to the input manager and the text system. | |
| OnGuiFunc | onGui {} |
| Runs a frame from inside the OS's modal resize loop, so windows repaint while resized. | |
| GUITheme | theme {} |
| The loaded theme: the style refs, icons and metrics the controls use; theme.GetStyle finds a CSS class. | |
| bool | applicationQuit = false |
| Set to true to end Run (UpdateFrame then returns false). | |
| std::chrono::steady_clock::time_point | m_frameStart {} |
| Internal: when the current frame started (set by UpdateFrame). | |
| float | frameTime = 0.0f |
| The last frame's duration in seconds, including any vsync wait. | |
| float | frameBuildTime = 0.0f |
| CPU work per frame, excluding the vsync stall in present. | |
| static constexpr int | kFrameHistoryCount = 240 |
| ~4s @ 60fps | |
| void | GetFrameTimingHistory (std::span< FrameTimingSample > out) const |
| Copies the ring chronologically (oldest first) into out. | |
Panels and floating windows | |
| void | CreatePanel (std::unordered_map< tachyon::ID, tachyon::Panel > &panels, ID id, std::string title, tachyon::IconID icon, std::function< void()> onPanelGUI, std::string panelType={}, std::function< void()> onEnable={}, std::function< void()> onDisable={}) |
| Adds a panel to panels (usually a DockingLayout's). | |
| tachyon::ID | CreatePanel (std::unordered_map< tachyon::ID, tachyon::Panel > &panels, std::string title, tachyon::IconID icon, std::function< void()> onPanelGUI, std::string panelType={}, std::function< void()> onEnable={}, std::function< void()> onDisable={}) |
| As above, with a new static ID, which it returns. | |
| void | DisableAllPanels (DockingLayout &layout) |
| Panel lifecycle. | |
| void | EmitFloatingToolbarWindows (std::vector< struct FloatingToolbarItem > &floatingItems, const struct FloatingToolbarOptions *options=nullptr) |
| One OS window per floating toolbar. Closed windows are erased and their IDs released. | |
| DockLeafResult | FindDockLeafAtScreenPos (tachyon::int2 screenPos) |
| Dock leaf whose tab bar contains screenPos, plus its owning layout (needed by TransferPanel for cross-layout drops). | |
| DockDropResult | FindDockDropTargetAtScreenPos (tachyon::int2 screenPos) |
| Hit-tests leaf content areas; falls back to tab bars with zone=Center. | |
| void | EmitFloatingDockWindows () |
| Call from OnGUI after the main docking container. Empty windows are closed. | |
| void | EmitFloatingDockWindows (const DocumentSet &documents) |
| With documents in several main windows: in each, after its Documents, the windows of the panels torn from its documents. | |
| bool | FloatPanel (DockingLayout &layout, ID panelID, int2 screenPos) |
| Moves a docked panel into its own window at a screen position, as tearing its tab off does; the window's Dock button returns it. | |
| void | CloseFloatingDockWindow (size_t index) |
| Closes the window for good: its panels are disabled and destroyed. | |
| void | CloseDockedPanel (DockingLayout &layout, DockNode &leaf, int tabIndex) |
| Closes the panel at tabIndex of a docked leaf, as the tab's Close action does. | |
| Document & | CreateDocument (DocumentSet &set, std::string name, std::string extension, std::string kind, tachyon::IconID icon) |
| Adds a document at the end of set, with new static IDs and an empty layout, which the caller fills (CreatePanel, MakeLeaf). | |
| void | CloseDocument (DocumentSet &set, int index) |
| Closes set's document at index for good: its panels are disabled and destroyed, its torn-off panel windows closed, its IDs released and its layout no longer saved (PersistDocking). | |
| static void | TransferPanel (tachyon::ID panelID, tachyon::DockNode *sourceNode, DockingLayout *sourceLayout, DockingLayout *targetLayout) |
| Moves a panel from sourceNode/sourceLayout to targetLayout, fixing up selectedTab. | |
Input for render-to-image windows | |
| void | InjectMouseMove (ID windowID, int2 pos, KeyModifier mods=KeyModifier::None) |
| Input for render-to-image windows (WindowFlags::RenderToImage), which get none from the OS. | |
| void | InjectMouseButton (ID windowID, int2 pos, MouseButtons button, bool down, KeyModifier mods=KeyModifier::None) |
| A button press (down) or release at pos. | |
| void | InjectMouseScroll (ID windowID, int2 pos, float2 offset, KeyModifier mods=KeyModifier::None) |
| A wheel scroll by offset at pos. | |
| void | InjectMouseLeave (ID windowID) |
| The pointer left the window. | |
| void | InjectFocus (ID windowID, bool focused) |
| Gives the window keyboard focus, or takes it away. | |
| void | InjectKey (ID windowID, KeyCode key, KeyAction action, KeyModifier mods=KeyModifier::None) |
| A key event; typed text goes through InjectText. | |
| void | InjectText (ID windowID, std::string_view utf8) |
| Typed text, one character event per codepoint. | |
| Result< void > | ReadWindowPixels (ID windowID, std::span< uint8_t > bgra) |
| The last rendered frame of a render-to-image window: BGRA8, tightly packed rows, bgra holding width x height x 4 bytes of its pixel size. | |
Backends, styles and scale | |
| void | SetGraphicsBackend (std::unique_ptr< GraphicsContext > backend) |
| The graphics backend Initialize uses; without one it creates a vulkan::VulkanGraphicsContext. | |
| void | SetWindowBackend (std::unique_ptr< IWindowBackend > backend) |
| The OS windows and their input; Initialize wraps it to add render-to-image windows. | |
| void | SetClipboard (std::unique_ptr< IClipboard > clipboardImpl) |
| Copy and paste for text fields. | |
| void | SetAllocationHooks (const AllocationHooks &hooks) |
| Host memory functions for what can be routed: Vulkan objects, VMA, vk-bootstrap and SDL (only when the GUI starts SDL). | |
| void | SetStyleFiles (std::span< const std::string_view > files) |
| The CSS rule files loaded after the palette, in order; relative paths are next to the palette file. | |
| float | GetGlobalFontScale () const |
| The graphics backend Initialize uses; without one it creates a vulkan::VulkanGraphicsContext. | |
| void | SetUIScale (float scale) |
| Extra UI zoom on top of the main window's display scale (1 follows the OS). | |
| float | GetUIScale () const |
| The graphics backend Initialize uses; without one it creates a vulkan::VulkanGraphicsContext. | |
| void | SetReducedMotion (std::optional< bool > reduced) |
| Reduced motion: changes of state show at once instead of blending. | |
| bool | IsThemeCrossfading () const |
| True while a theme switch is crossfading (the old look fading out over the new). | |
| bool | IsReducedMotion () const |
| Whether changes of state show at once now. | |
The frame | |
| virtual void | OnGUI ()=0 |
| Builds the UI; called each frame. | |
| Result< void > | Run () |
| Loops over the frame calls below until the app quits; an error when the GPU device was lost and couldn't be made again (a host's device). | |
| bool | UpdateFrame () |
| One frame, for a host with its own main loop: | |
| Result< void > | RecordFrame () |
| See UpdateFrame. | |
| void | PresentFrame () |
| See UpdateFrame. | |
Event handlers and control building blocks | |
| tachyon::EventHandler | MakeToggleHandler (bool &toggle) |
| A handler that flips toggle on click. | |
| tachyon::EventHandler | MakeButtonHandler (std::function< void()> onClick) |
| A handler that calls onClick on click. | |
| tachyon::EventHandler | MakeLabelHandler () |
| A label's handler: a click focuses the control the label belongs to. | |
| tachyon::ElementRef | RegisterElement (tachyon::Element &&element, LayoutOverride &&constraints) |
| Adds an element, with its interaction state, to the current window; for custom elements. | |
| tachyon::ElementRef | RegisterElement (tachyon::Element &&element, std::string_view text, LayoutOverride &&constraints) |
| As above, with Text registered as its text. | |
| bool | TakeEscapeFor (ID popupWindowID, ID triggerID) |
| While building a popup's trigger: true, and the key taken, when Escape was pressed this frame with the keyboard in the popup's window or on the trigger. | |
| tachyon::ElementRef | RegisterControl (tachyon::Element &&element, LayoutOverride &&constraints) |
| As RegisterElement, for a control: it joins the Tab order and needs a valid ID. | |
| tachyon::ElementRef | RegisterControl (tachyon::Element &&element, std::string_view text, LayoutOverride &&constraints) |
| As above, with Text registered as its text. | |
| tachyon::ElementRef | RegisterControl (tachyon::Element &&element, std::function< TextID(tachyon::Element &element)> createTextID, LayoutOverride &&constraints) |
| As above; createTextID registers the text, given the element with its current state. | |
| tachyon::ElementRef | MenuItemRow (ID id, tachyon::EventHandler handler, StyleRef rowStyle, bool reserveIcon, IconID icon, std::string_view text, std::string_view trailing, StyleRef trailingStyle, LayoutOverride &&constraints, bool destructive=false) |
| A menu row: an icon slot, the label and a trailing text (a shortcut or a submenu arrow). | |
| bool | MenuItemImpl (ID id, const GUIContent &content, std::string_view shortcut, std::function< void()> onClick, StyleRef style, bool destructive, LayoutOverride &&constraints) |
| SearchField, also giving the ID of its text field (to focus it). | |
| void | ShowContentTooltip (ID id, const GUIContent &content) |
| The content's tooltip, if it has one, on the control id. | |
| bool | BeginIndeterminate () |
| Value fields emitted in between show a dash for mixed values (e.g. | |
| void | EndIndeterminate () |
| Closes BeginIndeterminate. | |
Buttons and toggles | |
| bool | Button (ID id, const GUIContent &content, std::function< void()> onClick, StyleRef style, LayoutOverride &&constraints={}) |
| Controls take (id, icon, text, ..., style, constraints), each part optional. | |
| bool | Button (ID id, const GUIContent &content, std::function< void()> onClick, LayoutOverride &&constraints={}) |
| As above, in the theme's button style. | |
| bool | Button (const GUIContent &content, std::function< void()> onClick, StyleRef style, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID. | |
| bool | Button (const GUIContent &content, std::function< void()> onClick, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID, in the theme's button style. | |
| bool | CommandButton (CommandID command, StyleRef style, LayoutOverride &&constraints={}) |
| Icon button for a command; the tooltip shows its name and shortcut, e.g. "Undo (Ctrl+Z)". | |
| bool | CommandButton (CommandID command, LayoutOverride &&constraints={}) |
| As above, in the theme's button style. | |
| bool | Checkbox (ID id, bool value, std::string_view text, std::function< void(bool)> onToggle, StyleRef style, LayoutOverride &&constraints={}) |
| A checkbox (a box, checked with a tick) and its label; a click calls onToggle with the new value. | |
| bool | Checkbox (ID id, bool value, std::string_view text, std::function< void(bool)> onToggle, LayoutOverride &&constraints={}) |
| As above, in the theme's checkbox style. | |
| bool | Checkbox (bool value, std::string_view text, std::function< void(bool)> onToggle, StyleRef style, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID. | |
| bool | Checkbox (bool value, std::string_view text, std::function< void(bool)> onToggle, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID, in the theme's checkbox style. | |
| bool | Checkbox (ID id, bool &value, std::string_view text, StyleRef style, LayoutOverride &&constraints={}) |
| Checks and unchecks value itself. | |
| bool | Checkbox (ID id, bool &value, std::string_view text={}, LayoutOverride &&constraints={}) |
| As above, in the theme's checkbox style. | |
| bool | Checkbox (bool &value, std::string_view text, StyleRef style, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID. | |
| bool | Checkbox (bool &value, std::string_view text={}, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID, in the theme's checkbox style. | |
| bool | Switch (ID id, bool value, std::string_view text, std::function< void(bool)> onToggle, StyleRef style, LayoutOverride &&constraints={}) |
| An on/off switch (track and knob) with an optional label after it, e.g. "On". | |
| bool | Switch (ID id, bool value, std::string_view text, std::function< void(bool)> onToggle, LayoutOverride &&constraints={}) |
| As above, in the theme's switch style. | |
| bool | Switch (bool value, std::string_view text, std::function< void(bool)> onToggle, StyleRef style, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID. | |
| bool | Switch (bool value, std::string_view text, std::function< void(bool)> onToggle, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID, in the theme's switch style. | |
| bool | Switch (ID id, bool &value, std::string_view text, StyleRef style, LayoutOverride &&constraints={}) |
| Switches value itself. | |
| bool | Switch (ID id, bool &value, std::string_view text={}, LayoutOverride &&constraints={}) |
| As above, in the theme's switch style. | |
| bool | Switch (bool &value, std::string_view text, StyleRef style, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID. | |
| bool | Switch (bool &value, std::string_view text={}, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID, in the theme's switch style. | |
| bool | Toggle (ID id, bool value, const GUIContent &content, std::function< void(bool)> onToggle, StyleRef style, LayoutOverride &&constraints={}) |
| A button that shows pressed while value is on; a click calls onToggle with the new value. | |
| bool | Toggle (ID id, bool value, const GUIContent &content, std::function< void(bool)> onToggle, LayoutOverride &&constraints={}) |
| As above, in the theme's toggle style. | |
| bool | Toggle (bool value, const GUIContent &content, std::function< void(bool)> onToggle, StyleRef style, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID. | |
| bool | Toggle (bool value, const GUIContent &content, std::function< void(bool)> onToggle, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID, in the theme's toggle style. | |
| bool | Toggle (ID id, bool &value, const GUIContent &content, StyleRef style, LayoutOverride &&constraints={}) |
| Toggles value itself. | |
| bool | Toggle (ID id, bool &value, const GUIContent &content, LayoutOverride &&constraints={}) |
| As above, in the theme's toggle style. | |
| bool | Toggle (bool &value, const GUIContent &content, StyleRef style, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID. | |
| bool | Toggle (bool &value, const GUIContent &content, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID, in the theme's toggle style. | |
Menus and message dialogs | |
| bool | BeginMenu (ID id, std::string_view text, StyleRef buttonStyle, StyleRef menuStyle, StyleRef itemStyle, LayoutOverride &&constraints={}) |
| A menu: a trigger button (in a menu bar or on its own), or a submenu item inside another menu. | |
| bool | BeginMenu (ID id, std::string_view text, LayoutOverride &&constraints={}) |
| As above, in the theme's menu styles. | |
| bool | BeginMenu (std::string_view text, StyleRef buttonStyle, StyleRef menuStyle, StyleRef itemStyle, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID. | |
| bool | BeginMenu (std::string_view text, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID, in the theme's menu styles. | |
| bool | Dropdown (ID id, int &selected, std::span< const std::string_view > options, StyleRef style, LayoutOverride &&constraints={}) |
| A dropdown: a field showing options[selected] that opens the list of options under itself. | |
| bool | Dropdown (ID id, int &selected, std::span< const std::string_view > options, LayoutOverride &&constraints={}) |
| As above, in the theme's dropdown style. | |
| bool | Dropdown (int &selected, std::span< const std::string_view > options, StyleRef style, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID. | |
| bool | Dropdown (int &selected, std::span< const std::string_view > options, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID, in the theme's dropdown style. | |
| bool | Dropdown (ID id, int &selected, std::initializer_list< std::string_view > options, LayoutOverride &&constraints={}) |
| With the options written in place: Dropdown(quality, { "Low", "Medium", "High" }). | |
| bool | Dropdown (int &selected, std::initializer_list< std::string_view > options, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID. | |
| bool | Dropdown (ID id, int &selected, std::initializer_list< std::string_view > options, StyleRef style, LayoutOverride &&constraints={}) |
| As above, in style. | |
| bool | Dropdown (int &selected, std::initializer_list< std::string_view > options, StyleRef style, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID, in style. | |
| void | MenuHeader (std::string_view text) |
| A section's name between items, e.g. "View", lined up with the labels. | |
| int | MessageDialog (ID id, const MessageDialogDesc &desc, StyleRef style) |
| A modal question with verb buttons, centered. | |
| int | MessageDialog (ID id, const MessageDialogDesc &desc) |
| As above, in the theme's message box style. | |
| int | MessageDialog (const MessageDialogDesc &desc, StyleRef style, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID. | |
| int | MessageDialog (const MessageDialogDesc &desc, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID, in the theme's message box style. | |
| ToastID | ShowToast (ToastDesc desc) |
| Shows a toast in the corner of the window that builds Toasts. | |
| ToastDesc * | FindToast (ToastID toast) |
| A shown toast's description, to change (its progress, its body); null once it's gone. | |
| void | DismissToast (ToastID toast) |
| Takes a toast away, as its close button does. | |
| void | Toasts () |
| The toasts, in the current window's bottom-right corner over what's built before; call it last in the window. | |
| void | Banner (ID id, Severity severity, const GUIContent &message, std::span< const BannerAction > actions={}, LayoutOverride &&constraints={}) |
| A banner across the top of a panel: the message (message.icon, else the severity's) on the severity's tint, then actions, right-aligned. | |
| void | Banner (Severity severity, const GUIContent &message, std::span< const BannerAction > actions={}, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID. | |
| bool | CloseRequested (ID windowID) |
| Whether the user asked to close a window flagged WindowConfirmClose (its close button, Alt+F4, the OS quitting) since last asked. | |
| void | MenuFilter () |
| A filter field for a big menu, first in it: it takes the keyboard when the menu opens, and while it holds text the items (and headers and separators) that don't contain it are left out. | |
| bool | MenuItem (ID id, const GUIContent &content, std::string_view shortcut, std::function< void()> onClick, StyleRef style, LayoutOverride &&constraints={}) |
| Optional icon, label, optional shortcut. The icon column is reserved if any sibling has an icon. | |
| bool | MenuItem (ID id, const GUIContent &content, std::function< void()> onClick=nullptr, LayoutOverride &&constraints={}) |
| As above, without a shortcut, in the theme's item style. | |
| bool | MenuItem (const GUIContent &content, std::function< void()> onClick=nullptr, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID. | |
| bool | MenuItem (ID id, const GUIContent &content, std::string_view shortcut, std::function< void()> onClick, LayoutOverride &&constraints={}) |
| With a shortcut; onClick is required so MenuItem(text, nullptr) stays unambiguous. | |
| bool | MenuItem (const GUIContent &content, std::string_view shortcut, std::function< void()> onClick, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID. | |
| bool | MenuItem (const GUIContent &content, std::string_view shortcut, std::function< void()> onClick, StyleRef style, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| With a shortcut, the call site as the ID and style. | |
| bool | MenuItem (ID id, const GUIContent &content, std::function< void()> onClick, StyleRef style, LayoutOverride &&constraints={}) |
| Without a shortcut, in style. | |
| bool | MenuItem (const GUIContent &content, std::function< void()> onClick, StyleRef style, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| Without a shortcut, with the call site as the ID, in style. | |
| bool | MenuItem (CommandID command) |
| Menu item for a command: icon, label, shortcut and callback come from the command. | |
| bool | DestructiveMenuItem (ID id, const GUIContent &content, std::string_view shortcut, std::function< void()> onClick, StyleRef style, LayoutOverride &&constraints={}) |
| An item that destroys something (Delete, Discard), in the error color. | |
| bool | DestructiveMenuItem (ID id, const GUIContent &content, std::string_view shortcut, std::function< void()> onClick, LayoutOverride &&constraints={}) |
| As above, in the theme's item style. | |
| bool | DestructiveMenuItem (const GUIContent &content, std::string_view shortcut, std::function< void()> onClick, StyleRef style, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID. | |
| bool | DestructiveMenuItem (const GUIContent &content, std::string_view shortcut, std::function< void()> onClick, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID, in the theme's item style. | |
| bool | DestructiveMenuItem (ID id, const GUIContent &content, std::function< void()> onClick, StyleRef style, LayoutOverride &&constraints={}) |
| Without a shortcut, in style. | |
| bool | DestructiveMenuItem (ID id, const GUIContent &content, std::function< void()> onClick, LayoutOverride &&constraints={}) |
| Without a shortcut, in the theme's item style. | |
| bool | DestructiveMenuItem (const GUIContent &content, std::function< void()> onClick, StyleRef style, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| Without a shortcut, with the call site as the ID, in style. | |
| bool | DestructiveMenuItem (const GUIContent &content, std::function< void()> onClick, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| Without a shortcut, with the call site as the ID, in the theme's item style. | |
| void | EndMenu () |
| Closes BeginMenu; called whether or not it returned true. | |
| bool | BeginMenuBar (ID id, StyleRef style, LayoutOverride &&constraints={}) |
| Menu bar: place BeginMenu triggers inside. | |
| bool | BeginMenuBar (ID id, LayoutOverride &&constraints={}) |
| As above, in the theme's menu bar style. | |
| bool | BeginMenuBar (LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID. | |
| bool | BeginMenuBar (StyleRef style, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID, in style. | |
| void | EndMenuBar () |
| Closes BeginMenuBar. | |
Title bar, tooltips and context menus | |
| bool | BeginTitleBar (ID id, StyleRef style, LayoutOverride &&constraints={}) |
| A menu bar the window is dragged by: what in it isn't a control is the caption (drag to move, double-click to maximize). | |
| bool | BeginTitleBar (ID id, LayoutOverride &&constraints={}) |
| As above, in the theme's title bar style. | |
| bool | BeginTitleBar (LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID. | |
| bool | BeginTitleBar (StyleRef style, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID, in style. | |
| void | EndTitleBar () |
| Closes BeginTitleBar, adding the window buttons in a custom-title-bar window. | |
| WindowHitArea | TitleBarHitTest (ID windowID, int2 screenPos) const |
| What the OS should do with a screen point of a window with a custom title bar. | |
| void | MenuSeparator () |
| Divider inside a menu or context menu. | |
| void | SetTooltip (ID targetID, std::string_view text) |
| A text tooltip on targetID, shown when the pointer rests on it. | |
| void | SetTooltip (ID targetID, IconID icon, std::string_view text) |
| As above, with an icon before the text. | |
| void | SetTooltip (std::string_view text) |
| As above, on the control just drawn (its outer element, shown over all its parts). | |
| void | SetTooltip (IconID icon, std::string_view text) |
| As above, with an icon, on the control just drawn. | |
| void | SetTooltip (ID targetID, std::string_view text, std::string_view shortcut) |
| As above, with the keyboard shortcut that does the same in a chip after the text. | |
| void | SetTooltip (ID targetID, IconID icon, std::string_view text, std::string_view shortcut) |
| As above, with an icon. | |
| void | SetTooltip (std::string_view text, std::string_view shortcut) |
| As above, for the last control. | |
| void | SetTooltip (ID targetID, const PropertyHelp &help) |
| A property's help on targetID, in a larger tooltip: its title, description and footer. | |
| void | SetTooltip (const PropertyHelp &help) |
| As above, for the last control. | |
| void | SetErrorTooltip (ID targetID, std::string_view message) |
| Why a value isn't accepted, in a tooltip on the popup surface with an error border (and arrow). | |
| void | SetErrorTooltip (std::string_view message) |
| As above, for the last control. | |
| void | SetDisabledTooltip (ID targetID, std::string_view text, std::string_view reason) |
| A text tooltip that, while targetID is disabled, also says why, on a second, muted line. | |
| void | SetDisabledTooltip (std::string_view text, std::string_view reason) |
| As above, for the last control. | |
| bool | BeginTooltip (ID targetID) |
| A tooltip with any content on targetID: build it while this returns true. | |
| bool | BeginTooltip () |
| As above, on the control just drawn. | |
| void | EndTooltip () |
| Closes BeginTooltip; called whether or not it returned true. | |
| bool | BeginContextMenu (ID targetID) |
| Context menu: opens at the pointer on a right-click on the target element, or below it on Shift+F10 or the Menu key while it has the focus. | |
| bool | BeginContextMenu () |
| As above, on the control just drawn. | |
| void | EndContextMenu () |
| Closes BeginContextMenu; called whether or not it returned true. | |
| void | OpenContextMenu (ID targetID, int2 screenPos) |
| Opens targetID's context menu at a screen point, e.g. | |
Label, button and toggle groups | |
| bool | BeginLabelGroup (ID id, CssPx defaultWidth=120, CssPx minWidth=40, CssPx maxWidth=500, bool resizable=true) |
| Label group: Labels/DragLabels inside share one width, resizable by dragging any label's right edge. | |
| bool | BeginLabelGroup (CssPx defaultWidth=120, CssPx minWidth=40, CssPx maxWidth=500, bool resizable=true, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID. | |
| void | EndLabelGroup () |
| Closes BeginLabelGroup. | |
| bool | BeginButtonGroup (LayoutOverride &&constraints={}) |
| Button / toggle group: Buttons / Field(bool) inside are restyled with .first-/.mid-/.last-* so they share borders. | |
| void | EndButtonGroup () |
| Closes BeginButtonGroup. | |
| bool | BeginToggleGroup (LayoutOverride &&constraints={}) |
| The same for Toggles and Field(bool). | |
| void | EndToggleGroup () |
| Closes BeginToggleGroup. | |
Areas, caching and layout containers | |
| bool | BeginArea (ID id, StyleRef style, LayoutOverride &&constraints={}) |
| A container drawn in style, for grouping content; it scrolls when bounded and its style has overflow: auto. | |
| bool | BeginArea (ID id, LayoutOverride &&constraints={}) |
| As above, in the theme's area style. | |
| bool | BeginArea (StyleRef style, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID. | |
| bool | BeginArea (LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID, in the theme's area style. | |
| void | EndArea () |
| Closes BeginArea. | |
| bool | BeginCached (ID id, StyleRef style, uint64_t signature=0, LayoutOverride &&constraints={}) |
| A container (like BeginArea) whose drawing is kept: while nothing changed it returns false, skipping the content, and the kept drawing is shown. | |
| bool | BeginCached (ID id, uint64_t signature=0, LayoutOverride &&constraints={}) |
| As above, in the theme's area style. | |
| void | EndCached () |
| Closes BeginCached; called whether or not it returned true. | |
| void | Invalidate (ID id) |
| Rebuilds id's cached scope, and those around it, next frame. Safe from event handlers. | |
| void | SetDrawCacheEnabled (bool enabled) |
| Enables the retained-render cache (on by default). When off, every scope rebuilds. | |
| void | InvalidatePanel (ID panelId) |
| Invalidates a docked panel's cached content by panel id. Safe from event handlers. | |
| bool | BeginHorizontal (ID id, StyleRef style, LayoutOverride &&constraints={}) |
| Undecorated flex containers; the Wrap variants wrap onto further lines/columns. | |
| bool | BeginHorizontal (ID id, LayoutOverride &&constraints={}) |
| As above, in the theme's plain style. | |
| bool | BeginHorizontal (StyleRef style, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID. | |
| bool | BeginHorizontal (LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID, in the theme's plain style. | |
| void | EndHorizontal () |
| Closes BeginHorizontal. | |
| bool | BeginHorizontalWrap (ID id, StyleRef style, LayoutOverride &&constraints={}) |
| A horizontal container whose children wrap onto further lines. | |
| bool | BeginHorizontalWrap (ID id, LayoutOverride &&constraints={}) |
| As above, in the theme's plain style. | |
| bool | BeginHorizontalWrap (StyleRef style, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID. | |
| bool | BeginHorizontalWrap (LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID, in the theme's plain style. | |
| void | EndHorizontalWrap () |
| Closes BeginHorizontalWrap. | |
| bool | BeginVertical (ID id, StyleRef style, LayoutOverride &&constraints={}) |
| A vertical container. | |
| bool | BeginVertical (ID id, LayoutOverride &&constraints={}) |
| As above, in the theme's plain style. | |
| bool | BeginVertical (StyleRef style, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID. | |
| bool | BeginVertical (LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID, in the theme's plain style. | |
| void | EndVertical () |
| Closes BeginVertical. | |
| bool | BeginVerticalWrap (ID id, StyleRef style, LayoutOverride &&constraints={}) |
| A vertical container whose children wrap onto further columns. | |
| bool | BeginVerticalWrap (ID id, LayoutOverride &&constraints={}) |
| As above, in the theme's plain style. | |
| bool | BeginVerticalWrap (StyleRef style, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID. | |
| bool | BeginVerticalWrap (LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID, in the theme's plain style. | |
| void | EndVerticalWrap () |
| Closes BeginVerticalWrap. | |
| bool | BeginToolbar (bool horizontal=true) |
| Toolbar scope: a wrap container that swaps theme.controls to the toolbar styles, so default-style widgets inside use their toolbar variants. | |
| void | EndToolbar () |
| Closes BeginToolbar. | |
Scrollbars | |
| void | VerticalScrollbar (ID scrollBarID, ID containerID) |
| A vertical scrollbar for containerID, called from inside it: it overlays the container's border box and draws nothing without overflow. | |
| void | VerticalScrollbar (ID containerID) |
| As above, with an ID derived from the container's. | |
| void | HorizontalScrollbar (ID scrollBarID, ID containerID) |
| As VerticalScrollbar, horizontal. | |
| void | HorizontalScrollbar (ID containerID) |
| As above, with an ID derived from the container's. | |
| void | ScrollbarOverlay (ID containerID, int2 lastInnerSize=int2{0, 0}, ID vertScrollBarID=ID::Invalid(), ID horzScrollBarID=ID::Invalid(), bool emitVert=true, bool emitHorz=true) |
| Both bars plus a corner cap; each hides itself without overflow. | |
Reorderable groups | |
| bool | BeginReorderableGroup (ID id, ReorderDirection direction, bool isWrapped, std::function< void(int fromIndex, int toIndex)> onReorder, StyleRef style, LayoutOverride &&constraints={}, std::function< void(int, tachyon::int2)> onDragOut=nullptr, std::function< void(int, tachyon::int2)> dragVisualizer=nullptr) |
| A container of BeginReorderableItem scopes the user reorders by dragging. | |
| bool | BeginReorderableGroup (ID id, ReorderDirection direction, std::function< void(int fromIndex, int toIndex)> onReorder, StyleRef style, LayoutOverride &&constraints={}) |
| As above, not wrapped. | |
| bool | BeginReorderableGroup (ID id, ReorderDirection direction, std::function< void(int fromIndex, int toIndex)> onReorder, LayoutOverride &&constraints={}) |
| As above, not wrapped, in the theme's style for the direction. | |
| bool | BeginReorderableGroup (ID id, ReorderDirection direction, bool isWrapped, std::function< void(int fromIndex, int toIndex)> onReorder, LayoutOverride &&constraints={}) |
| As above, in the theme's style for the direction and wrapping. | |
| bool | BeginReorderableGroup (ReorderDirection direction, bool isWrapped, std::function< void(int fromIndex, int toIndex)> onReorder, StyleRef style, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID. | |
| bool | BeginReorderableGroup (ReorderDirection direction, bool isWrapped, std::function< void(int fromIndex, int toIndex)> onReorder, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID, in the theme's style for the direction and wrapping. | |
| bool | BeginReorderableGroup (ReorderDirection direction, std::function< void(int fromIndex, int toIndex)> onReorder, StyleRef style, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, not wrapped, with the call site as the ID. | |
| bool | BeginReorderableGroup (ReorderDirection direction, std::function< void(int fromIndex, int toIndex)> onReorder, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, not wrapped, with the call site as the ID, in the theme's style for the direction. | |
| StyleRef | ReorderableGroupStyle (ReorderDirection direction, bool isWrapped) const |
| The theme's reorderable group style for a direction and wrapping. | |
| void | EndReorderableGroup () |
| Closes BeginReorderableGroup. | |
| bool | BeginReorderableItem (ID id, StyleRef style, LayoutOverride &&constraints={}) |
| One draggable item of a reorderable group; any content goes inside. | |
| bool | BeginReorderableItem (ID id, LayoutOverride &&constraints={}) |
| As above, in the theme's item style. | |
| bool | BeginReorderableItem (StyleRef style, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID. | |
| bool | BeginReorderableItem (LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID, in the theme's item style. | |
| void | EndReorderableItem () |
| Closes BeginReorderableItem. | |
| void | EmitDragHandle () |
| Non-interactive drag handle for use inside BeginReorderableItem; clicks reach the item. | |
List and tree views | |
| bool | BeginListView (ID id, int *selectedIndex, int itemCount, ItemDragDropConfig *dragDrop, StyleRef style, LayoutOverride &&constraints={}) |
| Opens a list view of ListItems. | |
| bool | BeginListView (ID id, int *selectedIndex, int itemCount, StyleRef style, LayoutOverride &&constraints={}) |
| As above, without drag and drop. | |
| bool | BeginListView (ID id, int *selectedIndex, int itemCount, LayoutOverride &&constraints={}) |
| As above, without drag and drop, in the theme's list style. | |
| bool | BeginListView (int *selectedIndex, int itemCount, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID. | |
| bool | BeginListView (ID id, int *selectedIndex, int itemCount, ItemDragDropConfig *dragDrop, LayoutOverride &&constraints={}) |
| As above, with drag and drop, in the theme's list style. | |
| bool | BeginListView (int *selectedIndex, int itemCount, ItemDragDropConfig *dragDrop, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID. | |
| bool | BeginListView (int *selectedIndex, int itemCount, ItemDragDropConfig *dragDrop, StyleRef style, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID, in style. | |
| bool | BeginListView (int *selectedIndex, int itemCount, StyleRef style, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, without drag and drop, with the call site as the ID, in style. | |
| void | EndListView () |
| Closes BeginListView. | |
| int | FindListItemIndex (tachyon::ID id) const |
| A list item's index by ID, for end-of-frame handlers; -1 if unknown. | |
| bool | ListItem (ID id, const GUIContent &content, StyleRef style, LayoutOverride &&constraints={}) |
| One item of a list view, drawn selected when it is the selected index. True when clicked. | |
| bool | ListItem (ID id, const GUIContent &content, LayoutOverride &&constraints={}) |
| As above, in the theme's item style. | |
| bool | ListItem (const GUIContent &content, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID. | |
| bool | ListItem (const GUIContent &content, StyleRef style, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID, in style. | |
| void | VirtualTreeView (ID id, std::vector< TreeViewRow > &rows, std::vector< int > &visibleIdx, TableState &state, StyleRef style={}, LayoutOverride &&constraints={}, std::string_view header={}) |
| Single-column virtualized tree view (a VirtualTable with one TreeCell column). | |
| void | VirtualTreeView (std::vector< TreeViewRow > &rows, std::vector< int > &visibleIdx, TableState &state, StyleRef style={}, LayoutOverride &&constraints={}, std::string_view header={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID. | |
| ID | TreeDropTargetRow () const |
| The tree row a drag is over (drives the drop indicator), or Invalid. | |
| bool | IsFileDragging () const |
| Whether files or text from another application are dragged over one of the app's windows. | |
| ID | FileDragTargetID () const |
| The element that takes that drag where it is now: the first from the one under the pointer up whose handler returned true to EventType::FileDragOver. | |
| void | SetFileDropHandler (std::function< void(const FileDrop &)> handler) |
| Gets the drops no element took (none returned true to EventType::FileDrop): the application's own, such as opening the files. | |
| bool | BeginSelected () |
| Items emitted in between render as selected. | |
| void | EndSelected () |
| Closes BeginSelected. | |
| bool | BeginDisabled () |
| Controls emitted in between are disabled: drawn dimmed, and they take no input. | |
| void | EndDisabled () |
| Closes BeginDisabled. | |
| bool | BeginInvalid () |
| Controls emitted in between show that their value isn't accepted: the theme's error border (–error) and halo (–invalid-halo) over whatever state they're in. | |
| void | EndInvalid () |
| Closes BeginInvalid. | |
| static void | RebuildTreeViewIndex (std::vector< TreeViewRow > &rows) |
| Recomputes skipCount / ancestorLineMask / isLastSibling from row depths. | |
| static void | WalkTreeViewVisibility (const std::vector< TreeViewRow > &rows, std::vector< int > &visibleIdx) |
| Writes the flat indices of visible rows (honoring isOpen) to visibleIdx. | |
Grid views | |
| bool | BeginGridView (ID id, int *selectedIndex, StyleRef style, MultiSelectState *multiSelect=nullptr, ItemDragDropConfig *dragDrop=nullptr, LayoutOverride &&constraints={}) |
| Opens a grid view of GridViewItems. | |
| bool | BeginGridView (ID id, int *selectedIndex=nullptr, MultiSelectState *multiSelect=nullptr, ItemDragDropConfig *dragDrop=nullptr, LayoutOverride &&constraints={}) |
| As above, in the theme's grid style. | |
| bool | BeginGridView (int *selectedIndex, StyleRef style, MultiSelectState *multiSelect=nullptr, ItemDragDropConfig *dragDrop=nullptr, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID, in style. | |
| bool | BeginGridView (int *selectedIndex, MultiSelectState *multiSelect=nullptr, ItemDragDropConfig *dragDrop=nullptr, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID, in the theme's grid style. | |
| void | EndGridView () |
| Closes BeginGridView. | |
| bool | GridViewItem (ID id, const GUIContent &content, tachyon::ElementState extraState=tachyon::ElementState::None, std::string *renameBuffer=nullptr, StyleRef itemStyle={}, LayoutOverride &&constraints={}) |
| renameBuffer (optional) enables in-place rename: F2, Ctrl+Shift+Click or a slow re-click opens an editor. | |
| bool | GridViewItem (ID id, const GUIContent &content, LayoutOverride &&constraints) |
| As above, without rename. | |
| bool | GridViewItem (const GUIContent &content, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID. | |
| bool | GridViewItem (ID id, const GUIContent &content, StyleRef style, LayoutOverride &&constraints={}) |
| Without rename, in style. | |
| bool | GridViewItem (const GUIContent &content, StyleRef style, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| Without rename, with the call site as the ID, in style. | |
| bool | IsRenaming () const |
| Whether an inline rename editor (a grid item's, a tree row's) is open; an app that sorts by name re-sorts once it closes. | |
| void | VirtualGridView (ID id, GridViewVirtualState &vstate, int itemCount, int2 cellSize, const std::function< void(int index, ID itemID)> &generateItem, int *selectedIndex=nullptr, MultiSelectState *multiSelect=nullptr, ItemDragDropConfig *dragDrop=nullptr, StyleRef scrollStyle={}, StyleRef rowStyle={}, LayoutOverride &&constraints={}) |
| generateItem(index, itemID) must emit exactly one cell, typically GridViewItem(itemID, ...). | |
| void | VirtualGridView (GridViewVirtualState &vstate, int itemCount, int2 cellSize, const std::function< void(int index, ID itemID)> &generateItem, int *selectedIndex=nullptr, MultiSelectState *multiSelect=nullptr, ItemDragDropConfig *dragDrop=nullptr, StyleRef scrollStyle={}, StyleRef rowStyle={}, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID. | |
Tables | |
| bool | BeginTable (ID id, VirtualTableColumn *columns, size_t columnCount, TableState &state, StyleRef style, LayoutOverride &&constraints={}) |
| Opens a table. | |
| bool | BeginTable (ID id, VirtualTableColumn *columns, size_t columnCount, TableState &state, LayoutOverride &&constraints={}) |
| As above, in the theme's table style. | |
| template<size_t N> | |
| bool | BeginTable (ID id, VirtualTableColumn(&columns)[N], TableState &state, StyleRef style, LayoutOverride &&constraints={}) |
| As above, for a C array of columns. | |
| template<size_t N> | |
| bool | BeginTable (ID id, VirtualTableColumn(&columns)[N], TableState &state, LayoutOverride &&constraints={}) |
| As above, for a C array of columns, in the theme's table style. | |
| bool | BeginTable (VirtualTableColumn *columns, size_t columnCount, TableState &state, StyleRef style, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID. | |
| bool | BeginTable (VirtualTableColumn *columns, size_t columnCount, TableState &state, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID, in the theme's table style. | |
| template<size_t N> | |
| bool | BeginTable (VirtualTableColumn(&columns)[N], TableState &state, StyleRef style, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, for a C array of columns, with the call site as the ID. | |
| template<size_t N> | |
| bool | BeginTable (VirtualTableColumn(&columns)[N], TableState &state, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, for a C array of columns, with the call site as the ID, in the theme's table style. | |
| void | EndTable () |
| Builds the recorded rows as a VirtualTable. | |
| bool | BeginRow () |
| Starts a row; its Cells fill the columns in order. | |
| void | EndRow () |
| Ends the row. | |
| void | Cell (std::string_view text) |
| Cells auto-advance to the next column. | |
| void | Cell (std::function< void()> emit) |
| Custom-content cell: emit runs inside the cell during EndTable, so its captures must live until then. | |
| void | TreeCell (std::string_view text, int depth, bool *isOpen, IconID icon=IconID::Invalid, uint32_t ancestorLineMask=0, bool isLastSibling=true, std::string *renameBuffer=nullptr, bool reserveExpander=true) |
| Tree-style first column: [indent][arrow or spacer][optional icon][text]. | |
| void | VirtualTable (ID id, TableState &state, std::span< VirtualTableColumn > columns, int totalRowCount, CssPx rowHeight=0, StyleRef style={}, LayoutOverride &&constraints={}) |
| Virtual-scrolled table: emits only the visible rows, under one ranged ID. | |
| void | VirtualTable (TableState &state, std::span< VirtualTableColumn > columns, int totalRowCount, CssPx rowHeight=0, StyleRef style={}, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID. | |
Breadcrumb | |
| bool | Breadcrumb (ID id, std::span< const std::string > segments, std::function< void(int)> onSelect, StyleRef style, LayoutOverride &&constraints={}) |
| A path such as Graphs > Terrain material: segments separated by chevrons, the last one current. | |
| bool | Breadcrumb (ID id, std::span< const std::string > segments, std::function< void(int)> onSelect, LayoutOverride &&constraints={}) |
| As above, in the theme's breadcrumb style. | |
| bool | Breadcrumb (std::span< const std::string > segments, std::function< void(int)> onSelect, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID. | |
| bool | Breadcrumb (std::span< const std::string > segments, std::function< void(int)> onSelect, StyleRef style, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID, in style. | |
Status bar | |
| bool | BeginStatusBar (ID id, StyleRef style, LayoutOverride &&constraints={}) |
| A strip of short status texts, usually along a window's bottom edge. | |
| bool | BeginStatusBar (ID id, LayoutOverride &&constraints={}) |
| As above, in the theme's status bar style. | |
| bool | BeginStatusBar (LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID. | |
| bool | BeginStatusBar (StyleRef style, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID, in style. | |
| void | EndStatusBar () |
| Closes BeginStatusBar. | |
| void | StatusText (ID id, std::string_view text, StyleRef style, LayoutOverride &&constraints={}) |
| A text in the status bar. | |
| void | StatusText (ID id, std::string_view text, LayoutOverride &&constraints={}) |
| As above, in the theme's status text style. | |
| void | StatusText (std::string_view text, StyleRef style, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID. | |
| void | StatusText (std::string_view text, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID, in the theme's status text style. | |
Command search | |
| bool | CommandSearch (ID id, CommandSearchState &state, StyleRef style, LayoutOverride &&constraints={}) |
| Finds and runs commandManager's commands: focused, it lists those whose description contains the query; Up / Down move through them, Enter or a click runs one, Escape leaves. | |
| bool | CommandSearch (ID id, CommandSearchState &state, LayoutOverride &&constraints={}) |
| As above, in the theme's command search style. | |
| bool | CommandSearch (CommandSearchState &state, StyleRef style, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID. | |
| bool | CommandSearch (CommandSearchState &state, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID, in the theme's command search style. | |
| static void | FocusCommandSearch (CommandSearchState &state) |
| Puts the keyboard in the search next frame; bind it to a command such as Ctrl+K. | |
Node view | |
| void | RenderNodeView (NodeView &view) |
| Builds view (canvas, nodes, wires and overlays) in the current container. | |
| void | NodeText (std::string_view text) |
| Text property body aligned by the row's sockets: left => left, right => right, both => centre. | |
Tabs | |
| bool | BeginTabBar (ID id, int *selectedIndex, std::function< void(int, int)> onReorder, std::function< void(int)> onClose=nullptr, std::function< void(int, tachyon::int2)> onDragOut=nullptr, std::function< void(int, tachyon::int2)> dragVisualizer=nullptr, StyleRef style={}, LayoutOverride &&constraints={}, TabBarLayout *layout=nullptr, const TabBarOptions &options={}) |
| Opens a tab bar of Tabs. | |
| bool | BeginTabBar (int *selectedIndex, std::function< void(int, int)> onReorder, std::function< void(int)> onClose=nullptr, std::function< void(int, tachyon::int2)> onDragOut=nullptr, std::function< void(int, tachyon::int2)> dragVisualizer=nullptr, StyleRef style={}, LayoutOverride &&constraints={}, TabBarLayout *layout=nullptr, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID. | |
| void | EndTabBar () |
| Closes BeginTabBar. | |
| bool | Tab (ID id, const GUIContent &content, StyleRef style, LayoutOverride &&constraints={}) |
| One tab of the tab bar; a click selects it. True when clicked. | |
| bool | BeginTab (ID id, const GUIContent &content, StyleRef style, StyleRef contentStyle, LayoutOverride &&constraints={}) |
| A tab with more in it: its icon and text in contentStyle (the theme's when invalid), then whatever is added up to EndTab, which every BeginTab needs. | |
| void | EndTab () |
| Closes BeginTab. | |
| bool | Tab (ID id, const GUIContent &content, LayoutOverride &&constraints={}) |
| As above, in the theme's tab style. | |
| bool | Tab (const GUIContent &content, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID. | |
| bool | Tab (const GUIContent &content, StyleRef style, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID, in style. | |
Docking | |
| bool | BeginDockingContainer (ID id, DockingLayout *layout, StyleRef style, LayoutOverride &&constraints={}) |
| Builds Layout's docked panels (each one's onPanelGUI) in a container, enabling the visible panels first. | |
| bool | BeginDockingContainer (ID id, DockingLayout *layout, LayoutOverride &&constraints={}) |
| As above, in the theme's dock style. | |
| bool | BeginDockingContainer (DockingLayout *layout, StyleRef style, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID. | |
| bool | BeginDockingContainer (DockingLayout *layout, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID, in the theme's dock style. | |
| void | EndDockingContainer () |
| Closes BeginDockingContainer. | |
| void | Documents (ID id, DocumentSet &set, LayoutOverride &&constraints={}) |
| The document bar of set, under the title bar, and below it the active document's panels, filling the rest of the window's column. | |
Fields | |
| bool | Field (ID id, bool &value, std::string_view text, StyleRef style, LayoutOverride &&constraints={}) |
| A bool as a Toggle labelled Text. | |
| bool | Field (bool &value, std::string_view text, StyleRef style, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID. | |
| bool | Field (ID id, bool &value, std::string_view text, LayoutOverride &&constraints={}) |
| As above, in the theme's toggle style. | |
| bool | Field (bool &value, std::string_view text, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID, in the theme's toggle style. | |
| bool | Field (ID id, std::string &value, TextEditBehavior textEditBehavior, StyleRef style, LayoutOverride &&constraints={}) |
| A text field editing value; true when it changed. | |
| bool | Field (std::string &value, TextEditBehavior textEditBehavior, StyleRef style, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID. | |
| bool | Field (ID id, std::string &value, StyleRef style, LayoutOverride &&constraints={}) |
| As above, updating continuously. | |
| bool | Field (std::string &value, StyleRef style, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID. | |
| bool | Field (ID id, std::string &value, TextEditBehavior textEditBehavior, LayoutOverride &&constraints={}) |
| As the first, in the theme's text box style. | |
| bool | Field (std::string &value, TextEditBehavior textEditBehavior, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID. | |
| bool | Field (ID id, std::string &value, LayoutOverride &&constraints={}) |
| As the first, updating continuously, in the theme's text box style. | |
| bool | Field (std::string &value, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID. | |
| bool | SearchField (ID id, std::string &value, IconID icon, TextEditBehavior textEditBehavior, StyleRef style, LayoutOverride &&constraints={}) |
| A Field with a leading icon inside its border; style is the border's. | |
| bool | SearchField (ID id, std::string &value, IconID icon, TextEditBehavior textEditBehavior=TextEditBehavior::ContinuousUpdate, LayoutOverride &&constraints={}) |
| As above, in the theme's search style. | |
| bool | SearchField (std::string &value, IconID icon, TextEditBehavior textEditBehavior, StyleRef style, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID. | |
| bool | SearchField (std::string &value, IconID icon, TextEditBehavior textEditBehavior=TextEditBehavior::ContinuousUpdate, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID, in the theme's search style. | |
| bool | AutocompleteField (ID id, std::string &value, std::span< const std::string_view > suggestions, StyleRef style, LayoutOverride &&constraints={}) |
| A text field that lists, under itself while it has the keyboard and holds text, the suggestions that contain that text (ignoring case), at most 12. | |
| bool | AutocompleteField (ID id, std::string &value, std::span< const std::string_view > suggestions, LayoutOverride &&constraints={}) |
| As above, in the theme's textbox style. | |
| bool | AutocompleteField (std::string &value, std::span< const std::string_view > suggestions, StyleRef style, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID. | |
| bool | AutocompleteField (std::string &value, std::span< const std::string_view > suggestions, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID, in the theme's textbox style. | |
| template<typename T, typename ComponentT = typename TypeDimensions<T>::ComponentType> | |
| bool | Field (ID id, T &value, TextEditBehavior textEditBehavior, StyleRef style, NumericFieldConfig< ComponentT > config={}, LayoutOverride &&constraints={}) |
| A number field; for a vector type (TypeDimensions), a field per component, each after a colored axis label that drags it. | |
| template<typename T, typename ComponentT = typename TypeDimensions<T>::ComponentType> | |
| bool | Field (ID id, T &value, TextEditBehavior textEditBehavior, NumericFieldConfig< ComponentT > config, LayoutOverride &&constraints={}) |
| As above, in the theme's number style. | |
| template<typename T, typename ComponentT = typename TypeDimensions<T>::ComponentType> | |
| bool | Field (ID id, T &value, TextEditBehavior textEditBehavior, LayoutOverride &&constraints={}) |
| As above, with the default config. | |
| template<typename T, typename ComponentT = typename TypeDimensions<T>::ComponentType> | |
| bool | Field (ID id, T &value, LayoutOverride &&constraints={}) |
| As above, updating continuously. | |
| template<typename T, typename ComponentT = typename TypeDimensions<T>::ComponentType> | |
| bool | Field (ID id, T &value, StyleRef style, NumericFieldConfig< ComponentT > config, LayoutOverride &&constraints={}) |
| As the first, updating continuously. | |
| template<typename T, typename ComponentT = typename TypeDimensions<T>::ComponentType> | |
| bool | Field (ID id, T &value, StyleRef style, LayoutOverride &&constraints={}) |
| As the first, updating continuously, with the default config. | |
| template<typename T, typename ComponentT = typename TypeDimensions<T>::ComponentType> | |
| bool | Field (ID id, T &value, NumericFieldConfig< ComponentT > config, LayoutOverride &&constraints={}) |
| As the first, updating continuously, in the theme's number style. | |
| template<typename T, typename ComponentT = typename TypeDimensions<T>::ComponentType> | |
| bool | Field (T &value, StyleRef style, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As the first, with the call site as the ID, updating continuously, with the default config. | |
| template<typename T, typename ComponentT = typename TypeDimensions<T>::ComponentType> | |
| bool | Field (T &value, TextEditBehavior textEditBehavior, StyleRef style, NumericFieldConfig< ComponentT > config, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As the first, with the call site as the ID. | |
| template<typename T, typename ComponentT = typename TypeDimensions<T>::ComponentType> | |
| bool | Field (T &value, StyleRef style, NumericFieldConfig< ComponentT > config, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As the first, with the call site as the ID, updating continuously. | |
| template<typename T, typename ComponentT = typename TypeDimensions<T>::ComponentType> | |
| bool | Field (T &value, TextEditBehavior textEditBehavior, StyleRef style, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As the first, with the call site as the ID and the default config. | |
| template<typename T, typename ComponentT = typename TypeDimensions<T>::ComponentType> | |
| bool | Field (T &value, TextEditBehavior textEditBehavior, NumericFieldConfig< ComponentT > config, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As the first, with the call site as the ID, in the theme's number style. | |
| template<typename T, typename ComponentT = typename TypeDimensions<T>::ComponentType> | |
| bool | Field (T &value, NumericFieldConfig< ComponentT > config, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As the first, with the call site as the ID, updating continuously, in the theme's number style. | |
| template<typename T, typename ComponentT = typename TypeDimensions<T>::ComponentType> | |
| bool | Field (T &value, TextEditBehavior textEditBehavior, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As the first, with the call site as the ID and the default config, in the theme's number style. | |
| template<typename T, typename ComponentT = typename TypeDimensions<T>::ComponentType> | |
| bool | Field (T &value, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As the first, with the call site as the ID and the default config, updating continuously, in the theme's number style. | |
| template<typename T> | |
| bool | TypedField (ID id, T &value, LayoutOverride &&constraints={}) |
| A number field with its type after the value, e.g. "0.5 f32". | |
| template<typename T> | |
| bool | TypedField (ID id, T &value, StyleRef style, LayoutOverride &&constraints={}) |
| As above; style is the box's around the number and its type. | |
| template<typename T> | |
| bool | TypedField (T &value, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID. | |
| template<typename T> | |
| bool | TypedField (T &value, StyleRef style, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID and a style for the box. | |
| template<typename T> | |
| void | Field (ID id, std::vector< T > &items, StyleRef style, LayoutOverride &&constraints={}) |
| A reorderable list: each row a grip, its index, the field (numbers with their type) and a remove button; "Add item" after the rows. | |
| template<typename T> | |
| void | Field (ID id, std::vector< T > &items, LayoutOverride &&constraints={}) |
| As above, in the theme's collection style. | |
| template<typename T> | |
| void | Field (std::vector< T > &items, StyleRef style, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID. | |
| template<typename T> | |
| void | Field (std::vector< T > &items, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID, in the theme's collection style. | |
| template<typename V> | |
| void | Field (ID id, std::vector< std::pair< std::string, V > > &items, StyleRef style, LayoutOverride &&constraints={}) |
| A key-value list (std::string keys, V values): a Key / Value header with the types, then a row per entry (key, value, remove) and "Add entry". | |
| template<typename V> | |
| void | Field (ID id, std::vector< std::pair< std::string, V > > &items, LayoutOverride &&constraints={}) |
| As above, in the theme's collection style. | |
| template<typename V> | |
| void | Field (std::vector< std::pair< std::string, V > > &items, StyleRef style, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID. | |
| template<typename V> | |
| void | Field (std::vector< std::pair< std::string, V > > &items, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID, in the theme's collection style. | |
| template<typename V> | |
| void | Field (ID id, std::unordered_map< std::string, V > &items, StyleRef style, LayoutOverride &&constraints={}) |
| Key-value list over an unordered_map. | |
| template<typename V> | |
| void | Field (ID id, std::unordered_map< std::string, V > &items, LayoutOverride &&constraints={}) |
| As above, in the theme's collection style. | |
| template<typename V> | |
| void | Field (std::unordered_map< std::string, V > &items, StyleRef style, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID. | |
| template<typename V> | |
| void | Field (std::unordered_map< std::string, V > &items, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID, in the theme's collection style. | |
| void | CollectionHeader (std::string_view valueType) |
| A dictionary's header row: "Key string", "Value <type>". | |
| template<typename T> | |
| static constexpr std::string_view | TypeTag () |
| A number's type as a short tag: f32, f64, i8 ... u64 (empty for other types). | |
Color and gradient fields | |
| bool | ColorField (ID id, tachyon::color4f &value, bool allowHDR, StyleRef style, LayoutOverride &&constraints={}) |
| A color swatch that opens a color picker; true when the color changed. | |
| bool | ColorField (ID id, tachyon::color4f &value, bool allowHDR=false, LayoutOverride &&constraints={}) |
| As above, in the theme's color field style. | |
| bool | ColorField (tachyon::color4f &value, bool allowHDR, StyleRef style, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID. | |
| bool | ColorField (tachyon::color4f &value, bool allowHDR=false, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID, in the theme's color field style. | |
| bool | ColorField (ID id, tachyon::color4b &value, StyleRef style, LayoutOverride &&constraints={}) |
| As above, for an 8-bit color. | |
| bool | ColorField (ID id, tachyon::color4b &value, LayoutOverride &&constraints={}) |
| As above, in the theme's color field style. | |
| bool | ColorField (tachyon::color4b &value, StyleRef style, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID. | |
| bool | ColorField (tachyon::color4b &value, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID, in the theme's color field style. | |
| bool | GradientField (ID id, tachyon::Gradient &value, StyleRef style, LayoutOverride &&constraints={}) |
| A gradient swatch that opens a gradient editor; true when the gradient changed. | |
| bool | GradientField (ID id, tachyon::Gradient &value, LayoutOverride &&constraints={}) |
| As above, in the theme's gradient swatch style. | |
| bool | GradientField (tachyon::Gradient &value, StyleRef style, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID. | |
| bool | GradientField (tachyon::Gradient &value, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID, in the theme's gradient swatch style. | |
Sliders | |
| bool | SliderField (ID id, float &value, float minVal, float maxVal, std::string_view text, StyleRef style, LayoutOverride &&constraints={}) |
| A label, a slider track and a number field for value in [minVal, maxVal]; true when it changed. | |
| bool | SliderField (ID id, float &value, float minVal, float maxVal, std::string_view text, LayoutOverride &&constraints={}) |
| As above, in the theme's slider field style. | |
| bool | SliderField (float &value, float minVal, float maxVal, std::string_view text, StyleRef style, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID. | |
| bool | SliderField (float &value, float minVal, float maxVal, std::string_view text, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID, in the theme's slider field style. | |
| bool | SliderField (ID id, int &value, int minVal, int maxVal, std::string_view text, StyleRef style, LayoutOverride &&constraints={}) |
| Integer variant: snaps to whole numbers. | |
| bool | SliderField (ID id, int &value, int minVal, int maxVal, std::string_view text, LayoutOverride &&constraints={}) |
| As above, in the theme's slider field style. | |
| bool | SliderField (int &value, int minVal, int maxVal, std::string_view text, StyleRef style, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID. | |
| bool | SliderField (int &value, int minVal, int maxVal, std::string_view text, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID, in the theme's slider field style. | |
| bool | Slider (ID id, int &value, int minVal, int maxVal, StyleRef style, LayoutOverride &&constraints={}) |
| Groove + knob without value text; drag-only, integer-valued. | |
| bool | Slider (ID id, int &value, int minVal, int maxVal, LayoutOverride &&constraints={}) |
| As above, in the theme's slider style. | |
| bool | Slider (int &value, int minVal, int maxVal, StyleRef style, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID. | |
| bool | Slider (int &value, int minVal, int maxVal, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID, in the theme's slider style. | |
Text, labels and images | |
| void | DragLabel (ID id, std::string_view text, StyleRef style, LayoutOverride &&constraints={}) |
| A label whose horizontal drag changes the value of the field after it; a click focuses that field and Escape cancels a drag. | |
| void | DragLabel (ID id, std::string_view text, LayoutOverride &&constraints={}) |
| As above, in the theme's drag label style. | |
| void | DragLabel (std::string_view text, StyleRef style, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID. | |
| void | DragLabel (std::string_view text, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID, in the theme's drag label style. | |
| void | Label (ID id, std::string_view text, StyleRef style, LayoutOverride &&constraints={}) |
| A label for the control after it: a click focuses that control. | |
| void | Label (ID id, std::string_view text, std::string_view caption, StyleRef style, LayoutOverride &&constraints={}) |
| A label over a field taller than a row (a list): at the top, with a caption under it such as "3 items". | |
| void | Label (ID id, std::string_view text, std::string_view caption, LayoutOverride &&constraints={}) |
| As above, in the theme's top label style. | |
| void | Label (std::string_view text, std::string_view caption, StyleRef style, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID. | |
| void | Label (std::string_view text, std::string_view caption, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID, in the theme's top label style. | |
| void | Label (ID id, std::string_view text, LayoutOverride &&constraints={}) |
| As the first, in the theme's label style. | |
| void | Label (std::string_view text, StyleRef style, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As the first, with the call site as the ID. | |
| void | Label (std::string_view text, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As the first, with the call site as the ID, in the theme's label style. | |
| void | Text (ID id, std::string_view text, StyleRef style, LayoutOverride &&constraints={}) |
| Static text. | |
| void | Text (ID id, std::string_view text, LayoutOverride &&constraints={}) |
| As above, in the theme's text style. | |
| void | Text (std::string_view text, StyleRef style, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID. | |
| void | Text (std::string_view text, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID, in the theme's text style. | |
| void | SelectableText (ID id, const std::span< ContentRun > &runs, std::function< void(intptr_t contentId)> onLinkActivate, StyleRef style, LayoutOverride &&constraints={}) |
| Read-only rich text with links, mouse selection and Ctrl+C. | |
| void | SelectableText (ID id, const std::span< ContentRun > &runs, StyleRef style, LayoutOverride &&constraints={}) |
| As above, without link handling. | |
| void | SelectableText (ID id, const std::span< ContentRun > &runs, LayoutOverride &&constraints={}) |
| As above, in the theme's text style. | |
| void | SelectableText (const std::span< ContentRun > &runs, StyleRef style, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID (the same every frame). | |
| void | SelectableText (const std::span< ContentRun > &runs, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID, in the theme's text style. | |
| void | Image (ID id, ImageIndex image, StyleRef style, LayoutOverride &&constraints={}) |
| Draws image (from graphicsContext->RegisterImage) stretched over the element's box. | |
| void | Image (ID id, ImageIndex image, LayoutOverride &&constraints={}) |
| As above, in the theme's image style. | |
| void | Image (ImageIndex image, StyleRef style, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID. | |
| void | Image (ImageIndex image, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID, in the theme's image style. | |
| void | Image (ID id, ImageIndex image, uint2 sourceSize, StyleRef style, LayoutOverride &&constraints={}) |
| Aspect-preserving: sizes the element to the largest sourceSize-aspect rect that fits the constraints. | |
| void | Image (ID id, ImageIndex image, uint2 sourceSize, LayoutOverride &&constraints={}) |
| As above, in the theme's image style. | |
| void | Image (ImageIndex image, uint2 sourceSize, StyleRef style, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID. | |
| void | Image (ImageIndex image, uint2 sourceSize, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID, in the theme's image style. | |
Ghost windows | |
| bool | BeginGhostWindow (ID windowLayoutID, int2 position) |
| A ghost window: caption-less and transparent, e.g. | |
| bool | BeginGhostWindow (ID windowLayoutID, int2 position, int2 size, StyleRef styleRef) |
| position is the top-left in screen space; for drag previews use BeginCursorGhostWindow. | |
| bool | BeginGhostWindow (ID windowLayoutID, int2 position, int2 size) |
| As above, in the theme's ghost window style. | |
| bool | BeginGhostWindow (ID windowLayoutID, int2 position, StyleRef styleRef) |
| Sized to its content. | |
| int2 | CursorGhostOffset () const |
| Where a ghost sits from the cursor, clear of the OS cursor: 14 px for a 32 px cursor, in proportion for others, 14 CSS px when the backend can't tell the cursor's size. | |
| bool | BeginCursorGhostWindow (ID windowLayoutID, int2 cursorPos) |
| A ghost window at the cursor, offset by CursorGhostOffset; 28 x 28 CSS px. | |
| bool | BeginCursorGhostWindow (ID windowLayoutID, int2 cursorPos, int2 size, StyleRef styleRef) |
| As above, with a size and style. | |
| bool | BeginCursorGhostWindow (ID windowLayoutID, int2 cursorPos, int2 size) |
| As above, with a size. | |
| bool | BeginCursorGhostWindow (ID windowLayoutID, int2 cursorPos, StyleRef styleRef) |
| As above, with a style, sized to its content. | |
| void | AddGhostIcon (IconID icon, std::source_location site=std::source_location::current()) |
| An icon in the open ghost window, 28 x 28 CSS px. | |
| void | EndGhostWindow () |
| Closes BeginGhostWindow or BeginCursorGhostWindow. | |
Windows | |
| bool | BeginWindow (ID windowLayoutID, std::string_view title, ElementFlags flags=ElementFlags::WindowUserControlled|ElementFlags::WindowIsCentered, int monitorIndex=-1) |
| As the full BeginWindow below, in the theme's window style. | |
| bool | BeginWindow (ID windowLayoutID, std::string_view title, StyleRef styleRef, ElementFlags flags=ElementFlags::WindowUserControlled|ElementFlags::WindowIsCentered, int monitorIndex=-1) |
| As the full BeginWindow below. | |
| bool | BeginWindow (ID windowLayoutID, std::string_view title, LayoutOverride &&constraints, ElementFlags flags=ElementFlags::WindowUserControlled|ElementFlags::WindowIsCentered, int monitorIndex=-1) |
| As the full BeginWindow below, in the theme's window style. | |
| bool | BeginWindow (ID windowLayoutID, ElementFlags flags=ElementFlags::WindowUserControlled|ElementFlags::WindowIsCentered, int monitorIndex=-1) |
| As the full BeginWindow below, without a title, in the theme's window style. | |
| bool | BeginWindow (ID windowLayoutID, StyleRef styleRef, ElementFlags flags=ElementFlags::WindowUserControlled|ElementFlags::WindowIsCentered, int monitorIndex=-1) |
| As the full BeginWindow below, without a title. | |
| bool | BeginWindow (ID windowLayoutID, LayoutOverride &&constraints, ElementFlags flags=ElementFlags::WindowUserControlled|ElementFlags::WindowIsCentered, int monitorIndex=-1) |
| As the full BeginWindow below, without a title, in the theme's window style. | |
| bool | BeginWindow (ID windowLayoutID, StyleRef styleRef, LayoutOverride &&constraints, ElementFlags flags=ElementFlags::WindowUserControlled|ElementFlags::WindowIsCentered, int monitorIndex=-1) |
| As the full BeginWindow below, without a title. | |
| bool | BeginWindow (ID windowLayoutID, std::string_view title, StyleRef styleRef, LayoutOverride &&constraints, ElementFlags flags=ElementFlags::WindowUserControlled|ElementFlags::WindowIsCentered, int monitorIndex=-1) |
| An OS window, made the first time its ID is seen; build its content while this returns true. | |
| bool | OpenWindow (ID windowLayoutID, std::string_view title, StyleRef styleRef, LayoutOverride &&constraints, ElementFlags flags, int monitorIndex) |
| Internal: the body of BeginWindow; call BeginWindow. | |
| void | EndWindow () |
| Closes BeginWindow; called whether or not it returned true. | |
Container scopes | |
Scopes for the Begin / End pairs, taking the Begin's arguments. | |
| template<class... A> | |
| auto | Window (A &&... a) |
| template<class... A> | |
| auto | GhostWindow (A &&... a) |
| template<class... A> | |
| auto | CursorGhostWindow (A &&... a) |
| template<class... A> | |
| auto | Menu (A &&... a) |
| template<class... A> | |
| auto | MenuBar (A &&... a) |
| template<class... A> | |
| auto | ContextMenu (A &&... a) |
| template<class... A> | |
| auto | Tooltip (A &&... a) |
| template<class... A> | |
| auto | Cached (A &&... a) |
| template<class... A> | |
| auto | Horizontal (A &&... a) |
| template<class... A> | |
| auto | Vertical (A &&... a) |
| template<class... A> | |
| auto | HorizontalWrap (A &&... a) |
| template<class... A> | |
| auto | VerticalWrap (A &&... a) |
| template<class... A> | |
| auto | Area (A &&... a) |
| template<class... A> | |
| auto | LabelGroup (A &&... a) |
| template<class... A> | |
| auto | ButtonGroup (A &&... a) |
| template<class... A> | |
| auto | ToggleGroup (A &&... a) |
| template<class... A> | |
| auto | Table (A &&... a) |
| template<class... A> | |
| auto | Row (A &&... a) |
| template<class... A> | |
| auto | ListView (A &&... a) |
| template<class... A> | |
| auto | GridView (A &&... a) |
| template<class... A> | |
| auto | TabBar (A &&... a) |
| template<class... A> | |
| auto | Toolbar (A &&... a) |
| template<class... A> | |
| auto | StatusBar (A &&... a) |
| template<class... A> | |
| auto | TitleBar (A &&... a) |
| template<class... A> | |
| auto | ReorderableGroup (A &&... a) |
| template<class... A> | |
| auto | ReorderableItem (A &&... a) |
| template<class... A> | |
| auto | Disabled (A &&... a) |
| template<class... A> | |
| auto | Invalid (A &&... a) |
| template<class... A> | |
| auto | Selected (A &&... a) |
| template<class... A> | |
| auto | Indeterminate (A &&... a) |
| template<class... A> | |
| auto | DockingContainer (A &&... a) |
| template<class... A> | |
| auto | DockingFrame (A &&... a) |
Boxes | |
| void | CloseWindow () |
| Internal: the body of EndWindow for an open window; call EndWindow. | |
| void | AddBox (ID id, int2 size, StyleRef styleRef, TextID textID=TextID::Invalid) |
| A plain box of a fixed size in pixels, in a style; textID is optional. | |
| void | AddBox (int2 size, StyleRef styleRef, TextID textID=TextID::Invalid, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID. | |
| void | AddBox (ID id, int2 size, StyleRef styleRef, std::string_view text) |
| As above, with text. | |
| void | AddBox (ID id, int2 size, StyleRef styleRef, IconID iconID, std::string_view text) |
| As above, with an icon and text. | |
| void | AddBox (ID id, StyleRef styleRef, IconID iconID, std::string_view text) |
| As above, sized to its content. | |
| void | AddBox (StyleRef styleRef, std::string_view text, std::source_location site=std::source_location::current()) |
| A box with text, sized to its content, with the call site as the ID. | |
| void | AddBox (int2 size, StyleRef styleRef, std::string_view text, std::source_location site=std::source_location::current()) |
| A fixed-size box with text, with the call site as the ID. | |
Settings panel | |
| void | RenderSettingsPanel (SettingsPanelState &state) |
| Renders into the current container; the caller provides the outer panel. | |
Saved UI state | |
The UI's state as JSON text, which the host stores where and when it likes. Name what to keep once, by keys that stay the same between runs; the named objects must outlive the naming: PersistWindow("main", mainWindowID); // position, size, mode
PersistDocking("dock", dockingLayout); // panels by type, else title
PersistTable("assets", tableState, columns); // column widths and order, by header
PersistToolbars("toolbars", toolbarSides); // items by debugName
PersistValue("zoom", zoom); // an app setting, if it wants
PersistDocuments("documents", windows); // each main window's documents
PersistShortcuts("shortcuts", commandManager); // the shortcuts the user changed
RestoreUIState applies saved text: windows when they are next declared, the rest at once. What it doesn't know (keys, panels, columns) is skipped. | |
| void | PersistWindow (std::string key, ID windowID) |
| Keeps the window's position, size and mode. | |
| void | PersistDocking (std::string key, DockingLayout &layout) |
| Keeps the layout's dock tree; panels are matched by type, else by title. | |
| void | PersistTable (std::string key, TableState &state, std::span< VirtualTableColumn > columns) |
| Keeps the table's column widths and order, matching columns by header. | |
| void | PersistToolbars (std::string key, std::span< std::vector< ToolbarItem >, kToolbarSideCount > sides) |
| Keeps each side's toolbar items, by debugName. | |
| void | PersistValue (std::string key, bool &value) |
| Keeps an app value. | |
| void | PersistValue (std::string key, int &value) |
| As above, for an int. | |
| void | PersistValue (std::string key, float &value) |
| As above, for a float. | |
| void | PersistValue (std::string key, std::string &value) |
| As above, for a string. | |
| void | PersistDocuments (std::string key, std::function< std::vector< DocumentWindowRef >()> windows) |
| Keeps the documents of each main window that Windows and platform lists when the state is saved: their names, kinds and order, the active one, each one's dock tree, and the window's position, size and mode. | |
| void | PersistShortcuts (std::string key, CommandManager &commands) |
| Keeps the shortcuts that aren't the ones their commands were registered with, matching commands by mode name and description. | |
| std::vector< SavedDocumentWindow > | TakeSavedDocuments (std::string_view key) |
| The main windows of documents RestoreUIState read for key, in the order they were listed; empty when none were saved. | |
| bool | RestoreDocumentLayout (Document &document, const SavedDocument &saved) |
| Lays a document's panels out as saved: panels by type, else title; ones the saved tree doesn't have go to its first leaf. | |
| void | RestoreWindowPlace (ID windowID, const SavedDocumentWindow &saved) |
| Puts a window where saved was when it's next declared, as PersistWindow does (on its monitor, or the same place on another). | |
| std::string | SaveUIState () const |
| The named state as JSON text. | |
| Result< void > | RestoreUIState (std::string_view json) |
| Applies JSON text from SaveUIState. | |
The application: owns the windows, the systems and the frame loop.
Subclass it, build the UI in OnGUI, and call Initialize, then Run (or the frame calls), then Cleanup.
class HelloApp : public tachyon::GUIApplication
{
public:
tachyon::Result<void> Initialize(const InitializeOptions& options = {}) override
{
if (tachyon::Result<void> result = GUIApplication::Initialize(options); !result)
return result;
windowID = idManager.CreateStaticID(); // windows need stable IDs
return {};
}
void OnGUI() override // every frame: describe the whole UI
{
if (BeginWindow(windowID, "Hello", tachyon::LayoutOverride{}.Size(360, 160)))
Button("Greet", [this] { ++greetings; });
EndWindow(); // always, whatever BeginWindow returned
}
private:
tachyon::ID windowID = tachyon::ID::Invalid();
int greetings = 0;
};
Every control is a member function, grouped below by family.
|
virtualdefault |
| void tachyon::GUIApplication::GetFrameTimingHistory | ( | std::span< FrameTimingSample > | out | ) | const |
Copies the ring chronologically (oldest first) into out.
| void tachyon::GUIApplication::CreatePanel | ( | std::unordered_map< tachyon::ID, tachyon::Panel > & | panels, |
| ID | id, | ||
| std::string | title, | ||
| tachyon::IconID | icon, | ||
| std::function< void()> | onPanelGUI, | ||
| std::string | panelType = {}, | ||
| std::function< void()> | onEnable = {}, | ||
| std::function< void()> | onDisable = {} ) |
Adds a panel to panels (usually a DockingLayout's).
onPanelGUI builds its content; onEnable / onDisable run when it becomes visible / hidden. panelType names its kind, which saved UI state matches panels by (else the title).
|
inline |
As above, with a new static ID, which it returns.
| void tachyon::GUIApplication::DisableAllPanels | ( | DockingLayout & | layout | ) |
Panel lifecycle.
A panel is enabled iff it is the selectedTab of a leaf reachable from layout.root; the docking enables the visible ones each frame. DisableAllPanels brackets disruptive operations (theme reload, preset swap).
| void tachyon::GUIApplication::EmitFloatingToolbarWindows | ( | std::vector< struct FloatingToolbarItem > & | floatingItems, |
| const struct FloatingToolbarOptions * | options = nullptr ) |
One OS window per floating toolbar. Closed windows are erased and their IDs released.
| DockLeafResult tachyon::GUIApplication::FindDockLeafAtScreenPos | ( | tachyon::int2 | screenPos | ) |
Dock leaf whose tab bar contains screenPos, plus its owning layout (needed by TransferPanel for cross-layout drops).
{nullptr, nullptr} on miss.
| DockDropResult tachyon::GUIApplication::FindDockDropTargetAtScreenPos | ( | tachyon::int2 | screenPos | ) |
Hit-tests leaf content areas; falls back to tab bars with zone=Center.
| void tachyon::GUIApplication::EmitFloatingDockWindows | ( | ) |
Call from OnGUI after the main docking container. Empty windows are closed.
| void tachyon::GUIApplication::EmitFloatingDockWindows | ( | const DocumentSet & | documents | ) |
With documents in several main windows: in each, after its Documents, the windows of the panels torn from its documents.
They belong to it, and to the window a document is moved to.
| bool tachyon::GUIApplication::FloatPanel | ( | DockingLayout & | layout, |
| ID | panelID, | ||
| int2 | screenPos ) |
Moves a docked panel into its own window at a screen position, as tearing its tab off does; the window's Dock button returns it.
False if the layout hasn't the panel.
| void tachyon::GUIApplication::CloseFloatingDockWindow | ( | size_t | index | ) |
Closes the window for good: its panels are disabled and destroyed.
| void tachyon::GUIApplication::CloseDockedPanel | ( | DockingLayout & | layout, |
| DockNode & | leaf, | ||
| int | tabIndex ) |
Closes the panel at tabIndex of a docked leaf, as the tab's Close action does.
| Document & tachyon::GUIApplication::CreateDocument | ( | DocumentSet & | set, |
| std::string | name, | ||
| std::string | extension, | ||
| std::string | kind, | ||
| tachyon::IconID | icon ) |
Adds a document at the end of set, with new static IDs and an empty layout, which the caller fills (CreatePanel, MakeLeaf).
The first one added becomes the active one.
| void tachyon::GUIApplication::CloseDocument | ( | DocumentSet & | set, |
| int | index ) |
Closes set's document at index for good: its panels are disabled and destroyed, its torn-off panel windows closed, its IDs released and its layout no longer saved (PersistDocking).
The active document stays active; when it's the one closed, the next one (else the one before) takes over. Call from OnGUI, not from an input handler.
|
static |
Moves a panel from sourceNode/sourceLayout to targetLayout, fixing up selectedTab.
|
virtual |
Creates the backends not set before, the window manager, the text system and the subsystems, and loads the theme.
An error when the graphics or text setup fails.
|
virtual |
Releases what Initialize created, including the backends set before it.
Safe without Initialize.
| Result< void > tachyon::GUIApplication::InitializeStyles | ( | ) |
Loads the current theme at the current font scale; an error when it can't be opened.
|
inlinevirtual |
Called after every successful theme/font reload (and by subclasses at startup) to re-register styles/icons the reload wiped.
Reset any bookkeeping of stale StyleRefs.
| void tachyon::GUIApplication::RequestReloadTheme | ( | std::string_view | themePath, |
| float | fontScale ) |
Deferred to the start of the next frame; safe from event handlers.
fontScale multiplies every CSS font-size.
|
inline |
How the last reload went; on an error the previous theme stays.
|
inline |
|
inline |
The folder the resources load from: compiled shaders, default fonts and relative theme paths.
Empty (the default) is the working directory; a package user passes TACHYON_RESOURCE_DIR, which the package defines. Call before Initialize.
|
inline |
| void tachyon::GUIApplication::InjectMouseMove | ( | ID | windowID, |
| int2 | pos, | ||
| KeyModifier | mods = KeyModifier::None ) |
Input for render-to-image windows (WindowFlags::RenderToImage), which get none from the OS.
Positions are in the window's pixels. The window is under the pointer from a mouse event until InjectMouseLeave, and has keyboard focus from any injected input until InjectFocus(windowID, false).
| void tachyon::GUIApplication::InjectMouseButton | ( | ID | windowID, |
| int2 | pos, | ||
| MouseButtons | button, | ||
| bool | down, | ||
| KeyModifier | mods = KeyModifier::None ) |
A button press (down) or release at pos.
| void tachyon::GUIApplication::InjectMouseScroll | ( | ID | windowID, |
| int2 | pos, | ||
| float2 | offset, | ||
| KeyModifier | mods = KeyModifier::None ) |
A wheel scroll by offset at pos.
| void tachyon::GUIApplication::InjectMouseLeave | ( | ID | windowID | ) |
The pointer left the window.
| void tachyon::GUIApplication::InjectFocus | ( | ID | windowID, |
| bool | focused ) |
Gives the window keyboard focus, or takes it away.
| void tachyon::GUIApplication::InjectKey | ( | ID | windowID, |
| KeyCode | key, | ||
| KeyAction | action, | ||
| KeyModifier | mods = KeyModifier::None ) |
A key event; typed text goes through InjectText.
| void tachyon::GUIApplication::InjectText | ( | ID | windowID, |
| std::string_view | utf8 ) |
Typed text, one character event per codepoint.
The last rendered frame of a render-to-image window: BGRA8, tightly packed rows, bgra holding width x height x 4 bytes of its pixel size.
|
inline |
The graphics backend Initialize uses; without one it creates a vulkan::VulkanGraphicsContext.
Set it up through its own API first, for example SetExternalDevice to render on the host's device. Owned until Cleanup. Call before Initialize.
|
inline |
The OS windows and their input; Initialize wraps it to add render-to-image windows.
Without one it creates an SDLWindowBackend (SDL builds only). Owned until Cleanup. Call before Initialize.
|
inline |
Copy and paste for text fields.
Defaults to SDL's clipboard, or a LocalClipboard without SDL. Owned until Cleanup. Call before Initialize.
|
inline |
Host memory functions for what can be routed: Vulkan objects, VMA, vk-bootstrap and SDL (only when the GUI starts SDL).
See AllocationHooks for how long they must live. Call before Initialize.
| void tachyon::GUIApplication::SetStyleFiles | ( | std::span< const std::string_view > | files | ) |
The CSS rule files loaded after the palette, in order; relative paths are next to the palette file.
Defaults to the library's "styles.css". An app appends its own and finds their classes with theme.GetStyle. Call before Initialize, or follow with RequestReloadTheme.
|
inline |
The graphics backend Initialize uses; without one it creates a vulkan::VulkanGraphicsContext.
Set it up through its own API first, for example SetExternalDevice to render on the host's device. Owned until Cleanup. Call before Initialize.
| void tachyon::GUIApplication::SetUIScale | ( | float | scale | ) |
Extra UI zoom on top of the main window's display scale (1 follows the OS).
Styles are registered at display scale x zoom. May be called before Initialize.
|
inline |
The graphics backend Initialize uses; without one it creates a vulkan::VulkanGraphicsContext.
Set it up through its own API first, for example SetExternalDevice to render on the host's device. Owned until Cleanup. Call before Initialize.
| void tachyon::GUIApplication::SetReducedMotion | ( | std::optional< bool > | reduced | ) |
Reduced motion: changes of state show at once instead of blending.
By default it follows the OS (on Windows, "Animation effects" turned off); true or false sets it, nullopt follows the OS again.
|
inline |
True while a theme switch is crossfading (the old look fading out over the new).
|
inline |
Whether changes of state show at once now.
|
pure virtual |
Builds the UI; called each frame.
| Result< void > tachyon::GUIApplication::Run | ( | ) |
Loops over the frame calls below until the app quits; an error when the GPU device was lost and couldn't be made again (a host's device).
| bool tachyon::GUIApplication::UpdateFrame | ( | ) |
One frame, for a host with its own main loop:
while (app.UpdateFrame()) { app.RecordFrame(); /* the host's own work *‍/ app.PresentFrame(); }
UpdateFrame pumps OS events and input (false once the app quits). RecordFrame builds the UI and records and submits every window; render-to-image windows are done then. A lost GPU device is made again first; an error when it can't be (a host's device). PresentFrame presents the OS windows and may wait for vsync.
| Result< void > tachyon::GUIApplication::RecordFrame | ( | ) |
See UpdateFrame.
| void tachyon::GUIApplication::PresentFrame | ( | ) |
See UpdateFrame.
| tachyon::EventHandler tachyon::GUIApplication::MakeToggleHandler | ( | bool & | toggle | ) |
A handler that flips toggle on click.
| tachyon::EventHandler tachyon::GUIApplication::MakeButtonHandler | ( | std::function< void()> | onClick | ) |
A handler that calls onClick on click.
| tachyon::EventHandler tachyon::GUIApplication::MakeLabelHandler | ( | ) |
A label's handler: a click focuses the control the label belongs to.
| tachyon::ElementRef tachyon::GUIApplication::RegisterElement | ( | tachyon::Element && | element, |
| LayoutOverride && | constraints ) |
Adds an element, with its interaction state, to the current window; for custom elements.
| tachyon::ElementRef tachyon::GUIApplication::RegisterElement | ( | tachyon::Element && | element, |
| std::string_view | text, | ||
| LayoutOverride && | constraints ) |
As above, with Text registered as its text.
While building a popup's trigger: true, and the key taken, when Escape was pressed this frame with the keyboard in the popup's window or on the trigger.
| tachyon::ElementRef tachyon::GUIApplication::RegisterControl | ( | tachyon::Element && | element, |
| LayoutOverride && | constraints ) |
As RegisterElement, for a control: it joins the Tab order and needs a valid ID.
| tachyon::ElementRef tachyon::GUIApplication::RegisterControl | ( | tachyon::Element && | element, |
| std::string_view | text, | ||
| LayoutOverride && | constraints ) |
As above, with Text registered as its text.
| tachyon::ElementRef tachyon::GUIApplication::RegisterControl | ( | tachyon::Element && | element, |
| std::function< TextID(tachyon::Element &element)> | createTextID, | ||
| LayoutOverride && | constraints ) |
As above; createTextID registers the text, given the element with its current state.
| tachyon::ElementRef tachyon::GUIApplication::MenuItemRow | ( | ID | id, |
| tachyon::EventHandler | handler, | ||
| StyleRef | rowStyle, | ||
| bool | reserveIcon, | ||
| IconID | icon, | ||
| std::string_view | text, | ||
| std::string_view | trailing, | ||
| StyleRef | trailingStyle, | ||
| LayoutOverride && | constraints, | ||
| bool | destructive = false ) |
A menu row: an icon slot, the label and a trailing text (a shortcut or a submenu arrow).
The row takes the input and the highlight. reserveIcon keeps the icon slot without an icon, so labels line up in a menu that mixes both.
| bool tachyon::GUIApplication::MenuItemImpl | ( | ID | id, |
| const GUIContent & | content, | ||
| std::string_view | shortcut, | ||
| std::function< void()> | onClick, | ||
| StyleRef | style, | ||
| bool | destructive, | ||
| LayoutOverride && | constraints ) |
SearchField, also giving the ID of its text field (to focus it).
Internal: the body of MenuItem and DestructiveMenuItem.
|
inline |
The content's tooltip, if it has one, on the control id.
|
inline |
Value fields emitted in between show a dash for mixed values (e.g.
across a selection) and can't be edited.
|
inline |
Closes BeginIndeterminate.
| bool tachyon::GUIApplication::Button | ( | ID | id, |
| const GUIContent & | content, | ||
| std::function< void()> | onClick, | ||
| StyleRef | style, | ||
| LayoutOverride && | constraints = {} ) |
Controls take (id, icon, text, ..., style, constraints), each part optional.
A change is reported twice: input is handled after the frame it arrives in, where the callback runs; the return value is true in the next frame. Without an id, the control's ID comes from its call site.
|
inline |
As above, in the theme's button style.
|
inline |
As above, with the call site as the ID.
|
inline |
As above, with the call site as the ID, in the theme's button style.
| bool tachyon::GUIApplication::CommandButton | ( | CommandID | command, |
| StyleRef | style, | ||
| LayoutOverride && | constraints = {} ) |
Icon button for a command; the tooltip shows its name and shortcut, e.g. "Undo (Ctrl+Z)".
|
inline |
As above, in the theme's button style.
| bool tachyon::GUIApplication::Checkbox | ( | ID | id, |
| bool | value, | ||
| std::string_view | text, | ||
| std::function< void(bool)> | onToggle, | ||
| StyleRef | style, | ||
| LayoutOverride && | constraints = {} ) |
A checkbox (a box, checked with a tick) and its label; a click calls onToggle with the new value.
|
inline |
As above, in the theme's checkbox style.
|
inline |
As above, with the call site as the ID.
|
inline |
As above, with the call site as the ID, in the theme's checkbox style.
|
inline |
Checks and unchecks value itself.
|
inline |
As above, in the theme's checkbox style.
|
inline |
As above, with the call site as the ID.
|
inline |
As above, with the call site as the ID, in the theme's checkbox style.
| bool tachyon::GUIApplication::Switch | ( | ID | id, |
| bool | value, | ||
| std::string_view | text, | ||
| std::function< void(bool)> | onToggle, | ||
| StyleRef | style, | ||
| LayoutOverride && | constraints = {} ) |
An on/off switch (track and knob) with an optional label after it, e.g. "On".
|
inline |
As above, in the theme's switch style.
|
inline |
As above, with the call site as the ID.
|
inline |
As above, with the call site as the ID, in the theme's switch style.
|
inline |
Switches value itself.
|
inline |
As above, in the theme's switch style.
|
inline |
As above, with the call site as the ID.
|
inline |
As above, with the call site as the ID, in the theme's switch style.
| bool tachyon::GUIApplication::Toggle | ( | ID | id, |
| bool | value, | ||
| const GUIContent & | content, | ||
| std::function< void(bool)> | onToggle, | ||
| StyleRef | style, | ||
| LayoutOverride && | constraints = {} ) |
A button that shows pressed while value is on; a click calls onToggle with the new value.
|
inline |
As above, in the theme's toggle style.
|
inline |
As above, with the call site as the ID.
|
inline |
As above, with the call site as the ID, in the theme's toggle style.
|
inline |
Toggles value itself.
|
inline |
As above, in the theme's toggle style.
|
inline |
As above, with the call site as the ID.
|
inline |
As above, with the call site as the ID, in the theme's toggle style.
| bool tachyon::GUIApplication::BeginMenu | ( | ID | id, |
| std::string_view | text, | ||
| StyleRef | buttonStyle, | ||
| StyleRef | menuStyle, | ||
| StyleRef | itemStyle, | ||
| LayoutOverride && | constraints = {} ) |
A menu: a trigger button (in a menu bar or on its own), or a submenu item inside another menu.
True while it is open: emit its items then. EndMenu is called either way.
|
inline |
As above, in the theme's menu styles.
|
inline |
As above, with the call site as the ID.
|
inline |
As above, with the call site as the ID, in the theme's menu styles.
| bool tachyon::GUIApplication::Dropdown | ( | ID | id, |
| int & | selected, | ||
| std::span< const std::string_view > | options, | ||
| StyleRef | style, | ||
| LayoutOverride && | constraints = {} ) |
A dropdown: a field showing options[selected] that opens the list of options under itself.
Picking one (click, or arrows and Enter) sets selected and returns true on that frame; Escape or a click elsewhere closes the list unchanged. The open list starts on the current option. An out-of-range selected shows an empty field.
|
inline |
As above, in the theme's dropdown style.
|
inline |
As above, with the call site as the ID.
|
inline |
As above, with the call site as the ID, in the theme's dropdown style.
|
inline |
With the options written in place: Dropdown(quality, { "Low", "Medium", "High" }).
|
inline |
As above, with the call site as the ID.
|
inline |
As above, in style.
|
inline |
As above, with the call site as the ID, in style.
| void tachyon::GUIApplication::MenuHeader | ( | std::string_view | text | ) |
A section's name between items, e.g. "View", lined up with the labels.
| int tachyon::GUIApplication::MessageDialog | ( | ID | id, |
| const MessageDialogDesc & | desc, | ||
| StyleRef | style ) |
A modal question with verb buttons, centered.
Call it every frame while asking; it returns the index of the button chosen (once, on the frame after), else -1. Esc and the close button choose desc.cancelButton; Alt + a button's first letter chooses it.
|
inline |
As above, in the theme's message box style.
|
inline |
As above, with the call site as the ID.
|
inline |
As above, with the call site as the ID, in the theme's message box style.
Shows a toast in the corner of the window that builds Toasts.
Errors stay until dismissed; the rest go after about 6 s (not while the pointer is over the toasts, nor while a progress bar is short of 1).
A shown toast's description, to change (its progress, its body); null once it's gone.
| void tachyon::GUIApplication::DismissToast | ( | ToastID | toast | ) |
Takes a toast away, as its close button does.
| void tachyon::GUIApplication::Toasts | ( | ) |
The toasts, in the current window's bottom-right corner over what's built before; call it last in the window.
The newest is nearest the corner; ones past the fourth fold into a "+N earlier" pill, which shows them all.
| void tachyon::GUIApplication::Banner | ( | ID | id, |
| Severity | severity, | ||
| const GUIContent & | message, | ||
| std::span< const BannerAction > | actions = {}, | ||
| LayoutOverride && | constraints = {} ) |
A banner across the top of a panel: the message (message.icon, else the severity's) on the severity's tint, then actions, right-aligned.
|
inline |
As above, with the call site as the ID.
| bool tachyon::GUIApplication::CloseRequested | ( | ID | windowID | ) |
Whether the user asked to close a window flagged WindowConfirmClose (its close button, Alt+F4, the OS quitting) since last asked.
The window stays until the app closes it, e.g. after asking with a MessageDialog.
| void tachyon::GUIApplication::MenuFilter | ( | ) |
A filter field for a big menu, first in it: it takes the keyboard when the menu opens, and while it holds text the items (and headers and separators) that don't contain it are left out.
| bool tachyon::GUIApplication::MenuItem | ( | ID | id, |
| const GUIContent & | content, | ||
| std::string_view | shortcut, | ||
| std::function< void()> | onClick, | ||
| StyleRef | style, | ||
| LayoutOverride && | constraints = {} ) |
Optional icon, label, optional shortcut. The icon column is reserved if any sibling has an icon.
|
inline |
As above, without a shortcut, in the theme's item style.
|
inline |
As above, with the call site as the ID.
|
inline |
With a shortcut; onClick is required so MenuItem(text, nullptr) stays unambiguous.
|
inline |
As above, with the call site as the ID.
|
inline |
With a shortcut, the call site as the ID and style.
|
inline |
Without a shortcut, in style.
|
inline |
Without a shortcut, with the call site as the ID, in style.
| bool tachyon::GUIApplication::MenuItem | ( | CommandID | command | ) |
Menu item for a command: icon, label, shortcut and callback come from the command.
| bool tachyon::GUIApplication::DestructiveMenuItem | ( | ID | id, |
| const GUIContent & | content, | ||
| std::string_view | shortcut, | ||
| std::function< void()> | onClick, | ||
| StyleRef | style, | ||
| LayoutOverride && | constraints = {} ) |
An item that destroys something (Delete, Discard), in the error color.
|
inline |
As above, in the theme's item style.
|
inline |
As above, with the call site as the ID.
|
inline |
As above, with the call site as the ID, in the theme's item style.
|
inline |
Without a shortcut, in style.
|
inline |
Without a shortcut, in the theme's item style.
|
inline |
Without a shortcut, with the call site as the ID, in style.
|
inline |
Without a shortcut, with the call site as the ID, in the theme's item style.
| void tachyon::GUIApplication::EndMenu | ( | ) |
Closes BeginMenu; called whether or not it returned true.
| bool tachyon::GUIApplication::BeginMenuBar | ( | ID | id, |
| StyleRef | style, | ||
| LayoutOverride && | constraints = {} ) |
Menu bar: place BeginMenu triggers inside.
Left/Right move between triggers, Down enters the dropdown, Up at its first item returns to the trigger.
|
inline |
As above, in the theme's menu bar style.
|
inline |
As above, with the call site as the ID.
|
inline |
As above, with the call site as the ID, in style.
| void tachyon::GUIApplication::EndMenuBar | ( | ) |
Closes BeginMenuBar.
| bool tachyon::GUIApplication::BeginTitleBar | ( | ID | id, |
| StyleRef | style, | ||
| LayoutOverride && | constraints = {} ) |
A menu bar the window is dragged by: what in it isn't a control is the caption (drag to move, double-click to maximize).
In a window with ElementFlags::WindowCustomTitleBar, EndTitleBar adds the window buttons.
|
inline |
As above, in the theme's title bar style.
|
inline |
As above, with the call site as the ID.
|
inline |
As above, with the call site as the ID, in style.
| void tachyon::GUIApplication::EndTitleBar | ( | ) |
Closes BeginTitleBar, adding the window buttons in a custom-title-bar window.
| WindowHitArea tachyon::GUIApplication::TitleBarHitTest | ( | ID | windowID, |
| int2 | screenPos ) const |
What the OS should do with a screen point of a window with a custom title bar.
| void tachyon::GUIApplication::MenuSeparator | ( | ) |
Divider inside a menu or context menu.
| void tachyon::GUIApplication::SetTooltip | ( | ID | targetID, |
| std::string_view | text ) |
A text tooltip on targetID, shown when the pointer rests on it.
As above, with an icon before the text.
|
inline |
As above, on the control just drawn (its outer element, shown over all its parts).
|
inline |
As above, with an icon, on the control just drawn.
| void tachyon::GUIApplication::SetTooltip | ( | ID | targetID, |
| std::string_view | text, | ||
| std::string_view | shortcut ) |
As above, with the keyboard shortcut that does the same in a chip after the text.
| void tachyon::GUIApplication::SetTooltip | ( | ID | targetID, |
| IconID | icon, | ||
| std::string_view | text, | ||
| std::string_view | shortcut ) |
As above, with an icon.
|
inline |
As above, for the last control.
| void tachyon::GUIApplication::SetTooltip | ( | ID | targetID, |
| const PropertyHelp & | help ) |
A property's help on targetID, in a larger tooltip: its title, description and footer.
A label given help (Label, DragLabel) is underlined, dotted.
|
inline |
As above, for the last control.
| void tachyon::GUIApplication::SetErrorTooltip | ( | ID | targetID, |
| std::string_view | message ) |
Why a value isn't accepted, in a tooltip on the popup surface with an error border (and arrow).
Goes with BeginInvalid, which gives the control its error border and halo.
|
inline |
As above, for the last control.
| void tachyon::GUIApplication::SetDisabledTooltip | ( | ID | targetID, |
| std::string_view | text, | ||
| std::string_view | reason ) |
A text tooltip that, while targetID is disabled, also says why, on a second, muted line.
A disabled control shows its tooltip, though it takes no input.
|
inline |
As above, for the last control.
| bool tachyon::GUIApplication::BeginTooltip | ( | ID | targetID | ) |
A tooltip with any content on targetID: build it while this returns true.
EndTooltip is called either way.
|
inline |
As above, on the control just drawn.
| void tachyon::GUIApplication::EndTooltip | ( | ) |
Closes BeginTooltip; called whether or not it returned true.
| bool tachyon::GUIApplication::BeginContextMenu | ( | ID | targetID | ) |
Context menu: opens at the pointer on a right-click on the target element, or below it on Shift+F10 or the Menu key while it has the focus.
A target that takes its parts' states (PropagatesDescendantState) opens for them too; when several targets match, the first BeginContextMenu of the frame wins.
|
inline |
As above, on the control just drawn.
| void tachyon::GUIApplication::EndContextMenu | ( | ) |
Closes BeginContextMenu; called whether or not it returned true.
Opens targetID's context menu at a screen point, e.g.
for something that isn't an element; BeginContextMenu(targetID) then builds it.
| bool tachyon::GUIApplication::BeginLabelGroup | ( | ID | id, |
| CssPx | defaultWidth = 120, | ||
| CssPx | minWidth = 40, | ||
| CssPx | maxWidth = 500, | ||
| bool | resizable = true ) |
Label group: Labels/DragLabels inside share one width, resizable by dragging any label's right edge.
Widths in CSS pixels.
|
inline |
As above, with the call site as the ID.
| void tachyon::GUIApplication::EndLabelGroup | ( | ) |
Closes BeginLabelGroup.
| bool tachyon::GUIApplication::BeginButtonGroup | ( | LayoutOverride && | constraints = {} | ) |
Button / toggle group: Buttons / Field(bool) inside are restyled with .first-/.mid-/.last-* so they share borders.
A single item keeps its plain style.
| void tachyon::GUIApplication::EndButtonGroup | ( | ) |
Closes BeginButtonGroup.
| bool tachyon::GUIApplication::BeginToggleGroup | ( | LayoutOverride && | constraints = {} | ) |
The same for Toggles and Field(bool).
| void tachyon::GUIApplication::EndToggleGroup | ( | ) |
Closes BeginToggleGroup.
| bool tachyon::GUIApplication::BeginArea | ( | ID | id, |
| StyleRef | style, | ||
| LayoutOverride && | constraints = {} ) |
A container drawn in style, for grouping content; it scrolls when bounded and its style has overflow: auto.
|
inline |
As above, in the theme's area style.
|
inline |
As above, with the call site as the ID.
|
inline |
As above, with the call site as the ID, in the theme's area style.
| void tachyon::GUIApplication::EndArea | ( | ) |
Closes BeginArea.
| bool tachyon::GUIApplication::BeginCached | ( | ID | id, |
| StyleRef | style, | ||
| uint64_t | signature = 0, | ||
| LayoutOverride && | constraints = {} ) |
A container (like BeginArea) whose drawing is kept: while nothing changed it returns false, skipping the content, and the kept drawing is shown.
EndCached is called either way. id must be the same every frame (for example a static ID). The content is rebuilt when its size changes, when input reaches it, when signature changes, or after Invalidate(id); change signature when it shows data the cache can't see change.
|
inline |
As above, in the theme's area style.
| void tachyon::GUIApplication::EndCached | ( | ) |
Closes BeginCached; called whether or not it returned true.
| void tachyon::GUIApplication::Invalidate | ( | ID | id | ) |
Rebuilds id's cached scope, and those around it, next frame. Safe from event handlers.
|
inline |
Enables the retained-render cache (on by default). When off, every scope rebuilds.
| void tachyon::GUIApplication::InvalidatePanel | ( | ID | panelId | ) |
Invalidates a docked panel's cached content by panel id. Safe from event handlers.
| bool tachyon::GUIApplication::BeginHorizontal | ( | ID | id, |
| StyleRef | style, | ||
| LayoutOverride && | constraints = {} ) |
Undecorated flex containers; the Wrap variants wrap onto further lines/columns.
|
inline |
As above, in the theme's plain style.
|
inline |
As above, with the call site as the ID.
|
inline |
As above, with the call site as the ID, in the theme's plain style.
| void tachyon::GUIApplication::EndHorizontal | ( | ) |
Closes BeginHorizontal.
| bool tachyon::GUIApplication::BeginHorizontalWrap | ( | ID | id, |
| StyleRef | style, | ||
| LayoutOverride && | constraints = {} ) |
A horizontal container whose children wrap onto further lines.
|
inline |
As above, in the theme's plain style.
|
inline |
As above, with the call site as the ID.
|
inline |
As above, with the call site as the ID, in the theme's plain style.
| void tachyon::GUIApplication::EndHorizontalWrap | ( | ) |
Closes BeginHorizontalWrap.
| bool tachyon::GUIApplication::BeginVertical | ( | ID | id, |
| StyleRef | style, | ||
| LayoutOverride && | constraints = {} ) |
A vertical container.
|
inline |
As above, in the theme's plain style.
|
inline |
As above, with the call site as the ID.
|
inline |
As above, with the call site as the ID, in the theme's plain style.
| void tachyon::GUIApplication::EndVertical | ( | ) |
Closes BeginVertical.
| bool tachyon::GUIApplication::BeginVerticalWrap | ( | ID | id, |
| StyleRef | style, | ||
| LayoutOverride && | constraints = {} ) |
A vertical container whose children wrap onto further columns.
|
inline |
As above, in the theme's plain style.
|
inline |
As above, with the call site as the ID.
|
inline |
As above, with the call site as the ID, in the theme's plain style.
| void tachyon::GUIApplication::EndVerticalWrap | ( | ) |
Closes BeginVerticalWrap.
| bool tachyon::GUIApplication::BeginToolbar | ( | bool | horizontal = true | ) |
Toolbar scope: a wrap container that swaps theme.controls to the toolbar styles, so default-style widgets inside use their toolbar variants.
| void tachyon::GUIApplication::EndToolbar | ( | ) |
Closes BeginToolbar.
A vertical scrollbar for containerID, called from inside it: it overlays the container's border box and draws nothing without overflow.
|
inline |
As above, with an ID derived from the container's.
As VerticalScrollbar, horizontal.
|
inline |
As above, with an ID derived from the container's.
| void tachyon::GUIApplication::ScrollbarOverlay | ( | ID | containerID, |
| int2 | lastInnerSize = int2{0, 0}, | ||
| ID | vertScrollBarID = ID::Invalid(), | ||
| ID | horzScrollBarID = ID::Invalid(), | ||
| bool | emitVert = true, | ||
| bool | emitHorz = true ) |
Both bars plus a corner cap; each hides itself without overflow.
lastInnerSize (the container's last-frame inner size) trims the bars around the cap.
| bool tachyon::GUIApplication::BeginReorderableGroup | ( | ID | id, |
| ReorderDirection | direction, | ||
| bool | isWrapped, | ||
| std::function< void(int fromIndex, int toIndex)> | onReorder, | ||
| StyleRef | style, | ||
| LayoutOverride && | constraints = {}, | ||
| std::function< void(int, tachyon::int2)> | onDragOut = nullptr, | ||
| std::function< void(int, tachyon::int2)> | dragVisualizer = nullptr ) |
A container of BeginReorderableItem scopes the user reorders by dragging.
onReorder(from, to) runs on drop; isWrapped lets items wrap onto more lines.
|
inline |
As above, not wrapped.
|
inline |
As above, not wrapped, in the theme's style for the direction.
|
inline |
As above, in the theme's style for the direction and wrapping.
|
inline |
As above, with the call site as the ID.
|
inline |
As above, with the call site as the ID, in the theme's style for the direction and wrapping.
|
inline |
As above, not wrapped, with the call site as the ID.
|
inline |
As above, not wrapped, with the call site as the ID, in the theme's style for the direction.
|
inline |
The theme's reorderable group style for a direction and wrapping.
| void tachyon::GUIApplication::EndReorderableGroup | ( | ) |
Closes BeginReorderableGroup.
| bool tachyon::GUIApplication::BeginReorderableItem | ( | ID | id, |
| StyleRef | style, | ||
| LayoutOverride && | constraints = {} ) |
One draggable item of a reorderable group; any content goes inside.
|
inline |
As above, in the theme's item style.
|
inline |
As above, with the call site as the ID.
|
inline |
As above, with the call site as the ID, in the theme's item style.
| void tachyon::GUIApplication::EndReorderableItem | ( | ) |
Closes BeginReorderableItem.
| void tachyon::GUIApplication::EmitDragHandle | ( | ) |
Non-interactive drag handle for use inside BeginReorderableItem; clicks reach the item.
| bool tachyon::GUIApplication::BeginListView | ( | ID | id, |
| int * | selectedIndex, | ||
| int | itemCount, | ||
| ItemDragDropConfig * | dragDrop, | ||
| StyleRef | style, | ||
| LayoutOverride && | constraints = {} ) |
Opens a list view of ListItems.
selectedIndex (optional) holds the selection, which a click or Up / Down changes; itemCount bounds the keys. dragDrop (optional) lets items be dragged.
|
inline |
As above, without drag and drop.
|
inline |
As above, without drag and drop, in the theme's list style.
|
inline |
As above, with the call site as the ID.
|
inline |
As above, with drag and drop, in the theme's list style.
|
inline |
As above, with the call site as the ID.
|
inline |
As above, with the call site as the ID, in style.
|
inline |
As above, without drag and drop, with the call site as the ID, in style.
| void tachyon::GUIApplication::EndListView | ( | ) |
Closes BeginListView.
| int tachyon::GUIApplication::FindListItemIndex | ( | tachyon::ID | id | ) | const |
A list item's index by ID, for end-of-frame handlers; -1 if unknown.
Filled only for lists with drag and drop.
| bool tachyon::GUIApplication::ListItem | ( | ID | id, |
| const GUIContent & | content, | ||
| StyleRef | style, | ||
| LayoutOverride && | constraints = {} ) |
One item of a list view, drawn selected when it is the selected index. True when clicked.
|
inline |
As above, in the theme's item style.
|
inline |
As above, with the call site as the ID.
|
inline |
As above, with the call site as the ID, in style.
|
static |
Recomputes skipCount / ancestorLineMask / isLastSibling from row depths.
Call after any structural change. O(n^2) worst case.
|
static |
Writes the flat indices of visible rows (honoring isOpen) to visibleIdx.
| void tachyon::GUIApplication::VirtualTreeView | ( | ID | id, |
| std::vector< TreeViewRow > & | rows, | ||
| std::vector< int > & | visibleIdx, | ||
| TableState & | state, | ||
| StyleRef | style = {}, | ||
| LayoutOverride && | constraints = {}, | ||
| std::string_view | header = {} ) |
Single-column virtualized tree view (a VirtualTable with one TreeCell column).
A non-empty header shows the header row.
|
inline |
As above, with the call site as the ID.
|
inline |
The tree row a drag is over (drives the drop indicator), or Invalid.
|
inline |
Whether files or text from another application are dragged over one of the app's windows.
What's dragged is known only once it's dropped.
|
inline |
The element that takes that drag where it is now: the first from the one under the pointer up whose handler returned true to EventType::FileDragOver.
Invalid when none does. Draw it as the drop target.
|
inline |
Gets the drops no element took (none returned true to EventType::FileDrop): the application's own, such as opening the files.
|
inline |
Items emitted in between render as selected.
|
inline |
Closes BeginSelected.
|
inline |
Controls emitted in between are disabled: drawn dimmed, and they take no input.
|
inline |
Closes BeginDisabled.
|
inline |
Controls emitted in between show that their value isn't accepted: the theme's error border (–error) and halo (–invalid-halo) over whatever state they're in.
The halo grows in over 150 ms.
|
inline |
Closes BeginInvalid.
| bool tachyon::GUIApplication::BeginGridView | ( | ID | id, |
| int * | selectedIndex, | ||
| StyleRef | style, | ||
| MultiSelectState * | multiSelect = nullptr, | ||
| ItemDragDropConfig * | dragDrop = nullptr, | ||
| LayoutOverride && | constraints = {} ) |
Opens a grid view of GridViewItems.
selectedIndex (optional) holds a single selection, multiSelect (optional) a multi-selection; dragDrop (optional) lets items be dragged. Arrow keys move the selection.
|
inline |
As above, in the theme's grid style.
|
inline |
As above, with the call site as the ID, in style.
|
inline |
As above, with the call site as the ID, in the theme's grid style.
| void tachyon::GUIApplication::EndGridView | ( | ) |
Closes BeginGridView.
| bool tachyon::GUIApplication::GridViewItem | ( | ID | id, |
| const GUIContent & | content, | ||
| tachyon::ElementState | extraState = tachyon::ElementState::None, | ||
| std::string * | renameBuffer = nullptr, | ||
| StyleRef | itemStyle = {}, | ||
| LayoutOverride && | constraints = {} ) |
renameBuffer (optional) enables in-place rename: F2, Ctrl+Shift+Click or a slow re-click opens an editor.
Enter commits; Escape or focus loss cancels.
|
inline |
As above, without rename.
|
inline |
As above, with the call site as the ID.
|
inline |
Without rename, in style.
|
inline |
Without rename, with the call site as the ID, in style.
|
inline |
Whether an inline rename editor (a grid item's, a tree row's) is open; an app that sorts by name re-sorts once it closes.
| void tachyon::GUIApplication::VirtualGridView | ( | ID | id, |
| GridViewVirtualState & | vstate, | ||
| int | itemCount, | ||
| int2 | cellSize, | ||
| const std::function< void(int index, ID itemID)> & | generateItem, | ||
| int * | selectedIndex = nullptr, | ||
| MultiSelectState * | multiSelect = nullptr, | ||
| ItemDragDropConfig * | dragDrop = nullptr, | ||
| StyleRef | scrollStyle = {}, | ||
| StyleRef | rowStyle = {}, | ||
| LayoutOverride && | constraints = {} ) |
generateItem(index, itemID) must emit exactly one cell, typically GridViewItem(itemID, ...).
itemID is a stable ranged sub-ID (index = id.value.subRangeParts.index), used for selection and drag payloads. Cells are cellSize, with a 4px gap between columns.
|
inline |
As above, with the call site as the ID.
| bool tachyon::GUIApplication::BeginTable | ( | ID | id, |
| VirtualTableColumn * | columns, | ||
| size_t | columnCount, | ||
| TableState & | state, | ||
| StyleRef | style, | ||
| LayoutOverride && | constraints = {} ) |
Opens a table.
Columns are described each frame; widths, selection and sort state live in the caller's TableState. Rows are BeginRow / EndRow with Cell(text) or Cell(emit); EndTable builds them as a VirtualTable. columns must stay valid until EndTable.
|
inline |
As above, in the theme's table style.
|
inline |
As above, for a C array of columns.
|
inline |
As above, for a C array of columns, in the theme's table style.
|
inline |
As above, with the call site as the ID.
|
inline |
As above, with the call site as the ID, in the theme's table style.
|
inline |
As above, for a C array of columns, with the call site as the ID.
|
inline |
As above, for a C array of columns, with the call site as the ID, in the theme's table style.
| void tachyon::GUIApplication::EndTable | ( | ) |
Builds the recorded rows as a VirtualTable.
| bool tachyon::GUIApplication::BeginRow | ( | ) |
Starts a row; its Cells fill the columns in order.
| void tachyon::GUIApplication::EndRow | ( | ) |
Ends the row.
| void tachyon::GUIApplication::Cell | ( | std::string_view | text | ) |
Cells auto-advance to the next column.
| void tachyon::GUIApplication::Cell | ( | std::function< void()> | emit | ) |
Custom-content cell: emit runs inside the cell during EndTable, so its captures must live until then.
| void tachyon::GUIApplication::TreeCell | ( | std::string_view | text, |
| int | depth, | ||
| bool * | isOpen, | ||
| IconID | icon = IconID::Invalid, | ||
| uint32_t | ancestorLineMask = 0, | ||
| bool | isLastSibling = true, | ||
| std::string * | renameBuffer = nullptr, | ||
| bool | reserveExpander = true ) |
Tree-style first column: [indent][arrow or spacer][optional icon][text].
depth horizontal indent (pixels = depth * theme.treeTableIndent). isOpen null for leaves (no arrow). Non-null toggles on click. icon optional leading icon rendered between arrow and text. ancestorLineMask bit d set iff the ancestor at depth d+1 has a next sibling (its guide line passes through this row at column d). isLastSibling true -> own-depth L-tick stops at row center. renameBuffer optional; enables in-place rename (F2 / Ctrl+Shift+Click / slow re-click). reserveExpander false drops the arrow slot for leaves (for flat trees).
Arrow clicks toggle without selecting; other clicks select the row.
| void tachyon::GUIApplication::VirtualTable | ( | ID | id, |
| TableState & | state, | ||
| std::span< VirtualTableColumn > | columns, | ||
| int | totalRowCount, | ||
| CssPx | rowHeight = 0, | ||
| StyleRef | style = {}, | ||
| LayoutOverride && | constraints = {} ) |
Virtual-scrolled table: emits only the visible rows, under one ranged ID.
Frozen columns get their own body section (left / mid / right), scroll-synced.
columns : each carries its own generateCell(rowIndex), so reordering the array reorders headers and cells together. A C array converts to the span. rowHeight : row-height floor; 0 uses the style's natural row height. Headers, cell style and separators are TableState options.
|
inline |
As above, with the call site as the ID.
| bool tachyon::GUIApplication::Breadcrumb | ( | ID | id, |
| std::span< const std::string > | segments, | ||
| std::function< void(int)> | onSelect, | ||
| StyleRef | style, | ||
| LayoutOverride && | constraints = {} ) |
A path such as Graphs > Terrain material: segments separated by chevrons, the last one current.
Clicking another segment calls onSelect(index) and returns true.
|
inline |
As above, in the theme's breadcrumb style.
|
inline |
As above, with the call site as the ID.
|
inline |
As above, with the call site as the ID, in style.
| bool tachyon::GUIApplication::BeginStatusBar | ( | ID | id, |
| StyleRef | style, | ||
| LayoutOverride && | constraints = {} ) |
A strip of short status texts, usually along a window's bottom edge.
Give one StatusText FlexGrow(1) to push the texts after it to the right.
|
inline |
As above, in the theme's status bar style.
|
inline |
As above, with the call site as the ID.
|
inline |
As above, with the call site as the ID, in style.
| void tachyon::GUIApplication::EndStatusBar | ( | ) |
Closes BeginStatusBar.
| void tachyon::GUIApplication::StatusText | ( | ID | id, |
| std::string_view | text, | ||
| StyleRef | style, | ||
| LayoutOverride && | constraints = {} ) |
A text in the status bar.
|
inline |
As above, in the theme's status text style.
|
inline |
As above, with the call site as the ID.
|
inline |
As above, with the call site as the ID, in the theme's status text style.
| bool tachyon::GUIApplication::CommandSearch | ( | ID | id, |
| CommandSearchState & | state, | ||
| StyleRef | style, | ||
| LayoutOverride && | constraints = {} ) |
Finds and runs commandManager's commands: focused, it lists those whose description contains the query; Up / Down move through them, Enter or a click runs one, Escape leaves.
state must outlive the frame. True when a command ran since the last call.
|
inline |
As above, in the theme's command search style.
|
inline |
As above, with the call site as the ID.
|
inline |
As above, with the call site as the ID, in the theme's command search style.
|
inlinestatic |
Puts the keyboard in the search next frame; bind it to a command such as Ctrl+K.
| void tachyon::GUIApplication::RenderNodeView | ( | NodeView & | view | ) |
Builds view (canvas, nodes, wires and overlays) in the current container.
| void tachyon::GUIApplication::NodeText | ( | std::string_view | text | ) |
Text property body aligned by the row's sockets: left => left, right => right, both => centre.
Call inside NodeProperty::renderBody.
| bool tachyon::GUIApplication::BeginTabBar | ( | ID | id, |
| int * | selectedIndex, | ||
| std::function< void(int, int)> | onReorder, | ||
| std::function< void(int)> | onClose = nullptr, | ||
| std::function< void(int, tachyon::int2)> | onDragOut = nullptr, | ||
| std::function< void(int, tachyon::int2)> | dragVisualizer = nullptr, | ||
| StyleRef | style = {}, | ||
| LayoutOverride && | constraints = {}, | ||
| TabBarLayout * | layout = nullptr, | ||
| const TabBarOptions & | options = {} ) |
Opens a tab bar of Tabs.
selectedIndex holds the selected tab; onReorder(from, to) runs on a drop, onClose(index) closes a tab (none when null); onDragOut and dragVisualizer as for BeginReorderableGroup. Layout says what happens to tabs that don't fit on one row (TabBarLayout); the bar's context menu changes it. Null keeps it with the bar, by its ID. options: the close item's label, the "+N" list, the layout menu.
|
inline |
As above, with the call site as the ID.
| void tachyon::GUIApplication::EndTabBar | ( | ) |
Closes BeginTabBar.
| bool tachyon::GUIApplication::Tab | ( | ID | id, |
| const GUIContent & | content, | ||
| StyleRef | style, | ||
| LayoutOverride && | constraints = {} ) |
One tab of the tab bar; a click selects it. True when clicked.
| bool tachyon::GUIApplication::BeginTab | ( | ID | id, |
| const GUIContent & | content, | ||
| StyleRef | style, | ||
| StyleRef | contentStyle, | ||
| LayoutOverride && | constraints = {} ) |
A tab with more in it: its icon and text in contentStyle (the theme's when invalid), then whatever is added up to EndTab, which every BeginTab needs.
False when the tab doesn't fit the bar (it's listed by "+N"): add nothing to it then.
| void tachyon::GUIApplication::EndTab | ( | ) |
Closes BeginTab.
|
inline |
As above, in the theme's tab style.
|
inline |
As above, with the call site as the ID.
|
inline |
As above, with the call site as the ID, in style.
| bool tachyon::GUIApplication::BeginDockingContainer | ( | ID | id, |
| DockingLayout * | layout, | ||
| StyleRef | style, | ||
| LayoutOverride && | constraints = {} ) |
Builds Layout's docked panels (each one's onPanelGUI) in a container, enabling the visible panels first.
Then call EmitFloatingDockWindows.
|
inline |
As above, in the theme's dock style.
|
inline |
As above, with the call site as the ID.
|
inline |
As above, with the call site as the ID, in the theme's dock style.
| void tachyon::GUIApplication::EndDockingContainer | ( | ) |
Closes BeginDockingContainer.
| void tachyon::GUIApplication::Documents | ( | ID | id, |
| DocumentSet & | set, | ||
| LayoutOverride && | constraints = {} ) |
The document bar of set, under the title bar, and below it the active document's panels, filling the rest of the window's column.
Each tab is in its document type's colors; a click shows that document, its close button (or Ctrl+W) asks DocumentSet::onClose and closes it on the next frame. Then call EmitFloatingDockWindows.
| bool tachyon::GUIApplication::Field | ( | ID | id, |
| bool & | value, | ||
| std::string_view | text, | ||
| StyleRef | style, | ||
| LayoutOverride && | constraints = {} ) |
A bool as a Toggle labelled Text.
|
inline |
As above, with the call site as the ID.
|
inline |
As above, in the theme's toggle style.
|
inline |
As above, with the call site as the ID, in the theme's toggle style.
| bool tachyon::GUIApplication::Field | ( | ID | id, |
| std::string & | value, | ||
| TextEditBehavior | textEditBehavior, | ||
| StyleRef | style, | ||
| LayoutOverride && | constraints = {} ) |
A text field editing value; true when it changed.
With ContinuousUpdate the value changes on every keystroke, else when the edit is committed.
|
inline |
As above, with the call site as the ID.
|
inline |
As above, updating continuously.
|
inline |
As above, with the call site as the ID.
|
inline |
As the first, in the theme's text box style.
|
inline |
As above, with the call site as the ID.
|
inline |
As the first, updating continuously, in the theme's text box style.
|
inline |
As above, with the call site as the ID.
|
inline |
A Field with a leading icon inside its border; style is the border's.
|
inline |
As above, in the theme's search style.
|
inline |
As above, with the call site as the ID.
|
inline |
As above, with the call site as the ID, in the theme's search style.
| bool tachyon::GUIApplication::AutocompleteField | ( | ID | id, |
| std::string & | value, | ||
| std::span< const std::string_view > | suggestions, | ||
| StyleRef | style, | ||
| LayoutOverride && | constraints = {} ) |
A text field that lists, under itself while it has the keyboard and holds text, the suggestions that contain that text (ignoring case), at most 12.
Up / Down highlight one, Enter or a click puts it into value; nothing is highlighted until Down, so Enter keeps what was typed. Escape, a pick or a click elsewhere closes the list; typing opens it again. True when value changed: typed, or a suggestion picked.
|
inline |
As above, in the theme's textbox style.
|
inline |
As above, with the call site as the ID.
|
inline |
As above, with the call site as the ID, in the theme's textbox style.
|
inline |
A number field; for a vector type (TypeDimensions), a field per component, each after a colored axis label that drags it.
config sets the drag step and the range. True when the value changed.
|
inline |
As above, in the theme's number style.
|
inline |
As above, with the default config.
|
inline |
As above, updating continuously.
|
inline |
As the first, updating continuously.
|
inline |
As the first, updating continuously, with the default config.
|
inline |
As the first, updating continuously, in the theme's number style.
|
inline |
As the first, with the call site as the ID, updating continuously, with the default config.
|
inline |
As the first, with the call site as the ID.
|
inline |
As the first, with the call site as the ID, updating continuously.
|
inline |
As the first, with the call site as the ID and the default config.
|
inline |
As the first, with the call site as the ID, in the theme's number style.
|
inline |
As the first, with the call site as the ID, updating continuously, in the theme's number style.
|
inline |
As the first, with the call site as the ID and the default config, in the theme's number style.
|
inline |
As the first, with the call site as the ID and the default config, updating continuously, in the theme's number style.
|
inlinestaticconstexpr |
A number's type as a short tag: f32, f64, i8 ... u64 (empty for other types).
|
inline |
A number field with its type after the value, e.g. "0.5 f32".
|
inline |
As above; style is the box's around the number and its type.
|
inline |
As above, with the call site as the ID.
|
inline |
As above, with the call site as the ID and a style for the box.
|
inline |
A reorderable list: each row a grip, its index, the field (numbers with their type) and a remove button; "Add item" after the rows.
The ID must be the same every frame so the reorder state survives.
|
inline |
As above, in the theme's collection style.
|
inline |
As above, with the call site as the ID.
|
inline |
As above, with the call site as the ID, in the theme's collection style.
|
inline |
A key-value list (std::string keys, V values): a Key / Value header with the types, then a row per entry (key, value, remove) and "Add entry".
|
inline |
As above, in the theme's collection style.
|
inline |
As above, with the call site as the ID.
|
inline |
As above, with the call site as the ID, in the theme's collection style.
|
inline |
Key-value list over an unordered_map.
Row order can change when the map rehashes; use the vector-of-pairs version for stable rows.
|
inline |
As above, in the theme's collection style.
|
inline |
As above, with the call site as the ID.
|
inline |
As above, with the call site as the ID, in the theme's collection style.
| void tachyon::GUIApplication::CollectionHeader | ( | std::string_view | valueType | ) |
A dictionary's header row: "Key string", "Value <type>".
| bool tachyon::GUIApplication::ColorField | ( | ID | id, |
| tachyon::color4f & | value, | ||
| bool | allowHDR, | ||
| StyleRef | style, | ||
| LayoutOverride && | constraints = {} ) |
A color swatch that opens a color picker; true when the color changed.
allowHDR lets the picker take brightness over 1.
|
inline |
As above, in the theme's color field style.
|
inline |
As above, with the call site as the ID.
|
inline |
As above, with the call site as the ID, in the theme's color field style.
| bool tachyon::GUIApplication::ColorField | ( | ID | id, |
| tachyon::color4b & | value, | ||
| StyleRef | style, | ||
| LayoutOverride && | constraints = {} ) |
As above, for an 8-bit color.
|
inline |
As above, in the theme's color field style.
|
inline |
As above, with the call site as the ID.
|
inline |
As above, with the call site as the ID, in the theme's color field style.
| bool tachyon::GUIApplication::GradientField | ( | ID | id, |
| tachyon::Gradient & | value, | ||
| StyleRef | style, | ||
| LayoutOverride && | constraints = {} ) |
A gradient swatch that opens a gradient editor; true when the gradient changed.
|
inline |
As above, in the theme's gradient swatch style.
|
inline |
As above, with the call site as the ID.
|
inline |
As above, with the call site as the ID, in the theme's gradient swatch style.
| bool tachyon::GUIApplication::SliderField | ( | ID | id, |
| float & | value, | ||
| float | minVal, | ||
| float | maxVal, | ||
| std::string_view | text, | ||
| StyleRef | style, | ||
| LayoutOverride && | constraints = {} ) |
A label, a slider track and a number field for value in [minVal, maxVal]; true when it changed.
|
inline |
As above, in the theme's slider field style.
|
inline |
As above, with the call site as the ID.
|
inline |
As above, with the call site as the ID, in the theme's slider field style.
| bool tachyon::GUIApplication::SliderField | ( | ID | id, |
| int & | value, | ||
| int | minVal, | ||
| int | maxVal, | ||
| std::string_view | text, | ||
| StyleRef | style, | ||
| LayoutOverride && | constraints = {} ) |
Integer variant: snaps to whole numbers.
|
inline |
As above, in the theme's slider field style.
|
inline |
As above, with the call site as the ID.
|
inline |
As above, with the call site as the ID, in the theme's slider field style.
| bool tachyon::GUIApplication::Slider | ( | ID | id, |
| int & | value, | ||
| int | minVal, | ||
| int | maxVal, | ||
| StyleRef | style, | ||
| LayoutOverride && | constraints = {} ) |
Groove + knob without value text; drag-only, integer-valued.
|
inline |
As above, in the theme's slider style.
|
inline |
As above, with the call site as the ID.
|
inline |
As above, with the call site as the ID, in the theme's slider style.
| void tachyon::GUIApplication::DragLabel | ( | ID | id, |
| std::string_view | text, | ||
| StyleRef | style, | ||
| LayoutOverride && | constraints = {} ) |
A label whose horizontal drag changes the value of the field after it; a click focuses that field and Escape cancels a drag.
In a label group it takes the group's width.
|
inline |
As above, in the theme's drag label style.
|
inline |
As above, with the call site as the ID.
|
inline |
As above, with the call site as the ID, in the theme's drag label style.
| void tachyon::GUIApplication::Label | ( | ID | id, |
| std::string_view | text, | ||
| StyleRef | style, | ||
| LayoutOverride && | constraints = {} ) |
A label for the control after it: a click focuses that control.
In a label group it takes the group's width.
| void tachyon::GUIApplication::Label | ( | ID | id, |
| std::string_view | text, | ||
| std::string_view | caption, | ||
| StyleRef | style, | ||
| LayoutOverride && | constraints = {} ) |
A label over a field taller than a row (a list): at the top, with a caption under it such as "3 items".
|
inline |
As above, in the theme's top label style.
|
inline |
As above, with the call site as the ID.
|
inline |
As above, with the call site as the ID, in the theme's top label style.
|
inline |
As the first, in the theme's label style.
|
inline |
As the first, with the call site as the ID.
|
inline |
As the first, with the call site as the ID, in the theme's label style.
| void tachyon::GUIApplication::Text | ( | ID | id, |
| std::string_view | text, | ||
| StyleRef | style, | ||
| LayoutOverride && | constraints = {} ) |
Static text.
|
inline |
As above, in the theme's text style.
|
inline |
As above, with the call site as the ID.
|
inline |
As above, with the call site as the ID, in the theme's text style.
| void tachyon::GUIApplication::SelectableText | ( | ID | id, |
| const std::span< ContentRun > & | runs, | ||
| std::function< void(intptr_t contentId)> | onLinkActivate, | ||
| StyleRef | style, | ||
| LayoutOverride && | constraints = {} ) |
Read-only rich text with links, mouse selection and Ctrl+C.
onLinkActivate (optional) gets a clicked link's contentId. The ID must be the same every frame for the selection to last.
|
inline |
As above, without link handling.
|
inline |
As above, in the theme's text style.
|
inline |
As above, with the call site as the ID (the same every frame).
|
inline |
As above, with the call site as the ID, in the theme's text style.
| void tachyon::GUIApplication::Image | ( | ID | id, |
| ImageIndex | image, | ||
| StyleRef | style, | ||
| LayoutOverride && | constraints = {} ) |
Draws image (from graphicsContext->RegisterImage) stretched over the element's box.
|
inline |
As above, in the theme's image style.
|
inline |
As above, with the call site as the ID.
|
inline |
As above, with the call site as the ID, in the theme's image style.
| void tachyon::GUIApplication::Image | ( | ID | id, |
| ImageIndex | image, | ||
| uint2 | sourceSize, | ||
| StyleRef | style, | ||
| LayoutOverride && | constraints = {} ) |
Aspect-preserving: sizes the element to the largest sourceSize-aspect rect that fits the constraints.
sourceSize is the image's pixel size.
|
inline |
As above, in the theme's image style.
|
inline |
As above, with the call site as the ID.
|
inline |
As above, with the call site as the ID, in the theme's image style.
A ghost window: caption-less and transparent, e.g.
a drag preview; 28 x 28 CSS px. Close it with EndGhostWindow, whether or not it opened.
|
inline |
position is the top-left in screen space; for drag previews use BeginCursorGhostWindow.
|
inline |
As above, in the theme's ghost window style.
|
inline |
Sized to its content.
|
inline |
Where a ghost sits from the cursor, clear of the OS cursor: 14 px for a 32 px cursor, in proportion for others, 14 CSS px when the backend can't tell the cursor's size.
A ghost window at the cursor, offset by CursorGhostOffset; 28 x 28 CSS px.
|
inline |
As above, with a size and style.
|
inline |
As above, with a size.
|
inline |
As above, with a style, sized to its content.
|
inline |
An icon in the open ghost window, 28 x 28 CSS px.
|
inline |
Closes BeginGhostWindow or BeginCursorGhostWindow.
|
inline |
As the full BeginWindow below, in the theme's window style.
|
inline |
As the full BeginWindow below.
|
inline |
As the full BeginWindow below, in the theme's window style.
|
inline |
As the full BeginWindow below, without a title, in the theme's window style.
|
inline |
As the full BeginWindow below, without a title.
|
inline |
As the full BeginWindow below, without a title, in the theme's window style.
|
inline |
As the full BeginWindow below, without a title.
|
inline |
An OS window, made the first time its ID is seen; build its content while this returns true.
flags (ElementFlags::Window*) set how it behaves; monitorIndex is the monitor a new window opens on (-1: the one at its fixed position, else the primary). EndWindow is called either way.
|
inline |
Internal: the body of BeginWindow; call BeginWindow.
|
inline |
Closes BeginWindow; called whether or not it returned true.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Internal: the body of EndWindow for an open window; call EndWindow.
|
inline |
A plain box of a fixed size in pixels, in a style; textID is optional.
|
inline |
As above, with the call site as the ID.
|
inline |
As above, with text.
|
inline |
As above, with an icon and text.
|
inline |
As above, sized to its content.
|
inline |
A box with text, sized to its content, with the call site as the ID.
|
inline |
A fixed-size box with text, with the call site as the ID.
| void tachyon::GUIApplication::RenderSettingsPanel | ( | SettingsPanelState & | state | ) |
Renders into the current container; the caller provides the outer panel.
| void tachyon::GUIApplication::PersistWindow | ( | std::string | key, |
| ID | windowID ) |
Keeps the window's position, size and mode.
| void tachyon::GUIApplication::PersistDocking | ( | std::string | key, |
| DockingLayout & | layout ) |
Keeps the layout's dock tree; panels are matched by type, else by title.
| void tachyon::GUIApplication::PersistTable | ( | std::string | key, |
| TableState & | state, | ||
| std::span< VirtualTableColumn > | columns ) |
Keeps the table's column widths and order, matching columns by header.
| void tachyon::GUIApplication::PersistToolbars | ( | std::string | key, |
| std::span< std::vector< ToolbarItem >, kToolbarSideCount > | sides ) |
Keeps each side's toolbar items, by debugName.
| void tachyon::GUIApplication::PersistValue | ( | std::string | key, |
| bool & | value ) |
Keeps an app value.
| void tachyon::GUIApplication::PersistValue | ( | std::string | key, |
| int & | value ) |
As above, for an int.
| void tachyon::GUIApplication::PersistValue | ( | std::string | key, |
| float & | value ) |
As above, for a float.
| void tachyon::GUIApplication::PersistValue | ( | std::string | key, |
| std::string & | value ) |
As above, for a string.
| void tachyon::GUIApplication::PersistDocuments | ( | std::string | key, |
| std::function< std::vector< DocumentWindowRef >()> | windows ) |
Keeps the documents of each main window that Windows and platform lists when the state is saved: their names, kinds and order, the active one, each one's dock tree, and the window's position, size and mode.
The app makes them again (TakeSavedDocuments).
| void tachyon::GUIApplication::PersistShortcuts | ( | std::string | key, |
| CommandManager & | commands ) |
Keeps the shortcuts that aren't the ones their commands were registered with, matching commands by mode name and description.
Register the commands before RestoreUIState; ones it doesn't find keep their own.
| std::vector< SavedDocumentWindow > tachyon::GUIApplication::TakeSavedDocuments | ( | std::string_view | key | ) |
The main windows of documents RestoreUIState read for key, in the order they were listed; empty when none were saved.
Taking them clears them. Make each document with its panels, then RestoreDocumentLayout, and place each window with RestoreWindowPlace.
| bool tachyon::GUIApplication::RestoreDocumentLayout | ( | Document & | document, |
| const SavedDocument & | saved ) |
Lays a document's panels out as saved: panels by type, else title; ones the saved tree doesn't have go to its first leaf.
False (the layout stays) when it can't be read.
| void tachyon::GUIApplication::RestoreWindowPlace | ( | ID | windowID, |
| const SavedDocumentWindow & | saved ) |
Puts a window where saved was when it's next declared, as PersistWindow does (on its monitor, or the same place on another).
Nothing when no place was saved.
| std::string tachyon::GUIApplication::SaveUIState | ( | ) | const |
The named state as JSON text.
| Result< void > tachyon::GUIApplication::RestoreUIState | ( | std::string_view | json | ) |
Applies JSON text from SaveUIState.
An error when it doesn't parse, isn't an object or was saved by a newer version.
|
friend |
GUIApplicationInternals (gui_application_internal.h) re-exposes these to the library's own code and the tests.
| std::unique_ptr<InputManager> tachyon::GUIApplication::inputManager |
Routes input events to the elements; also holds global handlers. Created by Initialize.
| std::unique_ptr<LayoutEngine> tachyon::GUIApplication::layoutEngine |
Lays out the elements each frame. Created by Initialize.
| std::unique_ptr<OSWindowManager> tachyon::GUIApplication::windowManager |
The OS windows and their render contexts. Created by Initialize.
| std::unique_ptr<TextAtlasManager> tachyon::GUIApplication::textAtlasManager |
The glyph atlas. Created by Initialize.
| std::unique_ptr<IClipboard> tachyon::GUIApplication::clipboard |
from SetClipboard
| ITextSystem* tachyon::GUIApplication::textSystem { nullptr } |
Shapes, measures and edits text. Created by Initialize.
| IWindowBackend* tachyon::GUIApplication::windowBackend { nullptr } |
SetWindowBackend's windows plus render-to-image windows.
| GraphicsContext* tachyon::GUIApplication::graphicsContext { nullptr } |
the backend from SetGraphicsBackend
| GUIRenderer* tachyon::GUIApplication::guiRenderer { nullptr } |
The graphics backend's renderer.
| IDManager tachyon::GUIApplication::idManager {} |
Element IDs: static ones (CreateStaticID), call-site ones (AllocateDynamicID) and parent scopes (PushParent / PopParent).
| GUIStateManager tachyon::GUIApplication::guiStateManager {} |
Per-element interaction state (hover, focus, clicks) and the construction stacks (disabled, selected).
| TransitionManager tachyon::GUIApplication::transitionManager {} |
In-progress visual state transitions, per element.
| TabChainManager tachyon::GUIApplication::tabChainManager {} |
The Tab-key focus order, rebuilt each frame.
| MenuManager tachyon::GUIApplication::menuManager {} |
The open menus and the menu bar's triggers.
| TooltipManager tachyon::GUIApplication::tooltipManager {} |
When a tooltip shows (delaySeconds) and for which element.
| GradientManager tachyon::GUIApplication::gradientManager {} |
GPU pages for the gradients styles use.
| StyleManager tachyon::GUIApplication::styleManager { gradientManager } |
The registered styles; Px converts CSS pixels to pixels at the UI scale.
| ElementStorage tachyon::GUIApplication::elementStorage { styleManager, &guiStateManager.GetElementDataStore() } |
This frame's element tree.
| WindowRegistry tachyon::GUIApplication::windowRegistry {} |
The elements of each window, filled as the windows are built.
| CommandManager tachyon::GUIApplication::commandManager {} |
Commands, their shortcuts and the undo history.
| InputHandlerBroadcaster tachyon::GUIApplication::inputBroadcaster {} |
Sends each platform input event to the input manager and the text system.
| OnGuiFunc tachyon::GUIApplication::onGui {} |
Runs a frame from inside the OS's modal resize loop, so windows repaint while resized.
Initialize sets it unless repaintWhileResizing is off or it is already set.
| GUITheme tachyon::GUIApplication::theme {} |
The loaded theme: the style refs, icons and metrics the controls use; theme.GetStyle finds a CSS class.
| bool tachyon::GUIApplication::applicationQuit = false |
Set to true to end Run (UpdateFrame then returns false).
| std::chrono::steady_clock::time_point tachyon::GUIApplication::m_frameStart {} |
Internal: when the current frame started (set by UpdateFrame).
| float tachyon::GUIApplication::frameTime = 0.0f |
The last frame's duration in seconds, including any vsync wait.
| float tachyon::GUIApplication::frameBuildTime = 0.0f |
CPU work per frame, excluding the vsync stall in present.
|
staticconstexpr |
~4s @ 60fps