|
supertux
|
Public Member Functions | |
| MenuItem (const std::string &text, int id=-1) | |
| int | get_id () const |
| void | set_help (const std::string &help_text) |
| const std::string & | get_help () const |
| void | set_text (const std::string &text) |
| const std::string & | get_text () const |
| virtual void | draw (DrawingContext &, const Vector &pos, int menu_width, bool active) |
| Draws the menu item. More... | |
| virtual bool | skippable () const |
| Returns true when the menu item has no action and therefore can be skipped. More... | |
| virtual int | get_width () const |
| Returns the minimum width of the menu item. More... | |
| virtual void | process_action (const MenuAction &action) |
| Processes the menu action. More... | |
| virtual void | event (const SDL_Event &ev) |
| Processes the given event. More... | |
| virtual Color | get_color () const |
| virtual bool | no_other_action () const |
| Returns true when the MenuManager shouldn't do anything else. More... | |
| virtual bool | changes_width () const |
| Returns true when the width must be recalculated when an action is processed. | |
|
virtual |
Draws the menu item.
Reimplemented in ItemToggle, ItemColorChannel, ItemColorDisplay, ItemStringSelect, ItemBack, ItemControlField, ItemFloatField, ItemHorizontalLine, ItemIntField, ItemLabel, ItemScriptLine, and ItemTextField.
|
inlinevirtual |
Processes the given event.
Reimplemented in ItemTextField, ItemFloatField, ItemIntField, and ItemColorChannel.
|
virtual |
Returns the minimum width of the menu item.
Reimplemented in ItemHorizontalLine, ItemLabel, ItemToggle, ItemColorChannel, ItemColorDisplay, ItemStringSelect, ItemBack, ItemControlField, ItemFloatField, ItemIntField, ItemScriptLine, and ItemTextField.
|
inlinevirtual |
Returns true when the MenuManager shouldn't do anything else.
Reimplemented in ItemBack.
|
inlinevirtual |
Processes the menu action.
Reimplemented in ItemToggle, ItemColorChannel, ItemStringSelect, ItemBack, ItemFloatField, ItemIntField, ItemScriptLine, ItemTextField, ItemFile, ItemColor, ItemBadguySelect, ItemGoTo, ItemScript, and ItemAction.
|
inlinevirtual |
Returns true when the menu item has no action and therefore can be skipped.
Useful for labels and horizontal lines.
Reimplemented in ItemColorDisplay, ItemHorizontalLine, ItemLabel, and ItemInactive.
1.8.12