ZenitUI
Retained-mode C++20 UI framework
Loading...
Searching...
No Matches
Built-in Widgets

Ready-to-use UI components in ZenitUI::UI. More...

Classes

class  ZenitUI::UI::Button
 A push button. More...
class  ZenitUI::UI::CanvasLayout
 A subtree rendered into an off-screen target. More...
class  ZenitUI::UI::Checkbox
 A checkbox with a custom-painted check mark. More...
class  ZenitUI::UI::Dropdown
 A single-select dropdown. More...
struct  ZenitUI::UI::FlatTreeRow< NodeT, KeyT >
 One visible row produced by FlatTreeModel. More...
class  ZenitUI::UI::FlatTreeModel< NodeT, KeyT >
 Maintains expanded state, selection, keyboard navigation, and a flat projection of visible rows ready to drive VirtualList. More...
class  ZenitUI::UI::ImageContainer
 A single-texture node supporting sub-rect cropping (sourceRect) and ObjectFit. More...
class  ZenitUI::UI::Panel
 A generic Stack container that blocks raycasts. More...
struct  ZenitUI::UI::MenuEntry
 Declarative C++ descriptor for populating a Menu or structured ContextMenu. More...
class  ZenitUI::UI::MenuSeparator
 Horizontal divider line inside a Menu. More...
class  ZenitUI::UI::MenuItem
 Interactive row inside a Menu (action, checkable item, or submenu trigger). More...
class  ZenitUI::UI::Menu
 Structured floating menu built on Popup, supporting separators, shortcuts, checkable items, nested submenus, and keyboard navigation. More...
class  ZenitUI::UI::MenuBar
 Horizontal application menu bar managing top-level Menu dropdowns. More...
class  ZenitUI::UI::Modal
 A backdrop + content overlay. More...
class  ZenitUI::UI::Popup
 A floating, anchored panel. More...
class  ZenitUI::UI::ProgressBar
 A value-in-[0, 1] progress indicator. More...
class  ZenitUI::UI::ScrollView
 A Layout with overflow: scroll on both axes by default. More...
class  ZenitUI::UI::Slider
 A [0, 1] slider with keyboard and pointer control. More...
class  ZenitUI::UI::SplitPane
 Container dividing its area between two resizable child panes. More...
struct  ZenitUI::UI::TableColumnSpec
 Configuration of a single column inside a Table. More...
class  ZenitUI::UI::TableColumn
 Declarative ZMarkup child used inside Table { TableColumn ... } to define columns. More...
class  ZenitUI::UI::Table
 Virtualized data table with sticky header, resizable columns, clickable column sorting, row selection, and keyboard navigation. More...
class  ZenitUI::UI::Tab
 Single page inside a TabView. More...
class  ZenitUI::UI::TabView
 Container displaying a strip of selectable tabs and one active page at a time. More...
class  ZenitUI::UI::Text
 A read-only text node. More...
class  ZenitUI::UI::TextArea
 A multi-line UTF-8 text editor. More...
class  ZenitUI::UI::TextInput
 A single-line text editor. More...
class  ZenitUI::UI::Toggle
 A toggle switch. More...
class  ZenitUI::UI::Tooltip
 A portal-based hover label. More...
class  ZenitUI::UI::TreeItem
 Single hierarchical item inside a TreeView or another TreeItem. More...
class  ZenitUI::UI::TreeView
 Scrollable tree container with selection, expand/collapse, and keyboard navigation. More...
class  ZenitUI::UI::VirtualList
 A fixed-height virtualized list that recycles ZMarkup prefab rows. More...
class  ZenitUI::UI::VirtualView
 A virtualized list. More...

Enumerations

enum class  ZenitUI::UI::ObjectFit {
  ObjectFit::Fill , ObjectFit::Contain , ObjectFit::Cover , ObjectFit::None ,
  ObjectFit::ScaleDown
}
 How ImageContainer fits the source texture into its layout rect. More...
enum class  ZenitUI::UI::SplitOrientation { SplitOrientation::Horizontal , SplitOrientation::Vertical }
 Split axis of a SplitPane. More...
enum class  ZenitUI::UI::SortDirection { None , Ascending , Descending }
 Active sort order of a Table column.
enum class  ZenitUI::UI::TabBarPosition { TabBarPosition::Top , TabBarPosition::Bottom }
 Placement of the tab strip relative to the content area. More...

Functions

std::shared_ptr< Button > ZenitUI::UI::Btn (std::string text, std::function< void()> cb=nullptr)
 Convenience factory: a Button with a Text label and a click handler.
std::shared_ptr< Layout > ZenitUI::UI::VStack (std::initializer_list< std::shared_ptr< Layout > > children={})
 Create a vertical-flow container (LayoutType::Vertical).
