Menu
Inherited: None
Description
The Menu class represents a graphical user interface (GUI) menu that contains a list of options or actions that users can select. It provides a way to organize and display commands or choices in a structured manner, typically within a dropdown or context menu format. Menus are essential in GUI design for providing users with accessible options and actions within an application.
Public Methods
void |
addSection (const std::string & text) |
void |
addWidget (Widget * widget) |
void |
hide () |
std::string |
itemText (int index) |
void |
setTitle (const std::string & title) |
void |
show (const Vector2 & position) |
std::string |
title () const |
Static Methods
None
Methods Description
void Menu::addSection (std::string & text)
Adds a section to the menu with the specified text.
void Menu::addWidget (Widget * widget)
Adds a widget to the menu.
void Menu::hide ()
Hides the menu.
std::string Menu::itemText (int index)
Returns the text of the item at the specified index.
void Menu::setTitle (std::string & title)
Sets the title of the menu.
See also *title*().
void Menu::show (Vector2 & position)
Displays the menu at the specified position.
std::string Menu::title () const
Returns the title of the menu.
See also setTitle().