#include <guicursor.h>
Inheritance diagram for GuiCursor:
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 () |
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.
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!
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 |
virtual const char* GuiCursor::getClassName | ( | ) | [inline, virtual] |
This function should be overriden in every sub-class of BasicObject!
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).
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.
x | the new, absolute x coordinate of the cursor | |
y | the new, absolute y coordinate of the cursor |
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.