Vital
Loading...
Searching...
No Matches
PopupItems Struct Reference

A hierarchical structure of popup menu items for a selector component. More...

#include <synth_section.h>

Public Member Functions

 PopupItems ()
 
 PopupItems (std::string name)
 
 PopupItems (int id, std::string name, bool selected, std::vector< PopupItems > items)
 
void addItem (int sub_id, const std::string &sub_name, bool sub_selected=false)
 Adds a new item as a submenu entry.
 
void addItem (const PopupItems &item)
 Adds an existing PopupItems object as a submenu entry.
 
int size () const
 Returns the number of nested items.
 

Public Attributes

int id
 The numeric ID of this item.
 
std::string name
 The display name of this item.
 
bool selected
 Whether this item is currently selected.
 
std::vector< PopupItemsitems
 Nested items for submenus or hierarchical choices.
 

Detailed Description

A hierarchical structure of popup menu items for a selector component.

Each PopupItems instance can represent a menu (with nested items) or a single menu item, identified by an ID, a name, and a selected state.

Constructor & Destructor Documentation

◆ PopupItems() [1/3]

PopupItems::PopupItems ( )
inline

◆ PopupItems() [2/3]

PopupItems::PopupItems ( std::string name)
inline

◆ PopupItems() [3/3]

PopupItems::PopupItems ( int id,
std::string name,
bool selected,
std::vector< PopupItems > items )
inline

Member Function Documentation

◆ addItem() [1/2]

void PopupItems::addItem ( const PopupItems & item)
inline

Adds an existing PopupItems object as a submenu entry.

Parameters
itemThe PopupItems to add.

◆ addItem() [2/2]

void PopupItems::addItem ( int sub_id,
const std::string & sub_name,
bool sub_selected = false )
inline

Adds a new item as a submenu entry.

Parameters
sub_idThe ID of the new item.
sub_nameThe name of the new item.
sub_selectedInitial selected state.

◆ size()

int PopupItems::size ( ) const
inline

Returns the number of nested items.

Returns
The count of items.

Member Data Documentation

◆ id

int PopupItems::id

The numeric ID of this item.

◆ items

std::vector<PopupItems> PopupItems::items

Nested items for submenus or hierarchical choices.

◆ name

std::string PopupItems::name

The display name of this item.

◆ selected

bool PopupItems::selected

Whether this item is currently selected.


The documentation for this struct was generated from the following file: