GuiFlowWindow Class Reference
[2D graphical user interface]

A window that can move from a position to another. More...

#include <guibackground.h>

Inheritance diagram for GuiFlowWindow:

Inheritance graph
[legend]
Collaboration diagram for GuiFlowWindow:

Collaboration graph
[legend]
List of all members.

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)

Detailed Description

A window that can move from a position to another.


Constructor & Destructor Documentation

GuiFlowWindow::GuiFlowWindow ( TiXmlElement el,
GuiElement p 
)

Constructor. Uses XML data.

Parameters:
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)
See also:
GuiPictureBg(TiXmlElement*,GuiElement*)


Member Function Documentation

virtual const char* GuiFlowWindow::getClassName (  )  [inline, virtual]

This function should be overriden in every sub-class of BasicObject!

Returns:
the name of the class.

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.

Parameters:
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.

Returns:
zero, if no error occured; if not zero, drawing is stopped
Note:
if you derive the function, then call GuiElement::onFrame(SdlSurface*) after your class's drawing was done in the onFrame-event, otherwise you paint over the children elements

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.

Returns:
anything, currently not used, but should return zero.

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.

Parameters:
t pointer to the new used theme
Returns:
currently the result is not used; may be zero, if no error...

Reimplemented from GuiPictureBg.

Reimplemented in GuiHint.


The documentation for this class was generated from the following files:
Generated on Wed May 9 17:36:18 2007 for netrinjo by  doxygen 1.5.1