#include <guibackground.h>
Inheritance diagram for GuiFrame:
Public Member Functions | |
DECLSPEC | GuiFrame (const SDL_Rect &r, GuiElement *p, const char *name, Uint32 c_out=CLR_INVALID, Uint32 c_over=CLR_INVALID) |
DECLSPEC | GuiFrame (TiXmlElement *el, GuiElement *p) |
virtual const char * | getClassName () |
Static Public Member Functions | |
static void | newguiobject (void *presult, BasicObject *o, void *xmldata) |
Public Attributes | |
Uint32 | color1 |
the color to use for filling, if the cursor is not above it | |
Uint32 | color2 |
the color to use for filling, if the cursor is above it | |
Protected Member Functions | |
virtual DECLSPEC Uint32 | onMouseOver () |
virtual DECLSPEC Uint32 | onMouseOut () |
virtual DECLSPEC void | onInit () |
This is a simple class, that fills its rect with one color, if the cursor is above it and with another color, if it is not above it.
GuiFrame::GuiFrame | ( | const SDL_Rect & | r, | |
GuiElement * | p, | |||
const char * | name, | |||
Uint32 | c_out = CLR_INVALID , |
|||
Uint32 | c_over = CLR_INVALID | |||
) |
Constructor.
r | the rect of the element's appearance, relative to the parent's top-left position | |
p | the parent element; or NULL, if it will be used as top level | |
name | the element's name | |
c_out | the color to use for filling, if the cursor is not above it | |
c_over | the color to use for filling, if the cursor is above it |
GuiFrame::GuiFrame | ( | TiXmlElement * | el, | |
GuiElement * | p | |||
) |
Constructor. Uses XML data.
el | the XML data for initialisation | |
p | parent element (or NULL, to take GuiManager::the as parent) |
virtual const char* GuiFrame::getClassName | ( | ) | [inline, virtual] |
This function should be overriden in every sub-class of BasicObject!
Reimplemented from GuiBackground.
Uint32 GuiFrame::onMouseOver | ( | ) | [protected, virtual] |
This event is called, when the mouse cursor just moved into the object's rect.
Reimplemented from GuiElement.
Uint32 GuiFrame::onMouseOut | ( | ) | [protected, virtual] |
This event is called, when the mouse cursor just moved out of the object's rect.
Reimplemented from GuiElement.
void GuiFrame::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 GuiBackground.