Skyward boardcore
|
View used to display an option list, so the user can select one by clicking on it. More...
#include <OptionView.h>
Public Types | |
using | OnOptionChosenListener = std::function<void(unsigned int id)> |
![]() | |
using | OnInteractionListener = std::function<void(View*, Interaction)> |
Public Member Functions | |
OptionView (std::string name, std::map< uint8_t, std::string > options, uint8_t defaultOption=0, uint8_t numCols=4) | |
virtual | ~OptionView () |
void | setBounds (Bounds bounds) override |
Sets the bounds in which the view will be drawn. | |
void | addOnOptionChosenListener (OnOptionChosenListener listener) |
Adds a callback to be called each time an option is selected by the user. | |
std::vector< View * > | getChilds () override |
Returns the list of childs. | |
void | draw (mxgui::DrawingContext &dc) override |
Draw the view in its bounds. | |
![]() | |
View () | |
virtual | ~View () |
Bounds | getBounds () |
void | invalidate () |
Signal that what has been previously drawn is now invalid and has to be redrawn. | |
void | invalidateTree () |
Invalidate the view tree which has this view as a root. | |
virtual void | setBackgroundColor (mxgui::Color color) |
virtual mxgui::Color | getBackgroundColor () |
void | setSelectedColor (mxgui::Color color) |
void | setSelectable (bool selectable) |
bool | isSelectable () |
void | setSelected (bool selected) |
bool | isSelected () |
void | addOnInteractionListener (OnInteractionListener listener) |
virtual void | performInteraction (Interaction action) |
Additional Inherited Members | |
![]() | |
bool | isInvalidated () |
View used to display an option list, so the user can select one by clicking on it.
Definition at line 38 of file OptionView.h.
using Boardcore::OptionView::OnOptionChosenListener = std::function<void(unsigned int id)> |
Definition at line 41 of file OptionView.h.
|
inline |
Definition at line 43 of file OptionView.h.
|
inlinevirtual |
Definition at line 76 of file OptionView.h.
|
inline |
Adds a callback to be called each time an option is selected by the user.
Definition at line 104 of file OptionView.h.
|
inlineoverridevirtual |
Draw the view in its bounds.
dc | Reference to a drawingcontext |
Reimplemented from Boardcore::View.
Definition at line 118 of file OptionView.h.
|
inlineoverridevirtual |
Returns the list of childs.
Reimplemented from Boardcore::View.
Definition at line 109 of file OptionView.h.
|
inlineoverridevirtual |
Sets the bounds in which the view will be drawn.
Reimplemented from Boardcore::View.
Definition at line 84 of file OptionView.h.