#include <MAUI/Image.h>
Inheritance diagram for MAUI::Image:
Public Member Functions | |
Image (int x, int y, int width, int height, Widget *parent=0, bool autoSizeX=true, bool autoSizeY=true, MAHandle res=0) | |
void | setResource (MAHandle res) |
MAHandle | getResource () const |
virtual void | add (Widget *w) |
void | setParent (Widget *w) |
Widget * | getParent () |
Vector< Widget * > & | getChildren () |
const Vector< Widget * > & | getChildren () const |
virtual void | draw (bool forceDraw=false) |
virtual void | update () |
void | requestRepaint () |
virtual bool | isTransparent () const |
virtual void | setSkin (WidgetSkin *widgetSkin) |
void | setDrawBackground (bool b=true) |
void | setBackgroundColor (int col) |
Widget * | widgetAt (const Point &p) |
Widget * | widgetAt (int x, int y) |
virtual void | setPosition (int x, int y) |
const Point & | getPosition () const |
const Point & | getPaddedPosition () const |
virtual void | setWidth (int width) |
int | getWidth () const |
virtual void | setHeight (int height) |
int | getHeight () const |
virtual const Rect & | getBounds () |
virtual bool | contains (const Point &p) |
virtual bool | contains (int x, int y) |
virtual void | setSelected (bool selected=true) |
bool | isSelected () const |
virtual void | setEnabled (bool enabled=true) |
bool | isEnabled () const |
virtual void | trigger () |
void | addWidgetListener (WidgetListener *wl) |
void | removeWidgetListener (WidgetListener *wl) |
Vector< WidgetListener * > & | getWidgetListeners () |
void | setInputManager (InputManager *inputManager) |
virtual void | setPaddingLeft (int l) |
virtual void | setPaddingTop (int t) |
virtual void | setPaddingRight (int r) |
virtual void | setPaddingBottom (int b) |
int | getPaddingLeft () const |
int | getPaddingTop () const |
int | getPaddingRight () const |
int | getPaddingBottom () const |
const Rect & | getPaddedBounds () const |
virtual void | setParameter (const String &name, const String &value) |
Protected Member Functions | |
void | drawWidget () |
void | drawBackground () |
void | updateAbsolutePosition () |
void | updateAbsolutePositionChildren (int x, int y) |
void | updatePaddedBounds () |
bool | isDirty () const |
void | setDirty (bool d=true) |
Protected Attributes | |
MAHandle | resource |
bool | autoSizeX |
bool | autoSizeY |
int | imageWidth |
int | imageHeight |
Vector< Widget * > | children |
Widget * | parent |
Rect | bounds |
int | relX |
int | relY |
bool | dirty |
WidgetSkin * | skin |
int | backColor |
bool | shouldDrawBackground |
bool | selected |
bool | enabled |
Vector< WidgetListener * > | widgetListeners |
InputManager * | mInputManager |
Rect | paddedBounds |
int | paddingLeft |
int | paddingTop |
int | paddingBottom |
int | paddingRight |
|
Constructor.
|
|
Set the image resource of the image widget. |
|
Get the image resource of the image widget. |
|
This is the only function that is absolutely neccesary to implement when inheriting Widget to create a custom widget. It is responsible for painting the widget. When it is called, the widget must respect its own padded bounds and not extend rendering beyond that area. Implements MAUI::Widget. |
|
Function used to add childs to a widget. The parent of the children will automatically be set. The widget cannot have a parent already. Reimplemented in MAUI::Layout, and MAUI::ListBox. |
|
Function used to set the parent of a widget. The widget will not be added to the parent as a child. The widget cannot have a parent already. |
|
Function to retrieve the parent of a widget. |
|
Function to retrieve a reference to the list of childrens for a widget. |
|
const version of getChildren() |
|
Renders the Widget and all its children recursively. Reimplemented in MAUI::ListBox. |
|
Reimplemented in MAUI::Label, MAUI::Layout, and MAUI::ListBox. |
|
Registers an idle listener with the current environment that will redraw the widget and anything else that may be made dirty by doing so. For instance, if the widget is transparent its parent also has to be repainted, and so on recursively. |
|
Returns whether or not the widget is transparent. A widget is transparent if it has a skin that is transparent in the current selection state (selected/unselected) or if it has no solid background color. |
|
Assigns a widget skin to be used during the rendering of the widget. What The skin applies to varies depending on the widget. Labels extend the skin over their entire area, while listboxes apply the skin to each individual item they contain. |
|
Sets the background drawing state. If b is true, the Widget's background will be drawn - otherwise not. In most cases, the background is either a constant color or a skin. |
|
|
|
Returns a pointer to the first child widget or deeper descendant, surrounding the point. Returns NULL if no widget is found. |
|
|
|
Sets the widget's position relative to its parent. Reimplemented in MAUI::Layout. |
|
Gets the widget's position relative to its parent. |
|
Gets the widget's padded position relative to its parent. |
|
Sets the width of the widget Reimplemented in MAUI::Layout, MAUI::ListBox, and MAP::MapWidget. |
|
Returns the width of the widget |
|
Sets the height of the widget Reimplemented in MAUI::Layout, MAUI::ListBox, and MAP::MapWidget. |
|
Returns the height of the widget |
|
Returns a Rect containing the absolute screen position of the widget together with its dimensions. |
|
Check if widget surrounds position 'p'. |
|
Check if widget surrounds position 'x' and 'y'. |
|
Set widget selected state (default: true). Reimplemented in MAUI::EditBox. |
|
Is widget selected?. |
|
Set Widget enabled state Reimplemented in MAUI::EditBox. |
|
Is Widget enabled ? |
|
This function is called whenever the widget is "triggered", which is roughly equivalent to having been "clicked" on. However, sice MAUI is independant of input facilities, the more input-neutral concept of triggering is used. Reimplemented in MAUI::Layout. |
|
Add WidgetListener. |
|
Remove WidgetListener. |
|
returns a reference the the vector of Widget listeners |
|
Sets the input manager to use for this widget |
|
Set left padding width. Reimplemented in MAUI::Label. |
|
Set top padding height. Reimplemented in MAUI::Label. |
|
Set right padding width. Reimplemented in MAUI::Label. |
|
Set bottom padding height. Reimplemented in MAUI::Label. |
|
Get left padding width. |
|
Get top padding height. |
|
Get right padding width. |
|
Get bottom padding height. |
|
|
|
Reimplemented in MAUI::Label. |
|
|
|
This function is used to regenerate the absolute positions of each widget in the tree. This is done in a depth first manner where each widget takes the parent absolute position and adds it to their own relative position to calculate their absolute position. |
|
the recursive function used by updateAbsolutePosition(). |
|
Used to recalculate the padded bounds from the global bounds. |
|
Returns the dirty state of the widget, indicating whether it requires to be redrawn or not. When a widget calls requestRepaint(), it's dirty state is set to true. Normally, you shouldn't have to use isDirty() or setDirty() unless possibly when implementing your own widgets. |
|
Sets the dirty state of the widget. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|