#include <MenuItem.h>
Inheritance diagram for MenuItem:
Public Types | |
enum | Type { MENU, CONTROL, BACK_BUTTON } |
Public Member Functions | |
virtual | ~MenuItem () |
virtual void | load (ifstream &file) |
virtual void | save (ofstream &file) |
virtual void | draw (float x, float y, float zoom)=0 |
virtual Type | getType ()=0 |
virtual float | getWidth (float zoom)=0 |
virtual float | getHeight (float zoom)=0 |
virtual string & | getName ()=0 |
virtual bool | handleKeyEvent (SDL_Event *event)=0 |
Protected Member Functions | |
bool | findLoadPosition (const string &name, ifstream &file) |
Definition at line 18 of file MenuItem.h.
|
Definition at line 21 of file MenuItem.h. |
|
Destructor Definition at line 27 of file MenuItem.h. |
|
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. Implemented in Button, Key, Menu, TextEntry, and TextSelection. |
|
Finds a "name=value" pair in the stream, the stream pointer is left so that value can be read directly. Returns true if the "name=value" pair was found Definition at line 6 of file MenuItem.cpp. |
|
Returns the height of this MenuItem at zoom factor zoom, must be excact Implemented in Button, Key, Menu, TextEntry, and TextSelection. |
|
Returns the name of the MenuItem used when save is called. The name may not contain a =. Implemented in Button, Key, Menu, TextEntry, and TextSelection. |
|
Returns the Type of this control. Implemented in BackButton, Button, Key, Menu, TextEntry, and TextSelection. |
|
Returns the width of this MenuItem at zoom factor zoom, must be excact Implemented in Button, Key, Menu, TextEntry, and TextSelection. |
|
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. Implemented in Button, Key, Menu, TextEntry, and TextSelection. |
|
Reads the configuration for the MenuItem from any position within the file Hint: Use findLoadPosition to find you entry in the file Reimplemented in Key, Menu, TextEntry, and TextSelection. Definition at line 33 of file MenuItem.h. |
|
Saves the MenuItem at the current position in the file. Entrys must look like "name=value\n". Reimplemented in Key, Menu, TextEntry, and TextSelection. Definition at line 38 of file MenuItem.h. |