|
TachyonUI 1.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 |
| Text and images to copy and paste (Get / Set, GetImage / SetImage); 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 () |
| Cleans up when Cleanup wasn't called (an early return, a failed test), so the device, windows and contexts don't outlive the application. | |
| 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 | SetAccent (std::optional< AccentColors > accent) |
| Replaces the palette's accent with accent (its dark color in a dark palette, its light one in a light palette), and the colors derived from it along with it; none goes back to the palette's own. | |
| const std::optional< AccentColors > & | GetAccent () const |
| SetAccent's accent; none while the palette's own is used. | |
| void | SetThemeVariable (std::string_view name, std::string_view value) |
| Sets a theme variable ("--bg-panel") to a CSS value ("#202020", "6px", "0 4px 12px rgba(0, 0, 0, 0.4)") for the theme loaded, in place of what its palette and the style files set, and of the accent. | |
| void | ClearThemeVariable (std::string_view name) |
| Back to the theme's own value for name. | |
| void | ClearThemeVariables () |
| Back to the theme's own values for all of them, for the theme loaded. | |
| const ThemeVariableOverrides & | GetThemeVariables () const |
| The variables set with SetThemeVariable for the theme loaded. | |
| 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. | |
| 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 or Run's pace 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) |
| The leaf whose content (as last laid out) holds screenPos, the part of it the point is in (an edge, or Center), and its layout; none off every leaf's content. | |
| 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 | ForgetDockingLayout (DockingLayout &layout) |
| Before an app destroys Layout: closes the windows of the panels torn off it (they would dock back into it) and stops saving it. | |
| void | ReleaseDockingLayout (DockingLayout &layout) |
| Closes a layout for good, as ForgetDockingLayout does, and empties it: its panels are hidden (onDisable) and destroyed, and the IDs CreatePanel made for them and its tree's go back. | |
| 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. | |
| void | ClaimCommandMode (ID owner, CommandMode mode) |
| For a control with shortcuts of its own (CommandManager::RegisterMode): while the focus is within owner, the command mode is mode; once it's within none, Default again. | |
| void | ClosePanel (DockingLayout &layout, ID panelID) |
| Closes a panel of Layout for good, wherever it is: out of its tree (its leaf closing up when it empties), hidden first (onDisable) if it's shown, its ID back when CreatePanel made it. | |
| 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). | |
| void | CloseAllDocuments (DocumentSet &set) |
| Closes every document of set, as CloseDocument does each: at exit, say. | |
| 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 | InjectPen (ID windowID, const PenState &pen) |
| The pen, before the pointer events it goes with; a default PenState is the mouse. | |
| void | InjectPinch (ID windowID, float scale, KeyModifier mods=KeyModifier::None) |
| A trackpad pinch by scale where the pointer is. | |
| 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, and of images. | |
| 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. | |
| void | SetWheelMode (WheelMode mode) |
| What the wheel and a trackpad's two-finger scroll do over the canvases that pan and zoom (node view, curve and timeline editors, plots): zoom, or scroll the view. | |
| WheelMode | GetWheelMode () const |
| The graphics backend Initialize uses; without one it creates a vulkan::VulkanGraphicsContext. | |
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. | |
| void | SetRedrawMode (RedrawMode mode) |
| How often Run draws a frame; RedrawMode::WhenNeeded by default, which sleeps while nothing changes. | |
| RedrawMode | GetRedrawMode () const |
| Builds the UI; called each frame. | |
| void | RequestRedraw () |
| Asks for a frame, for a change the UI can't see by itself: data from another thread, a value the app animates. | |
| void | RequestRedrawIn (float seconds) |
| Asks for a frame seconds from now (a clock's next tick). Safe from any thread. | |
| bool | NeedsFrame () const |
| Whether a frame is needed now. | |
| float | SecondsUntilFrame () const |
| Seconds until a frame is needed: 0 when NeedsFrame is true, INFINITY when nothing is due (only input or a request will need one). | |
Event handlers and control building blocks | |
| tachyon::EventHandler | MakeToggleHandler (bool &toggle) |
| A handler that flips toggle on click. | |
| template<class OnClick> | |
| tachyon::EventHandler | MakeButtonHandler (OnClick &&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. | |
| void | DrawnValid (tachyon::ElementRef ref) |
| The element just registered drawn as valid inside a BeginInvalid scope: the part of a control that shows it invalid is another one (a check box's box, not its row). | |
| 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, bool lit=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 | ShortcutButton (ID id, const CommandManager::Command &command, std::function< void()> onClick, std::string_view unassigned="Unassigned", LayoutOverride &&constraints={}) |
| A command's shortcut as keycaps, one per key ("Ctrl" "C"); a chord's two steps apart by a comma. | |
| 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 its shortcut in a chip after it ("Undo" then "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. | |
| bool | BusyButton (ID id, const GUIContent &content, bool busy, std::string_view busyText, std::function< void()> onClick, StyleRef style, LayoutOverride &&constraints={}) |
| A button at work: a spinner in place of its icon and busyText ("Saving...") in place of its text, as wide as it was before, and clicks ignored. | |
| bool | BusyButton (ID id, const GUIContent &content, bool busy, std::string_view busyText, std::function< void()> onClick, LayoutOverride &&constraints={}) |
| As above, in the theme's button style. | |
Progress and loading | |
Spinners, the sliding segment and the skeleton's shine move every frame; a BeginCached scope holding one is rebuilt every frame (ElementFlags::Animated). | |
| void | ProgressBar (ID id, float value, bool failed, StyleRef style, LayoutOverride &&constraints={}) |
| A bar value (0 to 1, clamped) of the way full; failed fills it in the error color, for work that stopped. | |
| void | ProgressBar (ID id, float value, LayoutOverride &&constraints={}) |
| As above, not failed, in the theme's bar style. | |
| void | ProgressBar (float value, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID. | |
| void | IndeterminateProgressBar (ID id, StyleRef style, LayoutOverride &&constraints={}) |
| A bar for work of unknown length: a segment with soft ends slides along it, from start to end every 1.2 s. | |
| void | IndeterminateProgressBar (ID id, LayoutOverride &&constraints={}) |
| As above, in the theme's bar style. | |
| void | IndeterminateProgressBar (LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID. | |
| void | Spinner (ID id, SpinnerSize size=SpinnerSize::Medium, LayoutOverride &&constraints={}) |
| A ring with an arc going round it, a turn every 0.8 s, in the theme's track and accent colors: work under way. | |
| void | Spinner (SpinnerSize size=SpinnerSize::Medium, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID. | |
| void | CircularProgress (ID id, float value, StyleRef style, LayoutOverride &&constraints={}) |
| A ring filled value (0 to 1, clamped) of the way round, clockwise from the top, the percentage in its middle. | |
| void | CircularProgress (ID id, float value, LayoutOverride &&constraints={}) |
| As above, in the theme's style. | |
| void | CircularProgress (float value, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID. | |
| void | Skeleton (ID id, StyleRef style, LayoutOverride &&constraints={}) |
| A placeholder bar where content is still loading, sized as the content it stands for (give it a width), with a shine sweeping across it every 1.5 s; still with reduced motion. | |
| void | Skeleton (ID id, LayoutOverride &&constraints={}) |
| As above, in the theme's style. | |
| void | Skeleton (LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID. | |
| void | TaskProgress (ID id, const ProgressTask &task, LayoutOverride &&constraints={}) |
| A piece of work in full: its name and percent (or note) over its bar, a cancel button when onCancel is set, and detail under it. | |
| void | TaskProgress (const ProgressTask &task, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID. | |
| void | ProgressSteps (ID id, std::span< const ProgressTask > steps, LayoutOverride &&constraints={}) |
| The steps of a longer job, one a row: a glyph for its state (a check once done, a spinner while running, a dashed ring while pending, a cross and "failed" once failed), its name, and its note (or percent) at the end of the line; under the running one, a small bar and its detail, in line with the names. | |
| void | ProgressSteps (std::span< const ProgressTask > steps, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID. | |
| void | StatusProgress (ID id, const ProgressTask &task, LayoutOverride &&constraints={}) |
| A piece of work in a status bar: a small spinner, its name, a 120px bar and its note ("1,240 / 3,800") or percent. | |
| void | StatusProgress (const ProgressTask &task, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID. | |
| bool | BackgroundTasks (ID id, std::span< const ProgressTask > tasks, LayoutOverride &&constraints={}) |
| A "3 tasks" pill with a chevron, for a status bar, that opens a popover listing tasks: each with its name, a small bar, its percent or state and a cancel button when onCancel is set. | |
| bool | BackgroundTasks (std::span< const ProgressTask > tasks, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID. | |
Timeline | |
| bool | Timeline (ID id, TimelineState &state, const TimelineOptions &options, LayoutOverride &&constraints={}) |
| Playback on one row: go to the start, step back a frame, play or pause, step on a frame, go to the end and loop; the time and frame; and a scrubber with ticks (every second when there's room), the progress fill, a line per marker and the playhead. | |
| bool | Timeline (TimelineState &state, const TimelineOptions &options, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID. | |
| void | TimelineEditor (ID id, TimelineViewRef view, LayoutOverride &&constraints={}) |
| A timeline editor over view: a toolbar (the transport, with the previous and next key in place of the frame steps; the time; the frame rate; Snap; zoom), the track list beside the ruler and the lanes, and a scroll bar under them. | |
| void | TimelineEditor (TimelineViewRef view, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID. | |
Curves | |
| bool | CurveField (ID id, CurveViewRef view, LayoutOverride &&constraints={}) |
| A curve in a box, over the curves' range: a click opens the curve editor (CurveEditor) in a window under it. | |
| bool | CurveField (CurveViewRef view, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID. | |
| void | CurveEditor (ID id, CurveViewRef view, LayoutOverride &&constraints={}) |
| The curve editor a CurveField opens, as a control of its own: the channels and the selected key's time and value over the plot; the keys, their tangent handles and the grid on it; the presets and the wrap modes under it. | |
| void | CurveEditor (CurveViewRef view, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID. | |
| bool | Plot (ID id, PlotViewRef view, LayoutOverride &&constraints={}) |
| Series of values as lines, bars or areas over the x range (a histogram's channels), with a chip per series to show one on its own, the values under the pointer, and handles dragged along x under the plot. | |
| bool | Plot (PlotViewRef view, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID. | |
| bool | Viewport (ID id, ViewportView &view, LayoutOverride &&constraints={}) |
| A 3D view: the app's scene, drawn by view.onRender into an image the library keeps at the view's size, a camera the mouse moves round it, the move, rotate and scale gizmos over the selection, the tools down the left and the axes at the top right. | |
| bool | Viewport (ViewportView &view, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID. | |
Menus and message dialogs | |
| bool | BeginMenu (ID id, const GUIContent &content, 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, const GUIContent &content, LayoutOverride &&constraints={}) |
| As above, in the theme's menu styles. | |
| bool | BeginMenu (const GUIContent &content, 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 (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 menu styles. | |
| bool | BeginDropdownMenu (ID id, const GUIContent &content, StyleRef buttonStyle, StyleRef menuStyle, StyleRef itemStyle, LayoutOverride &&constraints={}) |
| A menu opened from a dropdown: as BeginMenu, with an arrow after its text also in a menu bar or title bar, where it isn't one of the bar's menus (Left and Right don't go to it). | |
| bool | BeginDropdownMenu (ID id, const GUIContent &content, LayoutOverride &&constraints={}) |
| As above, in the theme's menu-bar dropdown style (menu-bar-dropdown) and 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. | |
| uint32_t | ContextMenuOpenings () const |
| Counts the context menus opened, a right click on a target whose menu is already open included. | |
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. | |
| bool | BeginButtonGroup (ID id, LayoutOverride &&constraints={}) |
| As above, with the group's own ID. | |
| void | EndButtonGroup () |
| Closes BeginButtonGroup. | |
| bool | BeginToggleGroup (LayoutOverride &&constraints={}) |
| The same for Toggles and Field(bool). | |
| void | EndToggleGroup () |
| Closes BeginToggleGroup. | |
| bool | Segmented (ID id, int &selected, std::span< const std::string_view > options, LayoutOverride &&constraints={}) |
| One of a few choices side by side, as a button group with the chosen segment selected: selected is its index in options. | |
| template<typename E> requires std::is_enum_v<E> | |
| bool | Segmented (ID id, E &selected, std::span< const std::string_view > options, LayoutOverride &&constraints={}) |
| As above, for an enum whose values are the segments' indices. | |
| template<typename T> requires (std::is_enum_v<T> || std::is_same_v<T, int>) | |
| bool | Segmented (T &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. | |
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. | |
| ID | DropTargetID () const |
| The element that takes the drag under the pointer, wherever the drag came from: files from another application (FileDragTargetID), else a drag started in this one (the element whose handler returned true to EventType::DragEnter). | |
| ID | DragGhostWindowID () const |
| The window a drag's ghost goes in, by the pointer (see BeginCursorGhostWindow). | |
| DragVisualizer | ImageDragGhost (ImageIndex image, uint2 size) |
| A ghost for a drag of a picture: image fitted into 64 x 64 CSS px by the pointer, keeping its shape. | |
| 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. | |
| bool | BeginShownState (ElementState states) |
| The controls until EndShownState look hovered, pressed (Active) or focused as states say, whatever the pointer and keyboard do: a control's states side by side, for a preview or a screenshot. | |
| void | EndShownState () |
| Closes BeginShownState. | |
| bool | ShowsFocusRing (const tachyon::Element &element) const |
| Whether element draws its focus ring (:focus-visible): it's focused and focus came from the keyboard, or it's shown focused (BeginShownState). | |
| static void | RebuildTreeViewIndex (std::vector< TreeViewRow > &rows) |
| Recomputes skipCount / ancestorLineMask / isLastSibling from row depths. | |
| static void | WalkTreeViewVisibility (const std::vector< TreeViewRow > &rows, const std::unordered_set< ID > &openRows, std::vector< int > &visibleIdx) |
| Writes the flat indices of the rows shown to visibleIdx: those under no closed branch, the open ones being in openRows (by TreeViewRowKey). | |
| static void | WalkTreeViewVisibility (const std::vector< TreeViewRow > &rows, std::vector< int > &visibleIdx, TableState &state) |
| As above, for a tree drawn by a table with state, open as its openRows says: when rows were opened or closed, its selection stays on the same rows (row IDs are visible positions). | |
| static TreeOpenRef | TreeViewOpenRef (const std::vector< TreeViewRow > &rows, size_t flat, TableState &state) |
| The TreeCell open state of flat row flat in the view with state: its key in state.openRows, or nothing for a row without children. | |
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, TreeOpenRef 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 | 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) |
| As above, the open state a bool of yours; null for leaves. | |
| 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 (NodeViewRef view) |
| Builds view (canvas, nodes, wires and overlays) in the current container: a NodeView, or { graph, state } for one of several views of a graph. | |
| 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. | |
| void | DocumentBar (ID id, DocumentSet &set, StyleRef style, LayoutOverride &&constraints=LayoutOverride::Auto()) |
| The document bar of set alone: its tabs, "+", "N open" and the line in the active document's color. | |
| void | DocumentBar (ID id, DocumentSet &set, LayoutOverride &&constraints=LayoutOverride::Auto()) |
| As above, in the theme's document bar style. | |
| void | DocumentLine (const DocumentSet &set, LayoutOverride &&constraints=LayoutOverride::Auto()) |
| The line under the document bar of set, in the active document's color, across what it's in: after the title bar the bar is in. | |
| void | DocumentPanels (DocumentSet &set, LayoutOverride &&constraints=LayoutOverride::Auto()) |
| The active document's panels of set, after its DocumentBar. | |
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, const GUIContent &content, 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, const GUIContent &content, TextEditBehavior textEditBehavior=TextEditBehavior::ContinuousUpdate, LayoutOverride &&constraints={}) |
| As above, in the theme's search style. | |
| bool | SearchField (std::string &value, const GUIContent &content, 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, const GUIContent &content, 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). | |
Edge and corner fields | |
| bool | EdgesField (ID id, BoxEdges &value, NumericFieldConfig< int32_t > config={ .stepPerPixel=0.25,.minVal=0,.maxVal=64 }, LayoutOverride &&constraints={}) |
| Border widths, padding or the like: a number field for each side, captioned T, R, B and L, after a link toggle. | |
| bool | CornersField (ID id, BoxCorners &value, NumericFieldConfig< int32_t > config={ .stepPerPixel=0.25,.minVal=0,.maxVal=64 }, LayoutOverride &&constraints={}) |
| As EdgesField, for corner radii: top left, top right, bottom right and bottom left. | |
| bool | ShadowField (ID id, BoxShadow &value, LayoutOverride &&constraints={}) |
| A shadow: its color over its offsets (X, Y), blur and spread. | |
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. | |
| void | SetColorSwatches (std::span< const tachyon::color4f > colors) |
| The color picker's swatches, which the user adds to and removes from; set them to start from the app's palette, read them to keep it. | |
| std::vector< tachyon::color4f > | ColorSwatches () const |
| A color swatch that opens a color picker; true when the color changed. | |
| void | AddRecentColor (tachyon::color4f color) |
| Adds a color to the picker's recent ones, as OK does: newest first, each once, at most 8. | |
| 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. | |
| bool | GradientField (ID id, tachyon::GradientF &value, StyleRef style, LayoutOverride &&constraints={}) |
| As above, for a GradientF: up to GradientF::kMaxStops stops, colors over 1 (HDR), and each stop's interpolation to the next. | |
| bool | GradientField (ID id, tachyon::GradientF &value, LayoutOverride &&constraints={}) |
| As above, in the theme's gradient swatch style. | |
| bool | GradientField (tachyon::GradientF &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::GradientF &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. | |
| template<typename T> requires std::is_arithmetic_v<T> | |
| bool | Slider (ID id, T &value, std::type_identity_t< T > minVal, std::type_identity_t< T > maxVal, StyleRef style, LayoutOverride &&constraints={}) |
| Groove + knob without value text; drag-only. | |
| template<typename T> requires std::is_arithmetic_v<T> | |
| bool | Slider (ID id, T &value, std::type_identity_t< T > minVal, std::type_identity_t< T > maxVal, LayoutOverride &&constraints={}) |
| As above, in the theme's slider style. | |
| template<typename T> requires std::is_arithmetic_v<T> | |
| bool | Slider (T &value, std::type_identity_t< T > minVal, std::type_identity_t< T > maxVal, StyleRef style, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID. | |
| template<typename T> requires std::is_arithmetic_v<T> | |
| bool | Slider (T &value, std::type_identity_t< T > minVal, std::type_identity_t< T > 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. | |
| template<typename T> requires std::is_arithmetic_v<T> | |
| bool | RangeField (ID id, T &value, std::type_identity_t< T > minVal, std::type_identity_t< T > maxVal, LayoutOverride &&constraints={}) |
| A number in [minVal, maxVal]: a slider taking the row's room and a value box after it to type into. | |
| template<typename T> requires std::is_arithmetic_v<T> | |
| bool | RangeField (T &value, std::type_identity_t< T > minVal, std::type_identity_t< T > maxVal, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID. | |
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. | |
| void | Image (ID id, ImageIndex image, const UVRect &uv, StyleRef style, LayoutOverride &&constraints={}) |
| Draws the part uv of image stretched over the element's padding box: a cell of an atlas (UVRect::FromPixels), or a zoomed or panned view of a big image. | |
| void | Image (ID id, ImageIndex image, const UVRect &uv, LayoutOverride &&constraints={}) |
| As above, in the theme's image style. | |
| void | Image (ImageIndex image, const UVRect &uv, 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, const UVRect &uv, 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, const UVRect &uv, StyleRef style, LayoutOverride &&constraints={}) |
| The part uv of an image sourceSize pixels big, sized like the aspect-preserving Image above to the aspect of that part. | |
| void | Image (ID id, ImageIndex image, uint2 sourceSize, const UVRect &uv, LayoutOverride &&constraints={}) |
| As above, in the theme's image style. | |
| void | Image (ImageIndex image, uint2 sourceSize, const UVRect &uv, 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, const UVRect &uv, const ImageDisplay &display, StyleRef style, LayoutOverride &&constraints={}) |
| The part uv of image shown as display says: tinted, its channels picked (one shown as grey, say), sRGB-encoded for an image of linear values. | |
| void | Image (ID id, ImageIndex image, const ImageDisplay &display, LayoutOverride &&constraints={}) |
| As above, the whole image, in the theme's image style. | |
| void | Image (ImageIndex image, const ImageDisplay &display, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID. | |
| void | Image (ID id, ImageIndex image, uint2 sourceSize, const UVRect &uv, const ImageDisplay &display, StyleRef style, LayoutOverride &&constraints={}) |
| The part uv of an image sourceSize pixels big, shown as display says, sized like the aspect-preserving Image to the aspect of that part. | |
| void | Image (ID id, ImageIndex image, uint2 sourceSize, const ImageDisplay &display, LayoutOverride &&constraints={}) |
| As above, the whole image, in the theme's image style. | |
| void | Image (ImageIndex image, uint2 sourceSize, const ImageDisplay &display, LayoutOverride &&constraints={}, std::source_location site=std::source_location::current()) |
| As above, with the call site as the ID. | |
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 | AddGhostIcon (IconID icon, int2 size, std::source_location site=std::source_location::current()) |
| As above, size in pixels: in a ghost window of that size, a small icon by the cursor, for example. | |
| 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
PersistLayoutPresets("layouts", presets); // saved layouts, file types' layouts
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. | |
| void | PersistLayoutPresets (std::string key, LayoutPresets &presets) |
| Keeps the layouts the user saved and the file types' layouts; the app adds its built-in ones itself, before or after RestoreUIState. | |
| void | PersistThemeVariables (std::string key) |
| Keeps each theme's variables, set with SetThemeVariable. | |
| 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, const std::function< std::optional< ID >(std::string_view key)> &makePanel={}) |
| Lays a document's panels out as saved, and gives them their own states back: | |
| 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 | SaveDockLayout (const DockingLayout &layout) const |
| A layout's dock tree as text, panels by type, else title, as a LayoutPreset keeps it; empty when it has none. | |
| bool | ApplyDockLayout (DockingLayout &layout, std::string_view tree, const std::function< std::optional< ID >(std::string_view key)> &makePanel={}) |
| Lays a layout's panels out as tree (SaveDockLayout's text) says: | |
| 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.
|
virtual |
Cleans up when Cleanup wasn't called (an early return, a failed test), so the device, windows and contexts don't outlive the application.
| 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 |
| 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 | ) |
The leaf whose content (as last laid out) holds screenPos, the part of it the point is in (an edge, or Center), and its layout; none off every leaf's content.
Tab bars aren't content: FindDockLeafAtScreenPos finds those.
| 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::ForgetDockingLayout | ( | DockingLayout & | layout | ) |
Before an app destroys Layout: closes the windows of the panels torn off it (they would dock back into it) and stops saving it.
| void tachyon::GUIApplication::ReleaseDockingLayout | ( | DockingLayout & | layout | ) |
Closes a layout for good, as ForgetDockingLayout does, and empties it: its panels are hidden (onDisable) and destroyed, and the IDs CreatePanel made for them and its tree's go back.
Call it before the app destroys a layout it made, or at exit.
| 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.
| void tachyon::GUIApplication::ClaimCommandMode | ( | ID | owner, |
| CommandMode | mode ) |
For a control with shortcuts of its own (CommandManager::RegisterMode): while the focus is within owner, the command mode is mode; once it's within none, Default again.
Call it as the control is built, every frame it is. The mode is set once a frame, before input is handled, from where the focus is, so two controls of one mode (two panels of a kind) don't undo each other. Default claims nothing.
| void tachyon::GUIApplication::ClosePanel | ( | DockingLayout & | layout, |
| ID | panelID ) |
Closes a panel of Layout for good, wherever it is: out of its tree (its leaf closing up when it empties), hidden first (onDisable) if it's shown, its ID back when CreatePanel made it.
Its callbacks, and what they hold, are destroyed when the next frame starts, so it can be called from an input handler.
| 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.
| void tachyon::GUIApplication::CloseAllDocuments | ( | DocumentSet & | set | ) |
Closes every document of set, as CloseDocument does each: at exit, say.
|
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 |
| void tachyon::GUIApplication::SetAccent | ( | std::optional< AccentColors > | accent | ) |
Replaces the palette's accent with accent (its dark color in a dark palette, its light one in a light palette), and the colors derived from it along with it; none goes back to the palette's own.
Applied, like RequestReloadTheme, at the start of the next frame, and kept through theme changes. kAccentPresets has the design's. SetAccent(kAccentPresets[1].colors); // teal
|
inline |
SetAccent's accent; none while the palette's own is used.
| void tachyon::GUIApplication::SetThemeVariable | ( | std::string_view | name, |
| std::string_view | value ) |
Sets a theme variable ("--bg-panel") to a CSS value ("#202020", "6px", "0 4px 12px rgba(0, 0, 0, 0.4)") for the theme loaded, in place of what its palette and the style files set, and of the accent.
Each theme keeps its own: switch to another and back, and they're back. A color shows on the next frame, anything else as the theme loads again at the start of it. theme.GetVariables() lists the variables a theme editor can offer; PersistThemeVariables keeps them. SetThemeVariable("--radius-md", "6px");
| void tachyon::GUIApplication::ClearThemeVariable | ( | std::string_view | name | ) |
Back to the theme's own value for name.
| void tachyon::GUIApplication::ClearThemeVariables | ( | ) |
Back to the theme's own values for all of them, for the theme loaded.
| const ThemeVariableOverrides & tachyon::GUIApplication::GetThemeVariables | ( | ) | const |
The variables set with SetThemeVariable for the theme loaded.
|
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). A window opened from it as an image (WindowImagePopups) takes the focus as an OS popup does, and keeps it until a press in the window that opened it.
| 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.
The pen, before the pointer events it goes with; a default PenState is the mouse.
| void tachyon::GUIApplication::InjectPinch | ( | ID | windowID, |
| float | scale, | ||
| KeyModifier | mods = KeyModifier::None ) |
A trackpad pinch by scale where the pointer is.
| 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, and of images.
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.
|
inline |
What the wheel and a trackpad's two-finger scroll do over the canvases that pan and zoom (node view, curve and timeline editors, plots): zoom, or scroll the view.
A pinch zooms, and the middle button (or Alt + left) drags the view, either way. By default DefaultWheelMode(): Pan on macOS, Zoom elsewhere.
|
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.
|
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. Run also keeps frames to the display's refresh rate when presenting doesn't wait (a mailbox swapchain, a window the compositor draws); a host's loop paces its own frames.
| Result< void > tachyon::GUIApplication::RecordFrame | ( | ) |
See UpdateFrame.
| void tachyon::GUIApplication::PresentFrame | ( | ) |
See UpdateFrame.
|
inline |
How often Run draws a frame; RedrawMode::WhenNeeded by default, which sleeps while nothing changes.
Switch it any time: Always for an app that animates all the time, WhenChanged to build every frame but draw only the windows that changed.
|
inline |
Builds the UI; called each frame.
| void tachyon::GUIApplication::RequestRedraw | ( | ) |
Asks for a frame, for a change the UI can't see by itself: data from another thread, a value the app animates.
Safe from any thread; wakes a sleeping Run.
| void tachyon::GUIApplication::RequestRedrawIn | ( | float | seconds | ) |
Asks for a frame seconds from now (a clock's next tick). Safe from any thread.
| bool tachyon::GUIApplication::NeedsFrame | ( | ) | const |
Whether a frame is needed now.
Always true except in WhenNeeded, where it's true after input, while something animates or the last frame's draws changed, and when a redraw asked for is due. A host's loop can skip RecordFrame and PresentFrame, or sleep, while it's false:
while (app.UpdateFrame()) { if (app.NeedsFrame()) { app.RecordFrame(); app.PresentFrame(); } else Sleep(app.SecondsUntilFrame()); }
| float tachyon::GUIApplication::SecondsUntilFrame | ( | ) | const |
Seconds until a frame is needed: 0 when NeedsFrame is true, INFINITY when nothing is due (only input or a request will need one).
| tachyon::EventHandler tachyon::GUIApplication::MakeToggleHandler | ( | bool & | toggle | ) |
A handler that flips toggle on click.
|
inline |
A handler that calls onClick on click.
The callable is kept in the handler as it is, so a small one doesn't make the handler allocate.
| 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.
| void tachyon::GUIApplication::DrawnValid | ( | tachyon::ElementRef | ref | ) |
The element just registered drawn as valid inside a BeginInvalid scope: the part of a control that shows it invalid is another one (a check box's box, not its row).
| 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, | ||
| bool | lit = 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. lit shows it hovered whatever the pointer does: a submenu's row while its submenu is open.
| 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.
| bool tachyon::GUIApplication::ShortcutButton | ( | ID | id, |
| const CommandManager::Command & | command, | ||
| std::function< void()> | onClick, | ||
| std::string_view | unassigned = "Unassigned", | ||
| LayoutOverride && | constraints = {} ) |
A command's shortcut as keycaps, one per key ("Ctrl" "C"); a chord's two steps apart by a comma.
Without one, unassigned in a muted color. A flat button: onClick runs on a click anywhere on it (to rebind the shortcut, say).
|
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 its shortcut in a chip after it ("Undo" then "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::BusyButton | ( | ID | id, |
| const GUIContent & | content, | ||
| bool | busy, | ||
| std::string_view | busyText, | ||
| std::function< void()> | onClick, | ||
| StyleRef | style, | ||
| LayoutOverride && | constraints = {} ) |
A button at work: a spinner in place of its icon and busyText ("Saving...") in place of its text, as wide as it was before, and clicks ignored.
While busy is false it's an ordinary Button; empty busyText keeps the text.
|
inline |
As above, in the theme's button style.
| void tachyon::GUIApplication::ProgressBar | ( | ID | id, |
| float | value, | ||
| bool | failed, | ||
| StyleRef | style, | ||
| LayoutOverride && | constraints = {} ) |
A bar value (0 to 1, clamped) of the way full; failed fills it in the error color, for work that stopped.
The theme's bar is 6px high; progressBarSmallStyleRef's is 4px, for lists and the status bar.
|
inline |
As above, not failed, in the theme's bar style.
|
inline |
As above, with the call site as the ID.
| void tachyon::GUIApplication::IndeterminateProgressBar | ( | ID | id, |
| StyleRef | style, | ||
| LayoutOverride && | constraints = {} ) |
A bar for work of unknown length: a segment with soft ends slides along it, from start to end every 1.2 s.
|
inline |
As above, in the theme's bar style.
|
inline |
As above, with the call site as the ID.
| void tachyon::GUIApplication::Spinner | ( | ID | id, |
| SpinnerSize | size = SpinnerSize::Medium, | ||
| LayoutOverride && | constraints = {} ) |
A ring with an arc going round it, a turn every 0.8 s, in the theme's track and accent colors: work under way.
12, 16 or 18px across unless constraints say.
|
inline |
As above, with the call site as the ID.
| void tachyon::GUIApplication::CircularProgress | ( | ID | id, |
| float | value, | ||
| StyleRef | style, | ||
| LayoutOverride && | constraints = {} ) |
A ring filled value (0 to 1, clamped) of the way round, clockwise from the top, the percentage in its middle.
The theme's is 36px across.
|
inline |
As above, in the theme's style.
|
inline |
As above, with the call site as the ID.
| void tachyon::GUIApplication::Skeleton | ( | ID | id, |
| StyleRef | style, | ||
| LayoutOverride && | constraints = {} ) |
A placeholder bar where content is still loading, sized as the content it stands for (give it a width), with a shine sweeping across it every 1.5 s; still with reduced motion.
|
inline |
As above, in the theme's style.
|
inline |
As above, with the call site as the ID.
| void tachyon::GUIApplication::TaskProgress | ( | ID | id, |
| const ProgressTask & | task, | ||
| LayoutOverride && | constraints = {} ) |
A piece of work in full: its name and percent (or note) over its bar, a cancel button when onCancel is set, and detail under it.
Failed: the error icon, the bar in the error color, the reason in error text and a Retry button when onRetry is set, with a turning arrow. Done: a check, the name and note (how long it took) on one line.
|
inline |
As above, with the call site as the ID.
| void tachyon::GUIApplication::ProgressSteps | ( | ID | id, |
| std::span< const ProgressTask > | steps, | ||
| LayoutOverride && | constraints = {} ) |
The steps of a longer job, one a row: a glyph for its state (a check once done, a spinner while running, a dashed ring while pending, a cross and "failed" once failed), its name, and its note (or percent) at the end of the line; under the running one, a small bar and its detail, in line with the names.
|
inline |
As above, with the call site as the ID.
| void tachyon::GUIApplication::StatusProgress | ( | ID | id, |
| const ProgressTask & | task, | ||
| LayoutOverride && | constraints = {} ) |
A piece of work in a status bar: a small spinner, its name, a 120px bar and its note ("1,240 / 3,800") or percent.
|
inline |
As above, with the call site as the ID.
| bool tachyon::GUIApplication::BackgroundTasks | ( | ID | id, |
| std::span< const ProgressTask > | tasks, | ||
| LayoutOverride && | constraints = {} ) |
A "3 tasks" pill with a chevron, for a status bar, that opens a popover listing tasks: each with its name, a small bar, its percent or state and a cancel button when onCancel is set.
Shows nothing while tasks is empty. Returns whether the popover is open.
|
inline |
As above, with the call site as the ID.
| bool tachyon::GUIApplication::Timeline | ( | ID | id, |
| TimelineState & | state, | ||
| const TimelineOptions & | options, | ||
| LayoutOverride && | constraints = {} ) |
Playback on one row: go to the start, step back a frame, play or pause, step on a frame, go to the end and loop; the time and frame; and a scrubber with ticks (every second when there's room), the progress fill, a line per marker and the playhead.
A press or drag on the scrubber moves the playhead there, onto a frame. Keys on the focused scrubber: Space plays or pauses, Left / Right step a frame, Page Down / Page Up go to the previous / next marker, Home / End to the ends; Escape during a drag puts the playhead back. A step is a frame, or a hundredth of the length without frames; stepping pauses. Edits state; the app moves it on while it plays (AdvanceTimeline). Returns true on the frame the user changed it.
|
inline |
As above, with the call site as the ID.
| void tachyon::GUIApplication::TimelineEditor | ( | ID | id, |
| TimelineViewRef | view, | ||
| LayoutOverride && | constraints = {} ) |
A timeline editor over view: a toolbar (the transport, with the previous and next key in place of the frame steps; the time; the frame rate; Snap; zoom), the track list beside the ruler and the lanes, and a scroll bar under them.
|
inline |
As above, with the call site as the ID.
| bool tachyon::GUIApplication::CurveField | ( | ID | id, |
| CurveViewRef | view, | ||
| LayoutOverride && | constraints = {} ) |
A curve in a box, over the curves' range: a click opens the curve editor (CurveEditor) in a window under it.
Every change comes to the curves' onEdit, already applied. True on the frame after a change made in it, as a field's is. view is a CurveView, or { data, state } for one of several views of the same curves. CurveView falloff; // a member: one channel, keys over 0 to 1 Label("Falloff"); CurveField(idManager.AllocateDynamicID("falloff"), falloff);
|
inline |
As above, with the call site as the ID.
| void tachyon::GUIApplication::CurveEditor | ( | ID | id, |
| CurveViewRef | view, | ||
| LayoutOverride && | constraints = {} ) |
The curve editor a CurveField opens, as a control of its own: the channels and the selected key's time and value over the plot; the keys, their tangent handles and the grid on it; the presets and the wrap modes under it.
|
inline |
As above, with the call site as the ID.
| bool tachyon::GUIApplication::Plot | ( | ID | id, |
| PlotViewRef | view, | ||
| LayoutOverride && | constraints = {} ) |
Series of values as lines, bars or areas over the x range (a histogram's channels), with a chip per series to show one on its own, the values under the pointer, and handles dragged along x under the plot.
True on the frame after a handle moved in it. view is a PlotView, or { data, state } for one of several views of a plot.
PlotView levels; // a member
levels.series = { PlotSeries{ .name = "Luma", .values = HistogramBins(lumas, 256) } };
levels.handles = { { "Black", 0.0f }, { "White", 1.0f } };
if (Plot(idManager.AllocateDynamicID("levels"), levels))
ApplyLevels(levels.handles[0].x, levels.handles[1].x);
|
inline |
As above, with the call site as the ID.
| bool tachyon::GUIApplication::Viewport | ( | ID | id, |
| ViewportView & | view, | ||
| LayoutOverride && | constraints = {} ) |
A 3D view: the app's scene, drawn by view.onRender into an image the library keeps at the view's size, a camera the mouse moves round it, the move, rotate and scale gizmos over the selection, the tools down the left and the axes at the top right.
True on the frame after a gizmo's drag changed the selection.
ViewportView scene; // a member
scene.onRender = [this](const ViewportRenderContext& ctx) { DrawScene(ctx); };
scene.onClick = [this](const Ray& ray, KeyModifier) { Pick(ray); };
if (Viewport(idManager.AllocateDynamicID("scene"), scene, LayoutOverride{}.FlexGrow(1)))
MoveSelected(scene.selection);
|
inline |
As above, with the call site as the ID.
| bool tachyon::GUIApplication::BeginMenu | ( | ID | id, |
| const GUIContent & | content, | ||
| 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. content is the trigger's text with an optional icon before it.
|
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::BeginDropdownMenu | ( | ID | id, |
| const GUIContent & | content, | ||
| StyleRef | buttonStyle, | ||
| StyleRef | menuStyle, | ||
| StyleRef | itemStyle, | ||
| LayoutOverride && | constraints = {} ) |
A menu opened from a dropdown: as BeginMenu, with an arrow after its text also in a menu bar or title bar, where it isn't one of the bar's menus (Left and Right don't go to it).
For a picker with actions of its own, beside the bar's menus.
|
inline |
As above, in the theme's menu-bar dropdown style (menu-bar-dropdown) and 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.
A change outside a frame shows at the next one: call RequestRedraw after it.
| 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.
|
inline |
Counts the context menus opened, a right click on a target whose menu is already open included.
A control that builds its menu from what was under the pointer keeps the count it built it for, and works it out again when the count moves on.
| 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.
| bool tachyon::GUIApplication::BeginButtonGroup | ( | ID | id, |
| LayoutOverride && | constraints = {} ) |
As above, with the group's own ID.
| 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::Segmented | ( | ID | id, |
| int & | selected, | ||
| std::span< const std::string_view > | options, | ||
| LayoutOverride && | constraints = {} ) |
One of a few choices side by side, as a button group with the chosen segment selected: selected is its index in options.
A click on another segment writes its index to selected (stable storage of the caller's). True on the frame after.
|
inline |
As above, for an enum whose values are the segments' indices.
|
inline |
As above, with the call site as the ID.
| 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 the rows shown to visibleIdx: those under no closed branch, the open ones being in openRows (by TreeViewRowKey).
|
static |
As above, for a tree drawn by a table with state, open as its openRows says: when rows were opened or closed, its selection stays on the same rows (row IDs are visible positions).
For a tree built on VirtualTable directly; VirtualTreeView does this itself.
|
inlinestatic |
The TreeCell open state of flat row flat in the view with state: its key in state.openRows, or nothing for a row without children.
| 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 |
The element that takes the drag under the pointer, wherever the drag came from: files from another application (FileDragTargetID), else a drag started in this one (the element whose handler returned true to EventType::DragEnter).
Invalid when none does. A control that takes both draws itself as the drop target while this is its ID.
|
inline |
The window a drag's ghost goes in, by the pointer (see BeginCursorGhostWindow).
One drag at a time, so every kind of drag shares it.
| DragVisualizer tachyon::GUIApplication::ImageDragGhost | ( | ImageIndex | image, |
| uint2 | size ) |
A ghost for a drag of a picture: image fitted into 64 x 64 CSS px by the pointer, keeping its shape.
For MakeDragSourceHandler's ghost.
|
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.
|
inline |
The controls until EndShownState look hovered, pressed (Active) or focused as states say, whatever the pointer and keyboard do: a control's states side by side, for a preview or a screenshot.
A focus ring also needs the focus visible.
|
inline |
Closes BeginShownState.
|
inline |
Whether element draws its focus ring (:focus-visible): it's focused and focus came from the keyboard, or it's shown focused (BeginShownState).
| 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, | ||
| TreeOpenRef | 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 where the row's open state lives: empty for leaves (no arrow), else a bool of yours or a view's open rows (see TreeViewOpenRef). Clicks toggle it. 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.
|
inline |
As above, the open state a bool of yours; null for leaves.
| 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 | ( | NodeViewRef | view | ) |
Builds view (canvas, nodes, wires and overlays) in the current container: a NodeView, or { graph, state } for one of several views of a graph.
| 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.
| void tachyon::GUIApplication::DocumentBar | ( | ID | id, |
| DocumentSet & | set, | ||
| StyleRef | style, | ||
| LayoutOverride && | constraints = LayoutOverride::Auto() ) |
The document bar of set alone: its tabs, "+", "N open" and the line in the active document's color.
With DocumentPanels, the two parts of Documents placed apart (the bar in the title bar, say); call it first, once a frame. In theme.titleBarDocumentsStyleRef, which fits it in a title bar, it leaves its line out: DocumentLine draws it under the whole title bar.
|
inline |
As above, in the theme's document bar style.
| void tachyon::GUIApplication::DocumentLine | ( | const DocumentSet & | set, |
| LayoutOverride && | constraints = LayoutOverride::Auto() ) |
The line under the document bar of set, in the active document's color, across what it's in: after the title bar the bar is in.
| void tachyon::GUIApplication::DocumentPanels | ( | DocumentSet & | set, |
| LayoutOverride && | constraints = LayoutOverride::Auto() ) |
The active document's panels of set, after its DocumentBar.
| 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.
content's icon leads, and its text is the placeholder shown while the field is empty ({ searchIcon, "Filter objects" }); an icon alone converts to it.
|
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::EdgesField | ( | ID | id, |
| BoxEdges & | value, | ||
| NumericFieldConfig< int32_t > | config = { .stepPerPixel=0.25,.minVal=0,.maxVal=64 }, | ||
| LayoutOverride && | constraints = {} ) |
Border widths, padding or the like: a number field for each side, captioned T, R, B and L, after a link toggle.
Linked, one field sets all four; linking makes the others the top's. It starts linked when the four are equal. True when the value changed. BoxEdges border = BoxEdges(1); EdgesField(idManager.AllocateDynamicID("border"), border);
| bool tachyon::GUIApplication::CornersField | ( | ID | id, |
| BoxCorners & | value, | ||
| NumericFieldConfig< int32_t > | config = { .stepPerPixel=0.25,.minVal=0,.maxVal=64 }, | ||
| LayoutOverride && | constraints = {} ) |
As EdgesField, for corner radii: top left, top right, bottom right and bottom left.
| bool tachyon::GUIApplication::ShadowField | ( | ID | id, |
| BoxShadow & | value, | ||
| LayoutOverride && | constraints = {} ) |
A shadow: its color over its offsets (X, Y), blur and spread.
A transparent color is no shadow. True when the value changed. BoxShadow shadow{ .y = 4, .blur = 12, .color = { 0, 0, 0, 90 } }; ShadowField(idManager.AllocateDynamicID("shadow"), shadow);
| 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.
| void tachyon::GUIApplication::SetColorSwatches | ( | std::span< const tachyon::color4f > | colors | ) |
The color picker's swatches, which the user adds to and removes from; set them to start from the app's palette, read them to keep it.
A palette of twelve to begin with.
| std::vector< tachyon::color4f > tachyon::GUIApplication::ColorSwatches | ( | ) | const |
A color swatch that opens a color picker; true when the color changed.
allowHDR lets the picker take brightness over 1.
| void tachyon::GUIApplication::AddRecentColor | ( | tachyon::color4f | color | ) |
Adds a color to the picker's recent ones, as OK does: newest first, each once, at most 8.
For colors the app restores from a previous run.
| 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::GradientField | ( | ID | id, |
| tachyon::GradientF & | value, | ||
| StyleRef | style, | ||
| LayoutOverride && | constraints = {} ) |
As above, for a GradientF: up to GradientF::kMaxStops stops, colors over 1 (HDR), and each stop's interpolation to the next.
The swatch shows it clamped to 0..1.
|
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, |
| T & | value, | ||
| std::type_identity_t< T > | minVal, | ||
| std::type_identity_t< T > | maxVal, | ||
| StyleRef | style, | ||
| LayoutOverride && | constraints = {} ) |
Groove + knob without value text; drag-only.
Integer types step in whole numbers, float and double move smoothly. Built for float, double and the 8 to 64 bit integer types.
|
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.
|
inline |
A number in [minVal, maxVal]: a slider taking the row's room and a value box after it to type into.
True when the value changed. The types are Slider's.
|
inline |
As above, with the call site as the ID.
| 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.
| void tachyon::GUIApplication::Image | ( | ID | id, |
| ImageIndex | image, | ||
| const UVRect & | uv, | ||
| StyleRef | style, | ||
| LayoutOverride && | constraints = {} ) |
Draws the part uv of image stretched over the element's padding box: a cell of an atlas (UVRect::FromPixels), or a zoomed or panned view of a big image.
|
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, | ||
| const UVRect & | uv, | ||
| StyleRef | style, | ||
| LayoutOverride && | constraints = {} ) |
The part uv of an image sourceSize pixels big, sized like the aspect-preserving Image above to the aspect of that part.
|
inline |
As above, in the theme's image style.
|
inline |
As above, with the call site as the ID, in the theme's image style.
| void tachyon::GUIApplication::Image | ( | ID | id, |
| ImageIndex | image, | ||
| const UVRect & | uv, | ||
| const ImageDisplay & | display, | ||
| StyleRef | style, | ||
| LayoutOverride && | constraints = {} ) |
The part uv of image shown as display says: tinted, its channels picked (one shown as grey, say), sRGB-encoded for an image of linear values.
|
inline |
As above, the whole image, in the theme's image style.
|
inline |
As above, with the call site as the ID.
| void tachyon::GUIApplication::Image | ( | ID | id, |
| ImageIndex | image, | ||
| uint2 | sourceSize, | ||
| const UVRect & | uv, | ||
| const ImageDisplay & | display, | ||
| StyleRef | style, | ||
| LayoutOverride && | constraints = {} ) |
The part uv of an image sourceSize pixels big, shown as display says, sized like the aspect-preserving Image to the aspect of that part.
|
inline |
As above, the whole image, in the theme's image style.
|
inline |
As above, with the call site as the ID.
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 |
As above, size in pixels: in a ghost window of that size, a small icon by the cursor, for example.
|
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.
| void tachyon::GUIApplication::PersistLayoutPresets | ( | std::string | key, |
| LayoutPresets & | presets ) |
Keeps the layouts the user saved and the file types' layouts; the app adds its built-in ones itself, before or after RestoreUIState.
| void tachyon::GUIApplication::PersistThemeVariables | ( | std::string | key | ) |
Keeps each theme's variables, set with SetThemeVariable.
| 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, | ||
| const std::function< std::optional< ID >(std::string_view key)> & | makePanel = {} ) |
Lays a document's panels out as saved, and gives them their own states back:
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::SaveDockLayout | ( | const DockingLayout & | layout | ) | const |
A layout's dock tree as text, panels by type, else title, as a LayoutPreset keeps it; empty when it has none.
Floating panels aren't in it.
| bool tachyon::GUIApplication::ApplyDockLayout | ( | DockingLayout & | layout, |
| std::string_view | tree, | ||
| const std::function< std::optional< ID >(std::string_view key)> & | makePanel = {} ) |
Lays a layout's panels out as tree (SaveDockLayout's text) says:
False when the tree can't be read or has no panel left: the layout stays as it was. Call it outside the layout's Docking, e.g. before it in the frame.
| 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 |
Text and images to copy and paste (Get / Set, GetImage / SetImage); 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.
| 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 or Run's pace wait.
| float tachyon::GUIApplication::frameBuildTime = 0.0f |
CPU work per frame, excluding the vsync stall in present.
|
staticconstexpr |
~4s @ 60fps