Return to Index
Widget
This is the base class for all graphical user interface components.
It provides the basic geometry management functions, as well as
functions for changing visibility, focus, and parent widgets.
A widget cannot be created directly.
void Widget::destroy |
void Widget::destroy();
Calling this method causes the widget to destroy itself. This deletes the object. |
void Widget::setParent |
void Widget::setParent(Container* pParent);
Changes the widget's parent container. |
Parameters: |
Container* | pParent | The new parent container. |
|
Container* Widget::getParent |
Container* Widget::getParent();
Returns the parent container. |
void Widget::show |
void Widget::show();
Causes the widget to be visible on the screen. |
void Widget::hide |
void Widget::hide();
Causes the widget to be hidden from view. |
void Widget::setForeground |
void Widget::setForeground(const Color& c);
Sets the foreground color of the widget. Usually this is the text label. |
Parameters: |
const Color& | c | The color. |
|
void Widget::setBackground |
void Widget::setBackground(const Color& c);
Sets the background color of the widget. |
Parameters: |
const Color& | c | The color. |
|
void Widget::setEnabled |
void Widget::setEnabled(bool pEnable);
Changes whether the widget is sensitive to user interactions. |
Parameters: |
bool | pEnable | Whether to enable or diable the widget. |
|
void Widget::grabFocus |
void Widget::grabFocus();
Attempts to acquire the input focus. |
void Widget::setPosition |
void Widget::setPosition(int pX, int pY);
Changes the widget's upper-left x,y coordinates relative to its parent container. |
Parameters: |
int | pX | The X coordinate. |
int | pY | The Y coordinate. |
|
void Widget::setSize |
void Widget::setSize(int pWidth, int pHeight);
Changes the widget's size. |
Parameters: |
int | pWidth | The new width. |
int | pHeight | The new height. |
|
void Widget::setGeometry |
void Widget::setGeometry(int pX, int pY, int pWidth, int pHeight);
Changes the widget's position and size. |
Parameters: |
int | pX | The X coordinate. |
int | pY | The Y coordinate. |
int | pWidth | The new width. |
int | pHeight | The new height. |
|
int Widget::getWidth |
int Widget::getWidth();
Returns the widget's width in pixels. |
int Widget::getHeight |
int Widget::getHeight();
Returns the widget's height in pixels. |
void Widget::getPosition |
void Widget::getPosition(int& pX, int& pY);
Gets the widget's x-y position. |
Parameters: |
int& | pX | The integer to assign the X-coordinate to. |
int& | pY | The integer to assign the Y-coordinate to. |
|
void Widget::getGeometry |
void Widget::getGeometry(int& pX, int& pY, int& pWidth, int& pHeight);
Gets the widget's position and size. |
Parameters: |
int& | pX | The integer to assign the X-coordinate to. |
int& | pY | The integer to assign the Y-coordinate to. |
int& | pWidth | The integer to assign the width to. |
int& | pHeight | The integer to assign the height to. |
|
void Widget::setTooltip |
void Widget::setTooltip(const String& str);
Sets the tooltip shown for the widget when the mouse hovers above it. |
Parameters: |
const String& | str | The string to display. An empty string clears the tooltip. |
|
void Widget::redraw |
void Widget::redraw();
Causes the widget to redraw itself on the screen. Note that this can be used to force a Paint event for a Canvas widget. |
Generated automatically by docgen 0.0.1
© 2003 Aron Dobos