#include <OpenGUI_ContainerControl.h>
Inheritance diagram for OpenGUI::ContainerControl:

In addition to simply being a Control that contains child Controls, this Widget also supplies an automatic layout system that will reposition and resize child controls according to their exposed layout preferences. Additionally, the results of draw operations from this object, as well as its children, are cached by this object to provide speed increases.
Public Member Functions | |
| ContainerControl () | |
| public constructor | |
| virtual | ~ContainerControl () |
| public destructor | |
| void | setPadding (float padding) |
| sets the padding of this container | |
| float | getPadding () |
| gets the current padding of this container | |
| void | setConsumeInput (bool consume) |
toggles auto consumption of input that occurs inside this container, preventing it from reaching overdrawn widgets. Default is TRUE | |
| bool | getConsumeInput () |
| retrieves current ConsumeInput setting | |
| void | suspendLayout () |
| suspends automatic layout updates until resumeLayout() is called | |
| void | resumeLayout () |
| resumes automatic layout updates and performs an immediate layout update if the current layout is out of date | |
| bool | layoutValid () |
| returns true if the current layout schema is still valid | |
| void | updateLayout () |
| Performs the layout operation for child widgets, marking the new layout as valid. | |
| void | invalidateLayout () |
| Marks the current layout schema as invalid. | |
| virtual ObjectAccessorList * | getAccessors () |
| returns this object's ObjectAccessorList head | |
| virtual unsigned int | getObjectType () const |
| Returns an integer identifying the type of object. | |
| virtual void | _translatePointIn (FVector2 &point) |
| Translate the given point from local coordinates to inside coordinates. | |
| virtual void | _translatePointOut (FVector2 &point) |
| Translate the given point from inside coordinates to local coordinates. | |
| virtual void | _doflush () |
| Needs to be overridden by container widgets to invalidate self and call _doFlush() for all children. | |
| virtual void | _sendToChildren_CursorMove (Cursor_EventArgs &moveEvent) |
| Should inject the CursorMove event to all children. | |
| virtual void | _sendToChildren_CursorPress (Cursor_EventArgs &pressEvent) |
| Should inject the CursorPress event to all children. | |
| virtual void | _sendToChildren_CursorRelease (Cursor_EventArgs &releaseEvent) |
| Should inject the CursorRelease event to all children. | |
Public Attributes | |
| WidgetCollection | Children |
| Collection of child widgets that are contained by this ContainerControl. | |
Protected Member Functions | |
| const FRect & | getClientArea () |
| Returns the client area position and size as an FRect. | |
| virtual void | _doUpdateLayout () |
| This performs the actual layout operation. | |
| void | dirtyCache () |
| flushes the local draw cache. Causes a call to invalidate() automatically | |
| bool | isCacheDirty () const |
returns true if the local cache is dirty | |
| Brush_Caching & | _getCacheBrush () |
| retrieves a Brush reference to the underlying cache. Should only be used within _draw() overloads | |
Event Injectors | |
| void | eventDrawBG (Brush &brush) |
| Draw this object's background using the given brush. | |
| void | eventChildAttached (WidgetCollection *container, Widget *newChild) |
| A new child has been attached to this container. | |
| void | eventChildDetached (WidgetCollection *container, Widget *prevChild) |
| A child has been detached from this container. | |
| void | eventInvalidatedChild () |
| A child of this container has been invalidated. | |
Event Handlers | |
| virtual void | onDrawBG (Object *sender, Draw_EventArgs &evtArgs) |
| "DrawBG" event | |
| virtual void | onChildAttached (Object *sender, Attach_EventArgs &evtArgs) |
| "ChildAttached" event | |
| virtual void | onChildDetached (Object *sender, Attach_EventArgs &evtArgs) |
| "ChildDetached" event | |
| virtual void | onInvalidated (Object *sender, EventArgs &evtArgs) |
| Flushes the local Brush output cache that contains operations from this and all child Widgets. | |
| virtual void | onInvalidatedChild (Object *sender, EventArgs &evtArgs) |
| Invalidates this widget, which causes a flush of the local cache of child operations. | |
| virtual void | onResized (Object *sender, Resized_EventArgs &evtArgs) |
| flushes local Brush cache in addition to normal functionality | |
| virtual void | onCursorMove (Object *sender, Cursor_EventArgs &evtArgs) |
"CursorMove" event, only allows Control to consume if ConsumeInput is true | |
| virtual void | onCursorPress (Object *sender, Cursor_EventArgs &evtArgs) |
"CursorPress" event, only allows Control to consume if ConsumeInput is true | |
| virtual void | onCursorRelease (Object *sender, Cursor_EventArgs &evtArgs) |
"CursorRelease" event, only allows Control to consume if ConsumeInput is true | |
Protected Attributes | |
| FVector2 | m_ClientAreaOffset_UL |
| The client area offset from the upper left of the ContainerControl. | |
| FVector2 | m_ClientAreaOffset_LR |
| The client area offset from the lower right of the ContainerControl. | |
| bool | m_ClipChildren |
| Signifies if this container should clip the output of its children against the defined client area. | |
|
|
public constructor
|
|
|
public destructor
|
|
|
Needs to be overridden by container widgets to invalidate self and call _doFlush() for all children.
Reimplemented from OpenGUI::Widget. |
|
|
This performs the actual layout operation. This is virtual in the case that a subclass wishes to perform their own layout logic. Toolbars and other specialty containers would likely need this functionality. |
|
|
retrieves a Brush reference to the underlying cache. Should only be used within _draw() overloads
|
|
|
Should inject the CursorMove event to all children.
Reimplemented from OpenGUI::Widget. |
|
|
Should inject the CursorPress event to all children.
Reimplemented from OpenGUI::Widget. |
|
|
Should inject the CursorRelease event to all children.
Reimplemented from OpenGUI::Widget. |
|
|
Translate the given point from local coordinates to inside coordinates. This function is intended for overriding should the existing method not produce accurate results. Overriding should only be necessary if the widget has children and displays them in a non-standard fashion (rotated, for example).
This function takes the given
The result of the transform is written back to the given Reimplemented from OpenGUI::Widget. |
|
|
Translate the given point from inside coordinates to local coordinates. This function is intended for overriding should the existing method not produce accurate results. It should produce the inverse result of _translatePointIn()
This function takes the given
The result of the transform is written back to the given Reimplemented from OpenGUI::Widget. |
|
|
flushes the local draw cache. Causes a call to invalidate() automatically
|
|
||||||||||||
|
A new child has been attached to this container.
Implements OpenGUI::WidgetCollectionListener. |
|
||||||||||||
|
A child has been detached from this container.
Implements OpenGUI::WidgetCollectionListener. |
|
|
Draw this object's background using the given brush.
|
|
|
A child of this container has been invalidated.
|
|
|
returns this object's ObjectAccessorList head
Reimplemented from OpenGUI::Control. Reimplemented in OpenGUI::Window. |
|
|
Returns the client area position and size as an FRect.
This is a convenience function that calculates the client area into a rect from the defined offsets |
|
|
retrieves current ConsumeInput setting
|
|
|
Returns an integer identifying the type of object.
Reimplemented from OpenGUI::Control. Reimplemented in OpenGUI::Window. |
|
|
gets the current padding of this container
|
|
|
Marks the current layout schema as invalid. If layout is not suspended, this triggers an immediate update of the layout. This function is protected from re-entry when a layout operation is currently under way. |
|
|
returns
|
|
|
returns true if the current layout schema is still valid
|
|
||||||||||||
|
"ChildAttached" event
|
|
||||||||||||
|
"ChildDetached" event
|
|
||||||||||||
|
"CursorMove" event, only allows Control to consume if ConsumeInput is
Reimplemented from OpenGUI::Control. Reimplemented in OpenGUI::Window. |
|
||||||||||||
|
"CursorPress" event, only allows Control to consume if ConsumeInput is
Reimplemented from OpenGUI::Control. |
|
||||||||||||
|
"CursorRelease" event, only allows Control to consume if ConsumeInput is
Reimplemented from OpenGUI::Control. |
|
||||||||||||
|
"DrawBG" event Default is to do nothing |
|
||||||||||||
|
Flushes the local Brush output cache that contains operations from this and all child Widgets.
Reimplemented from OpenGUI::Widget. |
|
||||||||||||
|
Invalidates this widget, which causes a flush of the local cache of child operations.
|
|
||||||||||||
|
flushes local Brush cache in addition to normal functionality
Reimplemented from OpenGUI::Control. |
|
|
resumes automatic layout updates and performs an immediate layout update if the current layout is out of date
|
|
|
toggles auto consumption of input that occurs inside this container, preventing it from reaching overdrawn widgets. Default is
Changing this value to |
|
|
sets the padding of this container Padding is the distance within the inside of this container to keep children away from the client area edges during auto layout.
The given |
|
|
suspends automatic layout updates until resumeLayout() is called
|
|
|
Performs the layout operation for child widgets, marking the new layout as valid. The update is performed regardless of layout being currently suspended, so only call this if you really want the update to occur. Layout validity, however, is still honored and layouts will not occur unless needed. |
|
|
Collection of child widgets that are contained by this ContainerControl.
|
|
|
The client area offset from the lower right of the ContainerControl.
|
|
|
The client area offset from the upper left of the ContainerControl.
|
|
|
Signifies if this container should clip the output of its children against the defined client area.
It is important to note that children will always be clipped against the rect bounds of the container (either implicitly from a render to texture context, or forcibly by a ClippingRect). This option is merely present to supply an enforced rect clipping of child output in the event that you are not drawing a solid border in the area between the edge of the control and the edge of the client area. The default is |