Base for "single" graphical user interface controls. More...
#include <mgui/ctrl.h>

Public Types | |
| typedef fastdelegate::FastDelegate < void(int, int)> | DELEGATE_ONSIZE |
| enum | SHADOW { SHADOW_None = 0, SHADOW_Black, SHADOW_White, SHADOW_In, SHADOW_Out } |
Public Member Functions | |
| virtual | ~CTRL ()=0 |
| void | GetBackgroundColor (COLOR &color) const |
| void | GetDimensions (MGUI::POINT &dimensions) const |
| MDLGPARENT | GetDlgParent () const |
| SHELL * | GetShell () const |
| CTRL_TOOLTIP * | GetToolTip () const |
| Widget | GetWidget () const |
| void | Invalidate (bool erase=true) |
| virtual bool | IsCreated () const |
| virtual bool | IsEnabled () const |
| bool | IsVisible () const |
| void | SetBackgroundColor (const COLOR &color) |
| void | SetDimensions (MGUI::POINT dimensions) |
| virtual void | SetEnabled (bool enabled=true) |
| void | SetForegroundColor (const COLOR &color) |
| void | SetMinimumSize (int width, int height) |
| void | SetSizeByKey (const char *SizeKey) |
| void | SetToolTipString (const MISTRING &string) |
| virtual void | SetVisible (bool visible=true) |
| void | UpdateWindow () |
Static Public Member Functions | |
| static const COLOR & | GetBackgroundColor () |
| static void | ProcessWidgetEvents (Widget widget) |
| static void | SetWidgetShadow (Widget widget, SHADOW shadow) |
Protected Member Functions | |
| CTRL () | |
| void | AddDestroyCallback () |
| virtual void | v_OnDestroyWidget () |
Static Protected Member Functions | |
| static void | SetShadowArgs (XTARGS &args, SHADOW shadow) |
Protected Attributes | |
| Widget | m_widget |
Base for "single" graphical user interface controls.
There are two basic types of 'controls' which can be used in user interface implementation, controls which the user can interact with and 'static' controls which the user cannot change directly.
All controls which the user can manipulate also encapsulate information about the current 'state' of the control (except for MGUI::CTRL_PUSHBUTTON). There are three common ways to use each of these controls in a program (in order of convenience):
| typedef fastdelegate::FastDelegate<void(int, int)> MGUI::CTRL::DELEGATE_ONSIZE |
Delegate type for size change notification.
Parameters are xsize, ysize.
| enum MGUI::CTRL::SHADOW |
| virtual MGUI::CTRL::~CTRL | ( | ) | [pure virtual] |
Destructor.
| MGUI::CTRL::CTRL | ( | ) | [inline, protected] |
Constructor (X version).
| void MGUI::CTRL::AddDestroyCallback | ( | ) | [protected] |
Add 'Destroy' callback for widget.
| void MGUI::CTRL::GetBackgroundColor | ( | COLOR & | color | ) | const |
Get control 'background' color.
| static const COLOR& MGUI::CTRL::GetBackgroundColor | ( | ) | [static] |
Get common interface 'background' color.
| void MGUI::CTRL::GetDimensions | ( | MGUI::POINT & | dimensions | ) | const |
Get control dimensions.
| dimensions | Dimensions returned |
| MDLGPARENT MGUI::CTRL::GetDlgParent | ( | ) | const |
Get parent for dialogs launched from control.
Reimplemented in MGUI::CANVAS.
| SHELL* MGUI::CTRL::GetShell | ( | ) | const |
Get pointer to shell containing control.
| CTRL_TOOLTIP* MGUI::CTRL::GetToolTip | ( | ) | const |
Get associated ToolTip control.
| Widget MGUI::CTRL::GetWidget | ( | ) | const [inline] |
Get the Widget for the control or container if multiple controls (X only).
The widget should only be used for attachment, do not assume the widget is of a particular type.
| void MGUI::CTRL::Invalidate | ( | bool | erase = true |
) |
Invalidate the entire control area.
This will force it to redraw during normal event processing.
| virtual bool MGUI::CTRL::IsCreated | ( | ) | const [virtual] |
Determine if control has been created.
Implements MGUI::FORM.
| virtual bool MGUI::CTRL::IsEnabled | ( | ) | const [virtual] |
Determine if control is enabled for keyboard or mouse input.
| bool MGUI::CTRL::IsVisible | ( | ) | const |
Determine if control is visible.
| static void MGUI::CTRL::ProcessWidgetEvents | ( | Widget | widget | ) | [static] |
Process all pending events for widget, discarding others.
Intended for use in code which checks for a "button press" during an operation, ignoring user actions on other controls.
| void MGUI::CTRL::SetBackgroundColor | ( | const COLOR & | color | ) |
Set control 'background' color.
Reimplemented in MGUI::CTRL_MAGNIFIER, and MGUI::CTRL_TREE.
| void MGUI::CTRL::SetDimensions | ( | MGUI::POINT | dimensions | ) |
Set control dimensions if allowed.
| dimensions | New dimensions requested |
| virtual void MGUI::CTRL::SetEnabled | ( | bool | enabled = true |
) | [virtual] |
Set whether mouse or keyboard input to control is allowed.
Implements MGUI::FORM.
Reimplemented in MGUI::CTRL_COMBOBOX.
| void MGUI::CTRL::SetForegroundColor | ( | const COLOR & | color | ) |
Set control 'foreground' color.
| void MGUI::CTRL::SetMinimumSize | ( | int | width, | |
| int | height | |||
| ) |
Set minimum size for control.
| width | Minimum width in pixels, -1 to leave unchanged | |
| height | Minimum height in pixels, -1 to leave unchanged |
| void MGUI::CTRL::SetSizeByKey | ( | const char * | SizeKey | ) |
Set control size using key.
This will automatically load the size and subsequently record any changes later made to the size by the user.
| void MGUI::CTRL::SetToolTipString | ( | const MISTRING & | string | ) |
Set ToolTip string.
Recommended for simple ToolTip support only. For complex or dynamic ToolTips use the CTRL_TOOLTIP class directly.
| string | String to use for ToolTip |
| virtual void MGUI::CTRL::SetVisible | ( | bool | visible = true |
) | [virtual] |
Set whether control is visible or not.
Implements MGUI::FORM.
Set shadow for widget.
| void MGUI::CTRL::UpdateWindow | ( | ) |
Force window to be updated immediately if necessary.
| virtual void MGUI::CTRL::v_OnDestroyWidget | ( | ) | [protected, virtual] |
Widget MGUI::CTRL::m_widget [protected] |
1.6.1