#include <guibackground.h>
Inheritance diagram for GuiFlowWindow:
Public Types | |
enum | FlyStyles { sinus, cosinus, constant, powsin, sin_2, theme_std } |
Public Member Functions | |
DECLSPEC | GuiFlowWindow (const SDL_Rect &r, GuiElement *el, const char *name, Uint32 color=CLR_STANDARD, SdlSurface *backbmp=0, FlyStyles style=theme_std) |
DECLSPEC | GuiFlowWindow (TiXmlElement *el, GuiElement *p) |
virtual const char * | getClassName () |
DECLSPEC void | flyTo (const SDL_Rect &r, Uint32 t) |
DECLSPEC void | start () |
same as flyTo(), using rDestination and nTime | |
DECLSPEC void | stop () |
stops the flight immediatelly, the window will be placed to rDestination | |
void | swapSrcDest () |
swaps the source and destination rects, so it can fly back | |
void | setPosReachedCallback (Callback c, BasicObject *aim) |
Static Public Member Functions | |
static void | newguiobject (void *presult, BasicObject *o, void *xmldata) |
static void | startflight (void *sender, BasicObject *aim, void *time) |
Public Attributes | |
enum GuiFlowWindow::FlyStyles | eFlyStyle |
SDL_Rect | rDestination |
the rect where the current flight should finish | |
Uint32 | nTime |
duration of a flight | |
Protected Member Functions | |
virtual DECLSPEC Uint32 | onFrame (SdlSurface *dst) |
virtual DECLSPEC Uint32 | onPosReached () |
virtual DECLSPEC void | onInit () |
virtual DECLSPEC Uint32 | onThemeChanged (UiTheme *t) |
GuiFlowWindow::GuiFlowWindow | ( | TiXmlElement * | el, | |
GuiElement * | p | |||
) |
Constructor. Uses XML data.
el | the XML data for initialisation, the following attributes are read: DestRect (rect), Time (int), FlyStyle; after a call to flyTo(), the value specified by Time is overwritten by the 2nd param of flyTo(). | |
p | parent element (or NULL, to take GuiManager::the as parent) |
virtual const char* GuiFlowWindow::getClassName | ( | ) | [inline, virtual] |
This function should be overriden in every sub-class of BasicObject!
Reimplemented from GuiPictureBg.
Reimplemented in GuiFlowMenu, GuiHint, and GuiTextField.
void GuiFlowWindow::flyTo | ( | const SDL_Rect & | r, | |
Uint32 | t | |||
) |
Starts flying to the specified rect taking the specified time.
r | the destination rect | |
t | the time (in ms) the flight should take; if zero, the default is used |
void GuiFlowWindow::setPosReachedCallback | ( | Callback | c, | |
BasicObject * | aim | |||
) | [inline] |
Sets the callback data, for the onPosReached()-event (called after a flight finished, but not if stop() is called).
Uint32 GuiFlowWindow::onFrame | ( | SdlSurface * | dst | ) | [protected, virtual] |
This event is called, when a frame is drawn. If the object should be visible, is has to draw it's look to a valid surface. This method calls the children's function, if visible.
Reimplemented from GuiPictureBg.
Uint32 GuiFlowWindow::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 in GuiFlowMenu.
void GuiFlowWindow::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 GuiPictureBg.
Reimplemented in GuiFlowMenu, GuiHint, and GuiTextField.
Uint32 GuiFlowWindow::onThemeChanged | ( | UiTheme * | t | ) | [protected, virtual] |
This event is called, when the theme changes. Perform here the changes of the object's look and feel.
t | pointer to the new used theme |
Reimplemented from GuiPictureBg.
Reimplemented in GuiHint.