#include <OpenGUI_Control.h>
Inheritance diagram for OpenGUI::Control:

Public Types | |
| None = 0 | |
| No side. | |
| Left = 1 | |
| Left side. | |
| Right = 1 << 1 | |
| Right side. | |
| Top = 1 << 2 | |
| Top side. | |
| Bottom = 1 << 3 | |
| Bottom side. | |
| All = Left | Right | Top | Bottom | |
| All sides. | |
| Fill = All | |
| Alias for All sides. | |
| enum | ControlSides { None = 0, Left = 1, Right = 1 << 1, Top = 1 << 2, Bottom = 1 << 3, All = Left | Right | Top | Bottom, Fill = All } |
| Values used by get/setDocking and get/setAnchor. More... | |
Public Member Functions | |
| Control () | |
| public constructor | |
| virtual | ~Control () |
| public destructor | |
| void | setLeft (float left) |
| Sets the position of the left side of the Control. | |
| float | getLeft () |
| Returns the position of the left side of the Control. | |
| void | setTop (float top) |
| Sets the position of the top side of the Control. | |
| float | getTop () |
| Returns the position of the top side of the Control. | |
| void | setWidth (float width) |
| Sets the width of the Control. | |
| float | getWidth () |
| Returns the width of the Control. | |
| void | setHeight (float height) |
| Sets the height of the Control. | |
| float | getHeight () |
| Returns the height of the Control. | |
| const FVector2 & | getPosition () |
| Returns the position of the upper left corner of the Control. | |
| FVector2 | getSize () |
| Returns the size of the Control. | |
| const FRect & | getRect () |
| Returns the FRect describing this Control's size and position. | |
| const FVector2 & | getMinimumSize () |
| Returns the minimum size this Control will allow itself to be resized to. | |
| void | setMinimumSize (const FVector2 &size) |
| Sets the minimum size this Control will allow itself to be resized to. | |
| const FVector2 & | getMaximumSize () |
| Returns the maximum size this Control will allow itself to be resized to. | |
| void | setMaximumSize (const FVector2 &size) |
| Sets the maximum size this Control will allow itself to be resized to. | |
| void | setVisible (bool visible) |
| Sets the visibility of this Control. | |
| bool | getVisible () |
| Returns the visibility of this Control. | |
| void | setAlpha (float alpha) |
| Sets the alpha transparency of this Control. | |
| float | getAlpha () |
| Returns the alpha transparency of this Control. | |
| virtual ObjectAccessorList * | getAccessors () |
| returns this object's ObjectAccessorList head | |
| virtual unsigned int | getObjectType () const |
| Returns an integer identifying the type of object. | |
| void | setDocking (int dockStyle) |
| Sets the docking preference for this Control. | |
| int | getDocking () |
| Gets the current docking preference for this Control. | |
| void | setAnchor (int anchoredSides) |
| Sets the anchored sides for this Control. | |
| int | getAnchor () |
| Gets the current anchored sides for this control. | |
| void | setMargin (float margin) |
| sets the margin of this Control | |
| float | getMargin () |
| gets the margin of this Control | |
| virtual bool | isInside (const FVector2 &position) |
| Returns true if the given point is inside this Widget. | |
Protected Member Functions | |
| void | setCursor (CursorPtr cursorPtr) |
| Sets the cursor displayed when the Screen cursor is over this Control. | |
| CursorPtr | getCursor () const |
| Gets the current cursor displayed when the Screen cursor is over this Control. | |
Event Injectors | |
| void | eventMoved (const FVector2 &oldPosition, const FVector2 &newPosition) |
| Control has been moved. | |
| void | eventResized (const FVector2 &oldSize, const FVector2 &newSize) |
| Control has been resized. | |
| void | eventTargeted () |
| Called when this Control is targeted, either by cursor or by menu navigation. | |
| void | eventUnTargeted () |
| Called when this Control is no longer targeted, either by cursor or by menu navigation. | |
Event Handlers | |
| virtual void | onMoved (Object *sender, Moved_EventArgs &evtArgs) |
| "Moved" event | |
| virtual void | onResized (Object *sender, Resized_EventArgs &evtArgs) |
| "Resized" event | |
| virtual void | onCursorMove (Object *sender, Cursor_EventArgs &evtArgs) |
| "CursorMove" event, consumes the event | |
| virtual void | onCursorPress (Object *sender, Cursor_EventArgs &evtArgs) |
| "CursorPress" event, consumes the event | |
| virtual void | onCursorRelease (Object *sender, Cursor_EventArgs &evtArgs) |
| "CursorRelease" event, consumes the event | |
| virtual void | onCursorEnter (Object *sender, EventArgs &evtArgs) |
| "CursorEnter" event | |
| virtual void | onCursorLeave (Object *sender, EventArgs &evtArgs) |
| "CursorLeave" event | |
| virtual void | onTargeted (Object *sender, EventArgs &evtArgs) |
| "Targeted" event | |
| virtual void | onUnTargeted (Object *sender, EventArgs &evtArgs) |
| "UnTargeted" event | |
| OpenGUI::Control::Control | ( | ) |
public constructor
| OpenGUI::Control::~Control | ( | ) | [virtual] |
public destructor
| void OpenGUI::Control::eventMoved | ( | const FVector2 & | oldPosition, | |
| const FVector2 & | newPosition | |||
| ) | [protected] |
Control has been moved.
| void OpenGUI::Control::eventResized | ( | const FVector2 & | oldSize, | |
| const FVector2 & | newSize | |||
| ) | [protected] |
Control has been resized.
| void OpenGUI::Control::eventTargeted | ( | ) | [protected] |
Called when this Control is targeted, either by cursor or by menu navigation.
| void OpenGUI::Control::eventUnTargeted | ( | ) | [protected] |
Called when this Control is no longer targeted, either by cursor or by menu navigation.
| ObjectAccessorList * OpenGUI::Control::getAccessors | ( | ) | [virtual] |
returns this object's ObjectAccessorList head
Reimplemented from OpenGUI::Widget.
Reimplemented in OpenGUI::ContainerControl, and OpenGUI::Window.
| float OpenGUI::Control::getAlpha | ( | ) |
Returns the alpha transparency of this Control.
| int OpenGUI::Control::getAnchor | ( | ) |
Gets the current anchored sides for this control.
Return value will be a bit mask comprised of values within ControlSides.
| CursorPtr OpenGUI::Control::getCursor | ( | ) | const [protected] |
| int OpenGUI::Control::getDocking | ( | ) |
Gets the current docking preference for this Control.
Return value will be a single value within ControlSides.
| float OpenGUI::Control::getHeight | ( | ) |
Returns the height of the Control.
| float OpenGUI::Control::getLeft | ( | ) |
Returns the position of the left side of the Control.
| float OpenGUI::Control::getMargin | ( | ) |
| const FVector2 & OpenGUI::Control::getMaximumSize | ( | ) |
Returns the maximum size this Control will allow itself to be resized to.
| const FVector2 & OpenGUI::Control::getMinimumSize | ( | ) |
Returns the minimum size this Control will allow itself to be resized to.
| unsigned int OpenGUI::Control::getObjectType | ( | ) | const [virtual] |
Returns an integer identifying the type of object.
Reimplemented from OpenGUI::Widget.
Reimplemented in OpenGUI::ContainerControl, and OpenGUI::Window.
| const FVector2 & OpenGUI::Control::getPosition | ( | ) |
Returns the position of the upper left corner of the Control.
| const FRect & OpenGUI::Control::getRect | ( | ) |
Returns the FRect describing this Control's size and position.
| float OpenGUI::Control::getTop | ( | ) |
Returns the position of the top side of the Control.
| bool OpenGUI::Control::getVisible | ( | ) |
Returns the visibility of this Control.
| float OpenGUI::Control::getWidth | ( | ) |
Returns the width of the Control.
| bool OpenGUI::Control::isInside | ( | const FVector2 & | position | ) | [virtual] |
Returns true if the given point is inside this Widget.
Control implementation returns true if the point is within its rect, otherwise false.
position should already be in the correct coordinate space. Reimplemented from OpenGUI::Widget.
| void OpenGUI::Control::onCursorMove | ( | Object * | sender, | |
| Cursor_EventArgs & | evtArgs | |||
| ) | [protected, virtual] |
"CursorMove" event, consumes the event
Reimplemented from OpenGUI::Widget.
Reimplemented in OpenGUI::ContainerControl, and OpenGUI::Window.
| void OpenGUI::Control::onCursorPress | ( | Object * | sender, | |
| Cursor_EventArgs & | evtArgs | |||
| ) | [protected, virtual] |
"CursorPress" event, consumes the event
Reimplemented from OpenGUI::Widget.
Reimplemented in OpenGUI::ContainerControl.
| void OpenGUI::Control::onCursorRelease | ( | Object * | sender, | |
| Cursor_EventArgs & | evtArgs | |||
| ) | [protected, virtual] |
"CursorRelease" event, consumes the event
Reimplemented from OpenGUI::Widget.
Reimplemented in OpenGUI::ContainerControl.
| void OpenGUI::Control::onMoved | ( | Object * | sender, | |
| Moved_EventArgs & | evtArgs | |||
| ) | [protected, virtual] |
"Moved" event
| void OpenGUI::Control::onResized | ( | Object * | sender, | |
| Resized_EventArgs & | evtArgs | |||
| ) | [protected, virtual] |
"Targeted" event
"UnTargeted" event
| void OpenGUI::Control::setAlpha | ( | float | alpha | ) |
Sets the alpha transparency of this Control.
Alpha is clamped to 0.0f through 1.0f. Passing values outside of this range will result in alpha being set to either 0.0f or 1.0f, whichever is closer.
The local Alpha setting is a value that is not automatically enforced before onDraw(), meaning that if a Control is going to obey its Alpha setting, it should push that setting to the Brush before performing its draw routines.
In the case of Controls that contain other Controls, Alpha of the parent is automatically applied to the children in a multiplicative fashion. In other words, if both the parent and child Controls are set to 50% alpha, at final output the parent will draw at 50% alpha, and the child will draw at 25% alpha.
(50% * 50% = 25%)
| void OpenGUI::Control::setAnchor | ( | int | anchoredSides | ) |
Sets the anchored sides for this Control.
Anchoring is a service provided by the container. During resizes the container will check all of its children for Anchor preference. The children can specify anchoring preference to any sides they wish, but at least one top/bottom and one left/right side must be specified at all times.
For example, it is legal to anchor against:
| void OpenGUI::Control::setCursor | ( | CursorPtr | cursorPtr | ) | [protected] |
| void OpenGUI::Control::setDocking | ( | int | dockStyle | ) |
Sets the docking preference for this Control.
Docking is a service provided by the container. It
| void OpenGUI::Control::setHeight | ( | float | height | ) |
Sets the height of the Control.
Controls cannot have a height less than 0.0f, so negative values are clamped to 0.0f.
This function obeys the MinimumSize and MaximumSize properties, and the given size will be adjusted to fit within the constraints if applicable.
| void OpenGUI::Control::setLeft | ( | float | left | ) |
Sets the position of the left side of the Control.
| void OpenGUI::Control::setMargin | ( | float | margin | ) |
| void OpenGUI::Control::setMaximumSize | ( | const FVector2 & | size | ) |
Sets the maximum size this Control will allow itself to be resized to.
During this call the current size is tested against the new maximum size and calls to setWidth and setHeight may be invoked to bring the Controls size back into the allowed constraints.
If the the maximum size is set smaller than the minimum size, the minimum size is adjusted to match the maximum size for any offending axis.
If any axis == 0, that axis will be ignored in size tests. Negative values for an axis are illegal and are automatically assigned to 0.
| void OpenGUI::Control::setMinimumSize | ( | const FVector2 & | size | ) |
Sets the minimum size this Control will allow itself to be resized to.
During this call the current size is tested against the new minimum size and calls to setWidth and setHeight may be invoked to bring the Controls size back into the allowed constraints.
If the the minimum size is set larger than the maximum size, the maximum size is adjusted to match the minimum size for any offending axis.
If any axis == 0, that axis will be ignored in size tests. Negative values for an axis are illegal and are automatically assigned to 0.
| void OpenGUI::Control::setTop | ( | float | top | ) |
Sets the position of the top side of the Control.
| void OpenGUI::Control::setVisible | ( | bool | visible | ) |
Sets the visibility of this Control.
| void OpenGUI::Control::setWidth | ( | float | width | ) |
Sets the width of the Control.
Controls cannot have a width less than 0.0f, so negative values are clamped to 0.0f.
This function obeys the MinimumSize and MaximumSize properties, and the given size will be adjusted to fit within the constraints if applicable.