#include <guiflowmenu.h>
Inheritance diagram for GuiFlowMenu:
Public Member Functions | |
DECLSPEC | GuiFlowMenu (TiXmlElement *el, GuiElement *p) |
virtual const char * | getClassName () |
long | getActiveItemID () |
| |
GuiFlowMenuItem * | getActiveItem () |
| |
void | setFlyTime (Uint32 t) |
void | setShowRect (const SDL_Rect &r) |
void | setDisappearRect (const SDL_Rect &r) |
DECLSPEC void | appear () |
Lets the window appear. | |
DECLSPEC void | disappear () |
Lets the window disappear. | |
void | setChooseNextCallback (const BasicObject::FunctionData &fd) |
void | setNoNextCallback (const BasicObject::FunctionData &fd) |
void | setFlewInCallback (const BasicObject::FunctionData &fd) |
void | setBackCallback (const BasicObject::FunctionData &fd) |
Static Public Member Functions | |
static void | newguiobject (void *presult, BasicObject *o, void *xmldata) |
static void | flyout_back (void *sender, BasicObject *aim, void *) |
static void | flyout_next (void *sender, BasicObject *aim, void *) |
static void | flyout_disappear (void *sender, BasicObject *aim, void *) |
static void | flyin (void *sender, BasicObject *aim, void *) |
Static Public Attributes | |
static const long | ID_INVALID |
ID of invalid. | |
Protected Member Functions | |
virtual DECLSPEC void | onInit () |
virtual DECLSPEC Uint32 | onPosReached () |
Friends | |
class | GuiFlowMenuItem |
GuiFlowMenu::GuiFlowMenu | ( | TiXmlElement * | el, | |
GuiElement * | p | |||
) |
Constructor. Uses XML data. If the attribute XmlFile is specified, the menu-items are created as specified in that XML-file: The root element must be "GuiFlowMenu", the children (1st generation) must be "MenuItem"s with an attribute "ID" (the ID of the item, see addMenuItem()) and the children 2nd generation must be usual "Gui*"-elements, but only one child per menu-item is observed (the 1st one).
el | the XML data for initialisation, the following attributes are read: XmlFile (string, filename), StartMenuID (int), ShowRect (rect), DisappearRect (rect); Events: OnChooseNext, OnNoNext, OnFlewIn, OnDisappeared, OnBack. | |
p | parent element |
virtual const char* GuiFlowMenu::getClassName | ( | ) | [inline, virtual] |
This function should be overriden in every sub-class of BasicObject!
Reimplemented from GuiFlowWindow.
void GuiFlowMenu::setFlyTime | ( | Uint32 | t | ) | [inline] |
Sets the duration of the menu's (dis)appearing.
t | the time in millisecs |
void GuiFlowMenu::setShowRect | ( | const SDL_Rect & | r | ) | [inline] |
Sets the rect to which the window flies, when it appeares. That is the position, where it stays when being visible to the user.
r | the rect |
void GuiFlowMenu::setDisappearRect | ( | const SDL_Rect & | r | ) | [inline] |
Sets the rect to which the window flies, when disappear() is called. This is the same rect, where it starts flying from, when appear() is called.
r | the rect |
void GuiFlowMenu::setChooseNextCallback | ( | const BasicObject::FunctionData & | fd | ) | [inline] |
Sets the callback function that is called, after the window flew out of the screen.
fd | the callback data |
void GuiFlowMenu::setNoNextCallback | ( | const BasicObject::FunctionData & | fd | ) | [inline] |
Sets the callback function that is called, when there is no valid next-ID. So it does not have a menu to display. You can use this callback i.e. to start the game.
fd | the callback data |
void GuiFlowMenu::setFlewInCallback | ( | const BasicObject::FunctionData & | fd | ) | [inline] |
Sets the callback function that is called, after the window flew into the screen.
fd | the callback data |
void GuiFlowMenu::setBackCallback | ( | const BasicObject::FunctionData & | fd | ) | [inline] |
Sets the callback function that is called, after the window flew back into the screen.
fd | the callback data |
void GuiFlowMenu::onInit | ( | ) | [protected, virtual] |
Initializes the object's variables by reading data from the XML element. If there were no XML data used for creation, nothing is done. This function calls onInit() of its children recursively (after it has inited itself). It is highly recommended to call BasicObject::onInit(), usually at the end of the onInit() method, when overwriting it in a derived class.
Reimplemented from GuiFlowWindow.
Uint32 GuiFlowMenu::onPosReached | ( | ) | [protected, virtual] |
This event is called, when the "flight" is done. So the window's position is equal to the destination-rect, as specified in the 1st param of flyTo() and the time as specified in the 2nd param has expired.
Reimplemented from GuiFlowWindow.