#include <OpenGUI_Widget.h>
Inheritance diagram for OpenGUI::Widget:

Public Member Functions | |
| Widget () | |
| public constructor | |
| virtual | ~Widget () |
| public destructor | |
| const String & | getName () |
| returns the name of this Widget | |
| void | setName (const String &name) |
| sets the name of this Widget | |
| bool | getEnabled () |
| returns the enabled/disabled state of this Widget | |
| void | setEnabled (bool value) |
| sets the enabled/disabled state of this Widget | |
| void | invalidate () |
| invalidate any caches of this Widget's render output | |
| void | flush () |
| invalidate this Widget, as well as any and all potential children | |
| virtual void | _doflush () |
| Needs to be overridden by container widgets to invalidate self and call _doFlush() for all children. | |
| WidgetCollection * | getContainer () const |
| returns the collection this widget is held within | |
| void | getChildrenAt (const FVector2 &position, WidgetPtrList &outList, bool recursive=false) |
Fills the given outList with pointers to all child Widgets that are under the given position. | |
| Widget * | getChildAt (const FVector2 &position, bool recursive=false) |
Returns a pointer to the top-most child at the given position. Returns 0 if no child is found at the position. | |
| Widget * | getPath (const String &path) const |
| Returns a pointer to the widget at the given path, 0 if no widget is found. | |
| FVector2 | pointToScreen (const FVector2 &local_point) |
| Translates the given point from coordinates local to this Widget into Screen level coordinates. | |
| FVector2 | pointFromScreen (const FVector2 &screen_point) |
| Translates the given point from Screen level coordinates into coordinates local to this Widget. | |
| 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. | |
| bool | hasCursorFocus () |
Returns true if this Widget has cursor focus within its Screen. | |
| bool | hasKeyFocus () |
Returns true if this Widget has key focus within its Screen. | |
| virtual ObjectAccessorList * | getAccessors () |
| returns this object's ObjectAccessorList head | |
| virtual unsigned int | getObjectType () const |
| Returns an integer identifying the type of object. | |
| virtual bool | isInside (const FVector2 &position) |
| Returns true if the given point is inside this Widget. | |
| void | _injectCursorMove (Cursor_EventArgs &moveEvent) |
| Informs this widget of cursor movement. | |
| virtual void | _sendToChildren_CursorMove (Cursor_EventArgs &moveEvent) |
| Should inject the CursorMove event to all children. | |
| void | _injectCursorPress (Cursor_EventArgs &pressEvent) |
| Informs this widget of cursor press. | |
| virtual void | _sendToChildren_CursorPress (Cursor_EventArgs &pressEvent) |
| Should inject the CursorPress event to all children. | |
| void | _injectCursorRelease (Cursor_EventArgs &releaseEvent) |
| Informs this widget of cursor release. | |
| virtual void | _sendToChildren_CursorRelease (Cursor_EventArgs &releaseEvent) |
| Should inject the CursorRelease event to all children. | |
| void | _injectCursorFocused (Widget *next, Widget *prev) |
| Informs this widget of cursor focus acquisition. | |
| void | _injectCursorFocusLost (Widget *next, Widget *prev) |
| Informs this widget of cursor focus loss. | |
| void | _injectKeyDown (Key_EventArgs &evtArgs) |
| Informs this widget of key down. | |
| void | _injectKeyPressed (Key_EventArgs &evtArgs) |
| Informs this widget of key press. | |
| void | _injectKeyUp (Key_EventArgs &evtArgs) |
| Informs this widget of key up. | |
| void | _injectKeyFocused (Widget *next, Widget *prev) |
| Informs this widget of key focus acquisition. | |
| void | _injectKeyFocusLost (Widget *next, Widget *prev) |
| Informs this widget of key focus loss. | |
Protected Member Functions | |
| Screen * | getScreen () const |
| returns the screen that this Widget is attached to, or 0 if not attached | |
| Object * | getParent () const |
| returns a pointer to the parenting Object of this Widget, or 0 if there isn't one | |
| void | grabKeyFocus () |
| grabs focus for this Widget for keyboard events | |
| void | releaseKeyFocus () |
| releases focus for this Widget for keyboard events | |
| void | grabCursorFocus () |
| grabs focus for this Widget for cursor events | |
| void | releaseCursorFocus () |
| releases focus for this Widget for cursor events | |
Event Triggers | |
| void | eventAttached (WidgetCollection *newContainer, Widget *widget) |
| Widget was attached to a container. | |
| void | eventDetached (WidgetCollection *prevContainer, Widget *widget) |
| Widget was removed from a container. | |
| void | eventDraw (Brush &brush) |
| Draw this object's foreground using the given brush. | |
| void | eventInvalidated () |
| Widget was invalidated and will need to be redrawn next Screen::update(). | |
| void | eventEnabled () |
| Widget's state has changed to Enabled. | |
| void | eventDisabled () |
| Widget's state has changed to Disabled. | |
| bool | eventCursorMoving (float xPos, float yPos) |
| Called for cursor movement before sending to children, giving the X,Y position of the cursor. | |
| bool | eventCursorMove (float xPos, float yPos) |
| Called for cursor movement, giving the X,Y position of the cursor. | |
| bool | eventCursorPressing (float xPos, float yPos) |
| Called for cursor press before sending to children, giving the X,Y position of the cursor. | |
| bool | eventCursorPress (float xPos, float yPos) |
| Called when the cursor button is pressed. | |
| bool | eventCursorReleasing (float xPos, float yPos) |
| Called for cursor release before sending to children, giving the X,Y position of the cursor. | |
| bool | eventCursorRelease (float xPos, float yPos) |
| Called when the cursor button is released. | |
| void | eventCursorEnter () |
| Called when the cursor enters this Control. | |
| void | eventCursorLeave () |
| Called when the cursor leaves this Control. | |
| void | eventCursorFocused (Widget *cur, Widget *prev) |
| Called then this widget receives cursor focus. | |
| void | eventCursorFocusLost (Widget *cur, Widget *prev) |
| Called then this widget loses cursor focus. | |
| bool | eventKeyUp (char character) |
Called when the given character is released. | |
| bool | eventKeyDown (char character) |
Called when the given character is pressed down. | |
| bool | eventKeyPressed (char character) |
Called when the given character is entered. | |
| void | eventKeyFocused (Widget *cur, Widget *prev) |
| Called then this widget receives key focus. | |
| void | eventKeyFocusLost (Widget *cur, Widget *prev) |
| Called then this widget loses key focus. | |
| void | eventTick (float seconds) |
| Called when the passage of time has been measured. | |
Event Handlers | |
| virtual void | onAttached (Object *sender, Attach_EventArgs &evtArgs) |
| "Attached" event | |
| virtual void | onDetached (Object *sender, Attach_EventArgs &evtArgs) |
| "Detached" event | |
| virtual void | onDraw (Object *sender, Draw_EventArgs &evtArgs) |
| "Draw" event | |
| virtual void | onInvalidated (Object *sender, EventArgs &evtArgs) |
| "Invalidated" event | |
| virtual void | onEnabled (Object *sender, EventArgs &evtArgs) |
| "Enabled" event | |
| virtual void | onDisabled (Object *sender, EventArgs &evtArgs) |
| "Disabled" event | |
| virtual void | onCursorMoving (Object *sender, Cursor_EventArgs &evtArgs) |
| "CursorMoving" event | |
| virtual void | onCursorMove (Object *sender, Cursor_EventArgs &evtArgs) |
| "CursorMove" event | |
| virtual void | onCursorPressing (Object *sender, Cursor_EventArgs &evtArgs) |
| "CursorPressing" event | |
| virtual void | onCursorPress (Object *sender, Cursor_EventArgs &evtArgs) |
| "CursorPress" event | |
| virtual void | onCursorReleasing (Object *sender, Cursor_EventArgs &evtArgs) |
| "CursorReleasing" event | |
| virtual void | onCursorRelease (Object *sender, Cursor_EventArgs &evtArgs) |
| "CursorRelease" event | |
| virtual void | onCursorEnter (Object *sender, EventArgs &evtArgs) |
| "CursorEnter" event | |
| virtual void | onCursorLeave (Object *sender, EventArgs &evtArgs) |
| "CursorLeave" event | |
| virtual void | onCursorFocused (Object *sender, Focus_EventArgs &evtArgs) |
| "CursorFocused" event | |
| virtual void | onCursorFocusLost (Object *sender, Focus_EventArgs &evtArgs) |
| "CursorFocusLost" event | |
| virtual void | onKeyUp (Object *sender, Key_EventArgs &evtArgs) |
| "Key_Up" event | |
| virtual void | onKeyDown (Object *sender, Key_EventArgs &evtArgs) |
| "Key_Down" event | |
| virtual void | onKeyPressed (Object *sender, Key_EventArgs &evtArgs) |
| "Key_Pressed" event | |
| virtual void | onKeyFocused (Object *sender, Focus_EventArgs &evtArgs) |
| "Key_Focused" event | |
| virtual void | onKeyFocusLost (Object *sender, Focus_EventArgs &evtArgs) |
| "Key_FocusLost" event | |
| virtual void | onTick (Object *sender, Tick_EventArgs &evtArgs) |
| "Tick" event | |
|
|
public constructor
|
|
|
public destructor
|
|
|
Needs to be overridden by container widgets to invalidate self and call _doFlush() for all children.
Reimplemented in OpenGUI::ContainerControl. |
|
||||||||||||
|
Informs this widget of cursor focus acquisition.
|
|
||||||||||||
|
Informs this widget of cursor focus loss.
|
|
|
Informs this widget of cursor movement.
|
|
|
Informs this widget of cursor press.
|
|
|
Informs this widget of cursor release.
|
|
|
Informs this widget of key down.
|
|
||||||||||||
|
Informs this widget of key focus acquisition.
|
|
||||||||||||
|
Informs this widget of key focus loss.
|
|
|
Informs this widget of key press.
|
|
|
Informs this widget of key up.
|
|
|
Should inject the CursorMove event to all children.
Reimplemented in OpenGUI::ContainerControl. |
|
|
Should inject the CursorPress event to all children.
Reimplemented in OpenGUI::ContainerControl. |
|
|
Should inject the CursorRelease event to all children.
Reimplemented in OpenGUI::ContainerControl. |
|
|
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 in OpenGUI::ContainerControl. |
|
|
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 in OpenGUI::ContainerControl. |
|
||||||||||||
|
Widget was attached to a container.
|
|
|
Called when the cursor enters this Control.
|
|
||||||||||||
|
Called then this widget receives cursor focus.
|
|
||||||||||||
|
Called then this widget loses cursor focus.
|
|
|
Called when the cursor leaves this Control.
|
|
||||||||||||
|
Called for cursor movement, giving the X,Y position of the cursor.
|
|
||||||||||||
|
Called for cursor movement before sending to children, giving the X,Y position of the cursor.
|
|
||||||||||||
|
Called when the cursor button is pressed.
|
|
||||||||||||
|
Called for cursor press before sending to children, giving the X,Y position of the cursor.
|
|
||||||||||||
|
Called when the cursor button is released.
|
|
||||||||||||
|
Called for cursor release before sending to children, giving the X,Y position of the cursor.
|
|
||||||||||||
|
Widget was removed from a container.
|
|
|
Widget's state has changed to Disabled.
|
|
|
Draw this object's foreground using the given brush.
|
|
|
Widget's state has changed to Enabled.
|
|
|
Widget was invalidated and will need to be redrawn next Screen::update().
|
|
|
Called when the given
|
|
||||||||||||
|
Called then this widget receives key focus.
|
|
||||||||||||
|
Called then this widget loses key focus.
|
|
|
Called when the given
|
|
|
Called when the given
|
|
|
Called when the passage of time has been measured.
|
|
|
invalidate this Widget, as well as any and all potential children
|
|
|
returns this object's ObjectAccessorList head
Reimplemented from OpenGUI::Object. Reimplemented in OpenGUI::ContainerControl, OpenGUI::Control, and OpenGUI::Window. |
|
||||||||||||
|
Returns a pointer to the top-most child at the given
|
|
||||||||||||||||
|
Fills the given The list is depth sorted, with top-most widgets at the top and bottom-most widgets at the bottom.
|
|
|
returns the collection this widget is held within Every displayable Widget is guaranteed to have a container. |
|
|
returns the enabled/disabled state of this Widget
|
|
|
returns the name of this Widget
|
|
|
Returns an integer identifying the type of object.
Implements OpenGUI::Object. Reimplemented in OpenGUI::ContainerControl, OpenGUI::Control, and OpenGUI::Window. |
|
|
returns a pointer to the parenting Object of this Widget, or 0 if there isn't one This is a helper function for Widget::getContainer()->WidgetCollection::getParent() with some additional safety checks. |
|
|
Returns a pointer to the widget at the given path, 0 if no widget is found. Widget paths are much like file system paths. They are comprised of Widget names separated by forward slashes ('/'). They provide some common concepts, that are familiar to file system navigation.
|
|
|
returns the screen that this Widget is attached to, or 0 if not attached
|
|
|
grabs focus for this Widget for cursor events You can only grab focus when you are attached to a Screen. Attempts to grab focus when not attached to a screen will cause an exception.
|
|
|
grabs focus for this Widget for keyboard events You can only grab focus when you are attached to a Screen. Attempts to grab focus when not attached to a screen will cause an exception.
|
|
|
Returns
If this Widget is not attached to a Screen, the return value is always |
|
|
Returns
If this Widget is not attached to a Screen, the return value is always |
|
|
invalidate any caches of this Widget's render output This will cause the Widget's Draw routine to be called on the next update of the Screen this Widget is attached to. |
|
|
Returns true if the given point is inside this Widget. This function is intended to be overridden by subclasses to reflect their own personal interpretation of the given point (in local coordinates) and if that point is considered to be inside the widget. This allows new widgets to break free from the existing "axis aligned rect" paradigm that is usually in place.
Reimplemented in OpenGUI::Control. |
|
||||||||||||
|
"Attached" event
|
|
||||||||||||
|
"CursorEnter" event
Reimplemented in OpenGUI::Control. |
|
||||||||||||
|
"CursorFocused" event
Reimplemented in OpenGUI::Window. |
|
||||||||||||
|
"CursorFocusLost" event
Reimplemented in OpenGUI::Window. |
|
||||||||||||
|
"CursorLeave" event
Reimplemented in OpenGUI::Control. |
|
||||||||||||
|
"CursorMove" event
Reimplemented in OpenGUI::ContainerControl, OpenGUI::Control, and OpenGUI::Window. |
|
||||||||||||
|
"CursorMoving" event
|
|
||||||||||||
|
"CursorPress" event
Reimplemented in OpenGUI::ContainerControl, and OpenGUI::Control. |
|
||||||||||||
|
"CursorPressing" event
|
|
||||||||||||
|
"CursorRelease" event
Reimplemented in OpenGUI::ContainerControl, and OpenGUI::Control. |
|
||||||||||||
|
"CursorReleasing" event
|
|
||||||||||||
|
"Detached" event
|
|
||||||||||||
|
"Disabled" event
|
|
||||||||||||
|
"Draw" event
|
|
||||||||||||
|
"Enabled" event
|
|
||||||||||||
|
"Invalidated" event
Reimplemented in OpenGUI::ContainerControl. |
|
||||||||||||
|
"Key_Down" event
|
|
||||||||||||
|
"Key_Focused" event
|
|
||||||||||||
|
"Key_FocusLost" event
|
|
||||||||||||
|
"Key_Pressed" event
|
|
||||||||||||
|
"Key_Up" event
|
|
||||||||||||
|
"Tick" event
|
|
|
Translates the given point from Screen level coordinates into coordinates local to this Widget.
|
|
|
Translates the given point from coordinates local to this Widget into Screen level coordinates.
|
|
|
releases focus for this Widget for cursor events This is automatically performed when a widget is detached from a Screen, which also means that it occurs during widget destruction. Requires attachment to a Screen at time of calling or will have no effect.
|
|
|
releases focus for this Widget for keyboard events This is automatically performed when a widget is detached from a Screen, which also means that it occurs during widget destruction. Requires attachment to a Screen at time of calling or will have no effect.
|
|
|
sets the enabled/disabled state of this Widget
|
|
|
sets the name of this Widget
|