std::shared_ptr< Layout > ZenitUI::UI::HStack (std::initializer_list< std::shared_ptr< Layout > > children={})
 Create a horizontal-flow container (LayoutType::Horizontal).
std::shared_ptr< Layout > ZenitUI::UI::Box (std::initializer_list< std::shared_ptr< Layout > > children={})
 Generic Flexbox container modified via CSS (direction).
std::shared_ptr< Layout > ZenitUI::UI::Grid (std::initializer_list< std::shared_ptr< Layout > > children={})
 Create a 2D grid container (LayoutType::Grid).
std::shared_ptr< Panel > ZenitUI::UI::Pan ()
 Convenience factory for Panel::create().
std::shared_ptr< Menu > ZenitUI::UI::ContextMenu (std::vector< MenuEntry > entries)
 Convenience factory: create a structured context Menu from MenuEntry items.
std::shared_ptr< Popup > ZenitUI::UI::ContextMenu (std::vector< std::pair< std::string, std::function< void()> > > items)
 Convenience factory: a vertical context menu popup.
std::shared_ptr< Text > ZenitUI::UI::Label (std::string t)
 Convenience factory: a Text node.

Detailed Description

Ready-to-use UI components in ZenitUI::UI.

Built-in widgets expose a style tag matching their class name (Button, TextInput, TextArea, Slider, Dropdown, VirtualList, Table, TabView, SplitPane, TreeView, MenuBar, Canvas, ImageContainer, …) and optional pseudo-element parts (::box, ::mark, ::track, ::fill, ::knob, ::cursor, ::selection, ::placeholder, ::splitter, …) that can be themed from .zstyle without subclassing.

Live examples: 04_widget_forms · 08_virtual_list · 14_desktop_workspace · 16_data_table · 10_overlays_cursors · 12_effects_canvas

Live examples

Enumeration Type Documentation

◆ ObjectFit

enum class ZenitUI::UI::ObjectFit
strong

How ImageContainer fits the source texture into its layout rect.

Enumerator
Fill 

Stretch to fill the box (ignores aspect ratio).

Contain 

Scale uniformly to fit entirely inside the box, centered.

Cover 

Scale uniformly to cover the entire box, centered and cropped.

None 

Draw at 1:1 source pixels, centered and cropped if larger than the box.

ScaleDown 

Like None if smaller than the box, otherwise Contain.

Examples
14_desktop_workspace/main.cpp.

◆ SplitOrientation

enum class ZenitUI::UI::SplitOrientation
strong

Split axis of a SplitPane.

Enumerator
Horizontal 

Panes arranged left and right (vertical divider).

Vertical 

Panes arranged top and bottom (horizontal divider).

◆ TabBarPosition

enum class ZenitUI::UI::TabBarPosition
strong

Placement of the tab strip relative to the content area.

Enumerator
Top 

Tab bar above the active page (default).

Bottom 

Tab bar below the active page.

Function Documentation

◆ ContextMenu() [1/2]

std::shared_ptr< Menu > ZenitUI::UI::ContextMenu ( std::vector< MenuEntry > entries)

Convenience factory: create a structured context Menu from MenuEntry items.

Supports separators, shortcuts, checkable items, and nested submenus.

Examples
00_demo/main.cpp, 10_overlays_cursors/main.cpp, and 14_desktop_workspace/main.cpp.

◆ ContextMenu() [2/2]

std::shared_ptr< Popup > ZenitUI::UI::ContextMenu ( std::vector< std::pair< std::string, std::function< void()> > > items)

Convenience factory: a vertical context menu popup.

Each item is a full-width, left-aligned button. Clicking an item closes the popup and fires its callback.

Parameters
itemsList of (label, callback) pairs.

◆ Grid()

std::shared_ptr< Layout > ZenitUI::UI::Grid ( std::initializer_list< std::shared_ptr< Layout > > children = {})
inline

Create a 2D grid container (LayoutType::Grid).

Parameters
childrenOptional initial children; ownership is transferred.

◆ HStack()

std::shared_ptr< Layout > ZenitUI::UI::HStack ( std::initializer_list< std::shared_ptr< Layout > > children = {})
inline

Create a horizontal-flow container (LayoutType::Horizontal).

Parameters
childrenOptional initial children; ownership is transferred.
Returns
The container as a shared_ptr<Layout>.
Examples
00_demo/main.cpp, 14_desktop_workspace/main.cpp, and 16_data_table/main.cpp.

◆ VStack()

std::shared_ptr< Layout > ZenitUI::UI::VStack ( std::initializer_list< std::shared_ptr< Layout > > children = {})
inline

Create a vertical-flow container (LayoutType::Vertical).

Parameters
childrenOptional initial children; ownership is transferred.
Returns
The container as a shared_ptr<Layout>.
Examples
00_demo/main.cpp, and 10_overlays_cursors/main.cpp.