GuiCursor Class Reference
[2D graphical user interface]

A class for showing a simple mouse cursor. More...

#include <guicursor.h>

Inheritance diagram for GuiCursor:

Inheritance graph
[legend]
Collaboration diagram for GuiCursor:

Collaboration graph
[legend]
List of all members.

Public Member Functions

DECLSPEC GuiCursor (const SDL_Rect &r, GuiElement *p, const char *name, SdlSurface *bmp, Uint16 x, Uint16 y)
DECLSPEC GuiCursor (TiXmlElement *el, GuiElement *p)
virtual const char * getClassName ()
void setHotPoint (Uint16 x, Uint16 y)

Static Public Member Functions

static void newguiobject (void *presult, BasicObject *o, void *xmldata)

Protected Member Functions

virtual DECLSPEC Uint32 onMouseMove (Uint32 x, Uint32 y)
virtual DECLSPEC void onInit ()

Detailed Description

A class for showing a simple mouse cursor.

This class is used to show a mouse cursor on the display. It is hidden after creation, but automatically becomes visible when its onMouseMove() is called.


Constructor & Destructor Documentation

GuiCursor::GuiCursor ( const SDL_Rect &  r,
GuiElement p,
const char *  name,
SdlSurface bmp,
Uint16  x,
Uint16  y 
)

Constructor. The hot point is set here. The cursor is hidden by default!

Parameters:
p the parent element
bmp the picture for the cursor's look
x the x coordinate of the hot point
y the y coordinate of the hot point


Member Function Documentation

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

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

Returns:
the name of the class.

Reimplemented from GuiPictureBg.

void GuiCursor::setHotPoint ( Uint16  x,
Uint16  y 
) [inline]

Sets the hot point of the cursor (the position, where the cursor is, relative to the position of the cursor's top-left corner).

Parameters:
x the x coordinate of the hot point
y the y coordinate of the hot point

Uint32 GuiCursor::onMouseMove ( Uint32  x,
Uint32  y 
) [protected, virtual]

This event is called, when the mouse cursor was moved.

Parameters:
x the new, absolute x coordinate of the cursor
y the new, absolute y coordinate of the cursor
Returns:
currently the result is not used; may be zero, if no error...

Reimplemented from GuiElement.

void GuiCursor::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.


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