#include <Menu.h>
Inheritance diagram for Menu:
Public Types | |
enum | MenuType { NORMAL, SCROLLING } |
Public Member Functions | |
Menu (const string &label, const string &name, Font *font, MenuType type=NORMAL) | |
void | setVirtualScreenSize (float width, float height) |
void | addChild (MenuItem *item) |
void | load (ifstream &file) |
void | save (ofstream &file) |
void | draw (float x, float y, float zoom) |
virtual void | renderMenu () |
Type | getType () |
float | getWidth (float zoom) |
float | getHeight (float zoom) |
string & | getName () |
bool | handleKeyEvent (SDL_Event *event) |
bool | getSelected () |
void | setSelected (bool isSelected) |
MenuItem * | findItem (const string &name) |
Definition at line 19 of file Menu.h.
|
Types defining the apperance of a menu. |
|
Adds a child tho this menu, use this method to add sub menus / menu items. |
|
Draws the MenuItem at x,y with a zoom factor of zoom (2 equals double size). The MenuItem may decide not to apply the scale or to only support some zoom steps, always check getWidth and getHeight if you need the excact size. Implements MenuItem. |
|
Recurcivly finds an child og subchild. |
|
Returns the height of this MenuItem at zoom factor zoom, must be excact Implements MenuItem. |
|
Returns the name of the MenuItem used when save is called. The name may not contain a =. Implements MenuItem. |
|
Returns if the current menu is selected, when a menu is selected it should be showed with renderMenu. |
|
Returns the Type of this control. Implements MenuItem. |
|
Returns the width of this MenuItem at zoom factor zoom, must be excact Implements MenuItem. |
|
Called when a key press/release event occurs, return true if the MenuItem has handled the event. If true is returned the event handling will stop. Implements MenuItem. |
|
Loads this menus from the file, will be called recurcivly on the children. Reimplemented from MenuItem. |
|
Renders the menu on screen, different from draw in that renderMenu renders the menu with children. draw only draws the menu as a sub menu |
|
Saves this menus to the file, will be called recurcivly on the children. Reimplemented from MenuItem. |
|
Sets the menus selected state. |
|
Sets the size of the virtual screen |