Unravel Engine C++ Reference
Loading...
Searching...
No Matches
unravel::property_layout Class Reference

Manages ImGui layout for property inspection in the editor. More...

#include <inspector.h>

Public Member Functions

 property_layout (const property_layout &)=delete
 Disable copy operations due to RAII nature and global stack management.
 
auto operator= (const property_layout &) -> property_layout &=delete
 
 property_layout (property_layout &&)=delete
 Disable move operations to prevent stack corruption.
 
auto operator= (property_layout &&) -> property_layout &=delete
 
 property_layout ()
 Default constructor that registers this layout in the global stack.
 
 property_layout (const entt::meta_data &prop, bool columns=true)
 Constructs layout from meta property data.
 
 property_layout (const std::string &name, bool columns=true)
 Constructs layout with property name only.
 
 property_layout (const std::string &name, const std::string &tooltip, bool columns=true)
 Constructs layout with name and tooltip.
 
 property_layout (const std::string &name, const std::function< void()> &callback, bool columns=true)
 Constructs layout with custom rendering callback.
 
 ~property_layout ()
 Destructor that cleans up ImGui state and removes from stack.
 
void set_data (const entt::meta_data &prop, bool columns=true)
 Updates layout data from meta property.
 
void set_data (const std::string &name, const std::string &tooltip, bool columns=true)
 Updates layout data with name and tooltip.
 
void push_layout (bool auto_proceed_to_next_column=true)
 Initializes ImGui layout with tables and property label.
 
auto push_tree_layout (ImGuiTreeNodeFlags flags=0) -> bool
 Creates a collapsible tree node layout for nested properties.
 
void pop_layout ()
 Cleans up ImGui state (IDs, tables, tree nodes)
 
void prepare_for_item ()
 Prepares ImGui for rendering the property value widget.
 

Static Public Member Functions

static auto get_current () -> property_layout *
 Gets the currently active property layout from the global stack.
 

Detailed Description

Manages ImGui layout for property inspection in the editor.

Handles the visual layout of properties in the inspector panel, including column-based layouts, tree nodes, tooltips, and context menus. Uses RAII to automatically manage ImGui state.

Definition at line 18 of file inspector.h.

Constructor & Destructor Documentation

◆ property_layout() [1/7]

unravel::property_layout::property_layout ( const property_layout & )
delete

Disable copy operations due to RAII nature and global stack management.

◆ property_layout() [2/7]

unravel::property_layout::property_layout ( property_layout && )
delete

Disable move operations to prevent stack corruption.

◆ property_layout() [3/7]

unravel::property_layout::property_layout ( )

Default constructor that registers this layout in the global stack.

Definition at line 25 of file inspector.cpp.

◆ property_layout() [4/7]

unravel::property_layout::property_layout ( const entt::meta_data & prop,
bool columns = true )

Constructs layout from meta property data.

Parameters
propMeta property containing name and tooltip information
columnsWhether to use column-based layout (default: true)

Definition at line 30 of file inspector.cpp.

◆ property_layout() [5/7]

unravel::property_layout::property_layout ( const std::string & name,
bool columns = true )

Constructs layout with property name only.

Parameters
nameDisplay name for the property
columnsWhether to use column-based layout (default: true)

Definition at line 39 of file inspector.cpp.

◆ property_layout() [6/7]

unravel::property_layout::property_layout ( const std::string & name,
const std::string & tooltip,
bool columns = true )

Constructs layout with name and tooltip.

Parameters
nameDisplay name for the property
tooltipHelp text shown on hover
columnsWhether to use column-based layout (default: true)

Definition at line 48 of file inspector.cpp.

◆ property_layout() [7/7]

unravel::property_layout::property_layout ( const std::string & name,
const std::function< void()> & callback,
bool columns = true )

Constructs layout with custom rendering callback.

Parameters
nameDisplay name for the property
callbackCustom function to render the property label
columnsWhether to use column-based layout (default: true)

Definition at line 57 of file inspector.cpp.

◆ ~property_layout()

unravel::property_layout::~property_layout ( )

Destructor that cleans up ImGui state and removes from stack.

Definition at line 68 of file inspector.cpp.

Member Function Documentation

◆ get_current()

auto unravel::property_layout::get_current ( ) -> property_layout*
static

Gets the currently active property layout from the global stack.

Returns
Pointer to current layout, or nullptr if stack is empty

Definition at line 20 of file inspector.cpp.

◆ operator=() [1/2]

auto unravel::property_layout::operator= ( const property_layout & ) -> property_layout &=delete
delete

◆ operator=() [2/2]

auto unravel::property_layout::operator= ( property_layout && ) -> property_layout &=delete
delete

◆ pop_layout()

void unravel::property_layout::pop_layout ( )

Cleans up ImGui state (IDs, tables, tree nodes)

Definition at line 211 of file inspector.cpp.

◆ prepare_for_item()

void unravel::property_layout::prepare_for_item ( )

Prepares ImGui for rendering the property value widget.

Definition at line 151 of file inspector.cpp.

◆ push_layout()

void unravel::property_layout::push_layout ( bool auto_proceed_to_next_column = true)

Initializes ImGui layout with tables and property label.

Parameters
auto_proceed_to_next_columnWhether to automatically move to next column

Definition at line 92 of file inspector.cpp.

◆ push_tree_layout()

auto unravel::property_layout::push_tree_layout ( ImGuiTreeNodeFlags flags = 0) -> bool

Creates a collapsible tree node layout for nested properties.

Parameters
flagsImGui tree node flags for customization
Returns
true if tree node is open and children should be rendered

Definition at line 162 of file inspector.cpp.

◆ set_data() [1/2]

void unravel::property_layout::set_data ( const entt::meta_data & prop,
bool columns = true )

Updates layout data from meta property.

Parameters
propMeta property containing name and tooltip
columnsWhether to use column-based layout

Definition at line 75 of file inspector.cpp.

◆ set_data() [2/2]

void unravel::property_layout::set_data ( const std::string & name,
const std::string & tooltip,
bool columns = true )

Updates layout data with name and tooltip.

Parameters
nameDisplay name for the property
tooltipHelp text shown on hover
columnsWhether to use column-based layout

Definition at line 85 of file inspector.cpp.


The documentation for this class was generated from the following files: