#include <GewiWidget.h>
Inherited by Gewi::GButton, Gewi::GContainer, Gewi::GSlider, Gewi::GStaticText, and Gewi::GTextField.
Public Member Functions | |
GWidget (GContainer *parent=NULL) | |
Simple constructor for GWidget. | |
virtual | ~GWidget () |
Simple destructor. | |
void | ToggleVisible () |
Toggle the visible flag. | |
void | FitParent () |
Reposition widget within parent. | |
virtual void | Create (float x, float y, float width, float height) |
Sets position and dimensions of widget. | |
virtual void | Move (float x, float y) |
Change relative position. | |
virtual void | Message (SDL_Event *rawEvent, GewiEvent event, Uint16 mouseX, Uint16 mouseY, char ch)=0 |
Important function used to recieve messages. | |
virtual void | Show ()=0 |
Draws this button to the screen. | |
float | X () |
Get X position of widget. | |
float | Y () |
Get Y position of widget. | |
bool | Visible () |
Get visible state of widget. | |
bool | MouseInWidget () |
Check if mouse is in widget. | |
bool | Contains (Sint16 x, Sint16 y) |
Check if the widget contains a point. | |
Protected Attributes | |
GewiEngine * | rGewi |
Pointer to GewiEngine instance. | |
ZE::ZEngine * | rZE |
Pointer to ZEngine instance. | |
ZE::ZRect | rBoundRect |
Rectangle describing area of widget. | |
GContainer * | rParent |
Pointer to parent container. (NULL means it lays in the global setting). | |
float | rRelX |
Relative X position, relative to parent, or top corner of screen if in global setting. | |
float | rRelY |
Relative Y position, relative to parent, or top corner of screen if in global setting. | |
bool | rVisible |
Stores if widget is currently visible. |
|
Constructor for GWidget, like all widgets this must initialize private data and can take a parent.
|
|
Must be virtual so that each derived class can free it's members. |
|
Toggles the visible flag, only visible widgets are drawn. |
|
Adjust this widget to be in the correct position in relationship to it's parent. Only containers call this on their children, it generally shouldn't be called. |
|
Sets up widget rectangle, most widgets must override this to include their specific settings.
|
|
Set new relative position for widget.
Reimplemented in Gewi::GContainer. |
|
Recieves and processes a message, required overload for all widgets.
Implemented in Gewi::GButton, Gewi::GContainer, Gewi::GHorizSlider, Gewi::GVertSlider, Gewi::GStaticText, Gewi::GTextField, and Gewi::GWindow. |
|
Draws widget to the screen, required overload for all widgets. Implemented in Gewi::GButton, Gewi::GContainer, Gewi::GHorizSlider, Gewi::GVertSlider, Gewi::GStaticText, Gewi::GTextButton, Gewi::GTextField, and Gewi::GWindow. |
|
Get actual (not relative) X position of top left corner of widget.
|
|
Get actual (not relative) Y position of top left corner of widget.
|
|
Returns status of internal visible flag.
|
|
Returns status of mouse inside widget.
|
|
Check if the widget contains the point specified.
|