|
Study Dungeon
1.0.0
A group project for COSC345
|
The class for the button object. More...
#include <menu.h>
Public Member Functions | |
| Button (const std::string &label, std::function< void()> action) | |
| Construct a new Button object. More... | |
| void | draw (int x, int y, bool selected) |
| Draw the button. More... | |
| void | performAction () const |
| Perform the action associated with the button. | |
| size_t | getWidth () const |
| Get the Width of the button. More... | |
| const std::string & | getLabel () const |
| Get the Label of the button. More... | |
The class for the button object.
| ConsoleUI::Button::Button | ( | const std::string & | label, |
| std::function< void()> | action | ||
| ) |
Construct a new Button object.
| label | the label on the button |
| action | the function to call when the button is activated |
| void ConsoleUI::Button::draw | ( | int | x, |
| int | y, | ||
| bool | selected | ||
| ) |
Draw the button.
| x | left most position |
| y | top most position |
| selected | is the button selected |
| const std::string & ConsoleUI::Button::getLabel | ( | ) | const |
Get the Label of the button.
| size_t ConsoleUI::Button::getWidth | ( | ) | const |
Get the Width of the button.