This is the Guiliani base class all controls are derived from. More...
#include <GUIObject.h>
Public Types | |
enum | FourWayFocus_t { FOCUS_LEFT, FOCUS_RIGHT, FOCUS_UP, FOCUS_DOWN } |
Public Member Functions | |
CGUIObject (CGUICompositeObject *const pParent, const eC_Value &vX, const eC_Value &vY, const eC_Value &vWidth, const eC_Value &vHeight, const ObjectHandle_t &eID=NO_HANDLE) | |
CGUIObject (CGUICompositeObject *const pParent, const CGUIRect &kRect, const ObjectHandle_t &eID=NO_HANDLE) | |
CGUIObject () | |
CGUIObject (const CGUIObject &kSource) | |
virtual | ~CGUIObject () |
void | AddValueObserver (CGUIObserver *pObserver) |
eC_Bool | CalculateInvalidatedRect (CGUIRect &rRect) const |
virtual eC_Bool | ClaimFocus () |
virtual void | CreateSnapshot (eC_UInt uiBackColor=0x00) |
eC_Bool | DataPoolConnectorExists () const |
void | DeleteSnapshot () |
virtual void | DisableSnapshotDrawing (eC_Bool bDeleteSnapshot=true) |
virtual eC_Bool | DoDraw () |
virtual eC_Bool | DoDrawSnapshot () |
virtual void | EnableSnapshotDrawing () |
virtual CGUIObject * | FindObject (const eC_Value &vAbsX, const eC_Value &vAbsY) |
virtual eC_Bool | FocusAny () |
virtual eC_Bool | FocusNext (CGUIObject *const pRefObj=NULL, const eC_Bool &bSubTreeOfRefObjDone=false) |
virtual eC_Bool | FocusPrevious (CGUIObject *const pRefObj=NULL, const eC_Bool &bSubTreeOfRefObjDone=false) |
CGUIRect | GetAbsRect () const |
eC_Value | GetAbsXPos () const |
eC_Value | GetAbsXPosCenter () const |
eC_Value | GetAbsXPosREdge () const |
eC_Value | GetAbsYPos () const |
eC_Value | GetAbsYPosBEdge () const |
eC_Value | GetAbsYPosCenter () const |
eC_UByte | GetAlpha () const |
CGUIBehaviourDecorator * | GetBehaviour () |
const CGUIBehaviourDecorator * | GetBehaviour () const |
GUIBitmapPlaneID_t | GetBitmapID () const |
CGUIBitmapPlane & | GetBitmapPlane () const |
CGUIRect | GetCurrentAbsRect () const |
eC_Value | GetCurrentAbsXPos () const |
eC_Value | GetCurrentAbsXPosCenter () const |
eC_Value | GetCurrentAbsXPosREdge () const |
eC_Value | GetCurrentAbsYPos () const |
eC_Value | GetCurrentAbsYPosBEdge () const |
eC_Value | GetCurrentAbsYPosCenter () const |
CDataPoolConnector & | GetDataPoolConnector () |
eC_Value | GetDistanceBottom () const |
eC_Value | GetDistanceRight () const |
eC_Value | GetHalfHeight () const |
eC_Value | GetHalfWidth () const |
eC_Value | GetHeight () const |
ObjectHandle_t | GetID () const |
CGUILayouter * | GetLayouter () |
const CGUILayouter * | GetLayouter () const |
ObjectHandle_t | GetNeighborBottomID () const |
ObjectHandle_t | GetNeighborLeftID () const |
ObjectHandle_t | GetNeighborRightID () const |
ObjectHandle_t | GetNeighborTopID () const |
CGUIObject * | GetObjectByID (const ObjectHandle_t &eID, const eC_Bool &bOnlyVisible=false) |
const CGUIObject * | GetObjectByID (const ObjectHandle_t &eID, const eC_Bool &bOnlyVisible=false) const |
CGUIRect | GetOriginRect () const |
CGUICompositeObject * | GetParent () |
const CGUICompositeObject * | GetParent () const |
CGUIRect | GetRelRect () const |
eC_Value | GetRelXPos () const |
eC_Value | GetRelXPosCenter () const |
eC_Value | GetRelXPosREdge () const |
eC_Value | GetRelYPos () const |
eC_Value | GetRelYPosBEdge () const |
eC_Value | GetRelYPosCenter () const |
eC_Value | GetWidth () const |
void | InvalidateArea () |
eC_Bool | IsClickable () const |
eC_Bool | IsClickThrough () const |
virtual eC_Bool | IsCompositeObject () const |
eC_Bool | IsDescendantOf (const CGUIObject *const pAncestor) const |
eC_Bool | IsDisabled () const |
eC_Bool | IsDragable () const |
eC_Bool | IsDragged () const |
eC_Bool | IsDrawingSnapshot () const |
eC_Bool | IsFocussable () const |
eC_Bool | IsFocussed () const |
eC_Bool | IsGrayedOut () const |
virtual eC_Bool | IsHighlightable () const |
eC_Bool | IsHighlighted () const |
eC_Bool | IsInvisible () const |
eC_Bool | IsPressed () const |
eC_Bool | IsStopFocus () const |
void | NotifyValueObservers (const CGUIValue &kValue, const eC_UInt uiX=0, const eC_UInt uiY=0) |
CGUIObject & | operator= (const CGUIObject &kSource) |
virtual void | ReadFromStream () |
virtual void | RefreshLayout (CGUILayouter::eMovedEdges_t eMovedEdges) const |
void | RemoveValueObserver (CGUIObserver *pObserver) |
void | RenderToBitmap (eC_UInt uiBitmapID, eC_Value vXOffset=eC_FromInt(0), eC_Value vYOffset=eC_FromInt(0)) |
eC_Bool | RequestFocus () |
void | SetAlpha (eC_UByte ubAlpha) |
void | SetBehaviour (CGUIBehaviourDecorator *pBehaviour) |
void | SetClickThrough (const eC_Bool &bClickThrough) |
virtual void | SetDisabled (const eC_Bool &bDisabled) |
virtual void | SetFocussable (const eC_Bool &bFocussable) |
virtual void | SetGrayedOut (const eC_Bool &bGrayOut) |
virtual void | SetHeight (const eC_Value &vY) |
void | SetID (const ObjectHandle_t &eID) |
virtual void | SetInvisible (const eC_Bool &bInvisible) |
void | SetLayouter (CGUILayouter *pLayouter) |
void | SetNeighborBottomID (const ObjectHandle_t eNewNeighborBottomID) |
void | SetNeighborIDs (const ObjectHandle_t eNewNeighborLeftID, const ObjectHandle_t eNewNeighborRightID, const ObjectHandle_t eNewNeighborTopID, const ObjectHandle_t eNewNeighborBottomID) |
void | SetNeighborLeftID (const ObjectHandle_t eNewNeighborLeftID) |
void | SetNeighborRightID (const ObjectHandle_t eNewNeighborRightID) |
void | SetNeighborTopID (const ObjectHandle_t eNewNeighborTopID) |
virtual void | SetParent (CGUICompositeObject *const pParent) |
void | SetRelRect (const CGUIRect &kNewRect) |
virtual void | SetRelXPos (const eC_Value &vX) |
void | SetRelXPosCenter (const eC_Value &vXCenter) |
void | SetRelXPosREdge (const eC_Value &vX) |
virtual void | SetRelYPos (const eC_Value &vY) |
void | SetRelYPosBEdge (const eC_Value &vY) |
void | SetRelYPosCenter (const eC_Value &vYCenter) |
void | SetStopFocus (const eC_Bool &bDontFocusToParent) |
virtual eC_Bool | SetValue (const CGUIValue &rkValue) |
virtual eC_Bool | SetValue (CDataPoolEntry &rkValue) |
virtual void | SetWidth (const eC_Value &vX) |
virtual void | WriteToStream (const eC_Bool bWriteClassID=false) |
![]() | |
virtual eC_Bool | DoUserEvent (CGUIEvent *const pEvent) |
virtual void | OnCreate () |
virtual void | OnDelete () |
virtual void | OnHide () |
virtual void | OnShow () |
virtual eC_Bool | DoClick (const eC_Value &vAbsX=eC_FromInt(-1), const eC_Value &vAbsY=eC_FromInt(-1)) |
virtual eC_Bool | DoLongClick (const eC_Value &vAbsX=eC_FromInt(-1), const eC_Value &vAbsY=eC_FromInt(-1)) |
virtual eC_Bool | DoDoubleClick (const eC_Value &vAbsX=eC_FromInt(-1), const eC_Value &vAbsY=eC_FromInt(-1)) |
virtual eC_Bool | DoButtonDown (const eC_Value &vAbsX=eC_FromInt(-1), const eC_Value &vAbsY=eC_FromInt(-1)) |
virtual eC_Bool | DoButtonUp (const eC_Value &vAbsX=eC_FromInt(-1), const eC_Value &vAbsY=eC_FromInt(-1)) |
virtual eC_Bool | DoDrag (const eC_Value &vDeltaX=eC_FromInt(-1), const eC_Value &vDeltaY=eC_FromInt(-1), const eC_Value &vAbsX=eC_FromInt(-1), const eC_Value &vAbsY=eC_FromInt(-1)) |
virtual eC_Bool | DoDragEnd (const eC_Value &vAbsX=eC_FromInt(-1), const eC_Value &vAbsY=eC_FromInt(-1)) |
virtual eC_Bool | DoMouseEnter (const eC_Value &vAbsX=eC_FromInt(-1), const eC_Value &vAbsY=eC_FromInt(-1)) |
virtual eC_Bool | DoMouseLeave (const eC_Value &vAbsX=eC_FromInt(-1), const eC_Value &vAbsY=eC_FromInt(-1)) |
virtual eC_Bool | DoMouseMove (const eC_Value &vAbsX=eC_FromInt(-1), const eC_Value &vAbsY=eC_FromInt(-1)) |
virtual void | GetFocus () |
virtual void | LoseFocus () |
virtual eC_Bool | Decrease () |
virtual eC_Bool | Increase () |
virtual eC_Bool | DoKeyDown (const GUIKeyIdentifier_t &eKeyIdentifier, const eC_UInt &uiModifiers) |
virtual eC_Bool | DoKeyUp (const GUIKeyIdentifier_t &eKeyIdentifier, const eC_UInt &uiModifiers) |
virtual eC_Bool | DoChar (const eC_UInt &uiKey, const GUIKeyIdentifier_t &eKeyIdentifier, const eC_UInt &uiModifiers) |
virtual eC_Bool | DoScrollUp (const eC_Value &vAbsX, const eC_Value &vAbsY) |
virtual eC_Bool | DoScrollDown (const eC_Value &vAbsX, const eC_Value &vAbsY) |
virtual eC_Bool | DoScrollLeft (const eC_Value &vAbsX, const eC_Value &vAbsY) |
virtual eC_Bool | DoScrollRight (const eC_Value &vAbsX, const eC_Value &vAbsY) |
![]() | |
const eC_String & | GetXMLTag () const |
void | SetXMLTag (const eC_String &kXMLTag) |
![]() | |
virtual | ~CGUIAnimatable () |
Destructor. Removes all existing animation callbacks. | |
virtual void | DoAnimate (const eC_Value &vTimes=eC_FromInt(1)) |
virtual eC_Bool | IsAnimating () const |
virtual void | StartAnimation () |
virtual void | StopAnimation () |
Static Public Attributes | |
static const eC_Char | XMLTAG_ALPHA [] = "Alpha" |
XML tag to be used writing alpha-value into a stream. | |
static const eC_Char | XMLTAG_CLICKTHROUGH [] = "ClickThrough" |
XML tag to be used writing clickthrough-state into a stream. | |
static const eC_Char | XMLTAG_CONTROLCLASSID [] = "ControlClassID" |
XML tag to be used when writing a control class ID into a stream. | |
static const eC_Char | XMLTAG_DISABLED [] = "Disabled" |
XML tag to be used writing disabled-state into a stream. | |
static const eC_Char | XMLTAG_FOCUSSABLE [] = "Focussable" |
XML tag to be used writing focussable-state into a stream. | |
static const eC_Char | XMLTAG_GRAYEDOUT [] = "GrayedOut" |
XML tag to be used writing grayedout-state into a stream. | |
static const eC_Char | XMLTAG_HEIGHT [] = "Height" |
XML tag to be used writing height into a stream. | |
static const eC_Char | XMLTAG_INVISIBLE [] = "Invisible" |
XML tag to be used writing invisible-state into a stream. | |
static const eC_Char | XMLTAG_OBJECTID [] = "ObjectID" |
XML tag to be used writing object id into a stream. | |
static const eC_Char | XMLTAG_OVERRIDDENNEIGHBORS [] = "OverriddenNeighbors" |
XML tag to be used writing overridden neighbors into a stream. | |
static const eC_Char | XMLTAG_WIDTH [] = "Width" |
XML tag to be used writing width into a stream. | |
static const eC_Char | XMLTAG_XPOS [] = "XPos" |
XML tag to be used writing x-position into a stream. | |
static const eC_Char | XMLTAG_YPOS [] = "YPos" |
XML tag to be used writing y-position into a stream. | |
![]() | |
static const eC_Char | XMLTAG_BEHAVIOURCLASSID [] = "BehaviourClassID" |
XML tag to be used when writing a behaviour class ID into a stream. | |
![]() | |
static const eC_Char | XMLTAG_CLASSVERSION [] = "ClassVersion" |
Protected Member Functions | |
virtual eC_Bool | CreateBitmapPlane () |
virtual eC_Bool | FourWayNext (FourWayFocus_t eFocusDirection) |
![]() | |
eC_UInt | ReadStreamingHeader (const eC_UInt &uiClassVersion, const eC_UInt &uiClassMinVersion=0) const |
void | WriteStreamingFooter (const eC_Bool &bWriteClassID) const |
void | WriteStreamingHeader (const eC_Bool &bWriteClassID, const eC_Char *const pkClassIDTag, const eC_Int &iClassID, const eC_UInt &uiClassVersion) const |
Friends | |
class | CGUI |
class | CGUICompositeObject |
This is the Guiliani base class all controls are derived from.
Additional behavior of specific controls (e.g. the observer feature) can be added by means of multiple inheritance. The position setter methods like SetRelXPos(), and the status setter methods such as SetGrayedOut() are virtual so that there is a possibility for user to overwrite these methods and build special functionalities. An example is that if the user the control changes width of a control and he wants to inform other controls about this change, or if the user wants to prevent the change of the width in the control.
Example:
Used by the four-way focusing functions to specify the direction.
CGUIObject::CGUIObject | ( | CGUICompositeObject *const | pParent, |
const eC_Value & | vX, | ||
const eC_Value & | vY, | ||
const eC_Value & | vWidth, | ||
const eC_Value & | vHeight, | ||
const ObjectHandle_t & | eID = NO_HANDLE |
||
) |
CGUIObject constructor.
pParent | Pointer to the designated parent object. |
vX | X-position relative to its parent object, i.e. the x-offset from the left border of the parent object |
vY | Y-position relative to its parent object, i.e. the y-offset from the upper border of the parent object |
vWidth | Width of the object |
vHeight | Height of the object |
eID | Object identifier of this object (choose NO_HANDLE if none is required). |
CGUIObject::CGUIObject | ( | CGUICompositeObject *const | pParent, |
const CGUIRect & | kRect, | ||
const ObjectHandle_t & | eID = NO_HANDLE |
||
) |
CGUIObject constructor.
pParent | Pointer to the designated parent object. |
kRect | Bounding rectangle of the object, relative to parent. |
eID | Object identifier of this object (choose NO_HANDLE if none is required). |
CGUIObject::CGUIObject | ( | ) |
CGUIObject constructor. The only non-derived class that should call this constructor is GUIStandardFactory. CGUIObject has to read attributes from streaming file by using ReadFromStream() afterwards. Attention: Please DO NOT use this to create a concrete object outside the GUIStandardFactory.
CGUIObject::CGUIObject | ( | const CGUIObject & | kSource | ) |
CGUIObject copy-constructor. Behaviour and Layout are set to NULL, because they cannot be copied.
kSource | Source object to be copied |
|
virtual |
CGUIObject destructor. Any behaviour object, which belongs to this CUGIObject will be DELETED during destruction. This destructor is virtual as we want to delete derived objects by using a base class pointer. Destructors of derived classes will automatically be declared virtual, there is no need to declare such destructor "virtual" explicitly.
eC_Bool CGUIObject::CalculateInvalidatedRect | ( | CGUIRect & | rRect | ) | const |
Intersects the given rect with the rects of all parent objects in the object hierarchy. The invisibility of all parents will be checked as well and returned.
Invalidation only makes sense if all parents are visible, as well as this object!
If the given rect is not the absolute rect of this object, the given rect should be intersected with the absolute rect of this object before this call.
[in,out] | rRect | rect that should be used for calculation; returned will be the calculated invalidation rect |
|
virtual |
Called if the object is requested to lose the focus. It must return False if the object is willing to lose the focus and True otherwise. Please notice that the focus may get moved to another control even if the focused object claims the focus, as the event handler may for example force the focus into a modal dialog.
Reimplemented in CGUIBaseMessageBox.
|
protectedvirtual |
Creates a BitmapPlane for this control. The ID of this BitmapPlane can be accessed via GetBitmapID(). The BitmapPlane can be accessed with GetBitmapPlane(). If SnapshotDrawing is enabled (EnableSnapshotDrawing()), this BitmapPlane is drawn during DoDrawSnapshot(). The method CreateSnapshot() also renders to this BitmapPlane.
|
virtual |
Creates a Snapshot of this control. That means this control will be rendered to its own BitmapPlane. If this Control does not have a BitmapPlane so far, one will be created.
uiBackColor | Color, which will be used as background for the snapshot. By default, it's set to 0x00, but for GfxWrapers which do not support alpha BitmapPlanes another back color maybe needed. |
|
inline |
Indicates whether this object has a DataPoolConnector. This will NOT automatically create one.
void CGUIObject::DeleteSnapshot | ( | ) |
Deletes the BitmapPlane of this GUIObject. This BitmapPlane has been created due to EnableSnapshotDrawing() or by CreateSnapshot.
|
virtual |
Disables SnapshotDrawing. If Snapshotdrawing is disabled, this control will be drawn as usual. By default, the existing BitmapPlane will be deleted.
bDeleteSnapshot | If true the BitmapPlane of this control will be deleted |
|
virtual |
Visualizes the object. It is forbidden to call SetRelXPos, SetRelYPos, SetWidth or SetHeight in DoDraw, i.e., it is not allowed to change the layout.
Reimplemented in CGUITableView, CGUIListBox, CGUICalendar, CGUIBaseInputField, CGUIGraph, CGUIPlot, CGUIMenuBar, CGUIComboBox, CGUIButton, CGUIProgressBar, CGUIMenuItem, CGUIPrimitiveButton, CGUIWheel, CGUISegmentBar, CGUIListItem, CGUISlider, CGUIBaseButton, CGUIClock, CGUITextField, CGUIRadioButton, CGUIBaseTextField, CGUIInputField, CGUIIconButton, CGUIBaseSlider, CGUIChart, CGUIImage, CGUIGauge, CGUIBaseCheckBox, CGUIVideo, CGUILayerContainer, CGUIGroupContainer, CGUIImageStack, CGUIRangeSlider, CGUIEdit, CGUIAnimatedImage, CGUICheckBox, CGUIBlendButton, CGUIGeometryObject, CGUIPageContainer, CGUIFragmentContainer, CGUIWheelContainer, CGUIRadialBar, CGUIBaseRadioButton, CGUIMenuItemSeparator, CGUIMouseCursor, CGUICircularSlider, CGUIKnob, CGUIMenuBase, and CGUIHeaderItem.
|
virtual |
Visualizes the object by drawing its rendered texture.
|
virtual |
Enables SnapshotDrawing. If Snapshotdrawing is enabled, the BitmapPlane of this control will be drawn. Instead of DoDraw(), DoDrawSnapshot() will be called.
|
virtual |
Retrieves a pointer to the object, which has the top most position at the given coordinates. This will be called recursively along the object tree. This method is virtual, so that users are free to implement controls, which have a sensitive area that differs from the actual object's rectangular shape. The standard implementation will check if the given coordinates lie inside of the object's absolute rectangle and return the object's 'this' pointer if yes, and NULL otherwise. Objects that are invisible or that have the 'ClickThrough' attribute set, will not be found and therefore return NULL.
vAbsX | Absolute X coordinate for which the topmost object shall be returned |
vAbsY | Absolute Y coordinate for which the topmost object shall be returned |
Reimplemented in CGUICompositeObject.
|
inlinevirtual |
Set focus to any focusable child object in the subtree of this object, including the object itself
Reimplemented in CGUIListBox, CGUIComboBox, CGUICompositeObject, CGUI, and CGUIMenuBase.
|
virtual |
Set focus to the next focusable child object after the currently focused one. The user should call this function on the currently focused object with no arguments.
pRefObj | Is usually a child of this object which indicates the current position in the child list. |
bSubTreeOfRefObjDone | indicates if the subtree that is under pRefObj has already been asked to take focus, or if not. |
Reimplemented from CGUIBehaviour.
Reimplemented in CGUICompositeObject.
|
virtual |
Set focus to the previous focusable child object before the currently focused one. The user should call this function on the currently focused object with no arguments.
pRefObj | Is usually a child of this object which indicates the current position in the child list. |
bSubTreeOfRefObjDone | indicates if the subtree that is under pRefObj has already been asked to take focus, or if not. |
Reimplemented from CGUIBehaviour.
Reimplemented in CGUICompositeObject.
|
protectedvirtual |
Called when the focus should be set to the next control that is in the given direction of the currently focused object.
eFocusDirection | The focus direction. |
Reimplemented in CGUICompositeObject, CGUIMenuBar, and CGUIMenu.
|
inline |
Returns the bounding rectangle of the object in absolute coordinates. Note that the rectangle will be one pixel higher and wider than the actual object. This is because Guiliani's drawing functions exclude the rightmost and lowermost edge of rectangles. For an CGUIObject on Pos(0;0) with a width of 9 pixels and a height of 9 pixesls this will return a CGUIRect(0,0,9,9);
|
inline |
Returns this object's absolute X-position at the time of the last redraw. Custom controls should tend to call this function in DoDraw() only. The result reflects the visible origin of this object on screen, thus it will not change between redraws.
This function is for example used by the 4-way navigation, which uses the geometric layout of all objects at the time of the last redraw to determine the next object to focus.
If you need to calculate the distance between objects on the screen or similar operations that need absolute coordinates (outside of DoDraw), you may have to use this function but keep in mind, that these reflect the state of this object at the time of the passed redraw.
m_vXPosAbsParent is the sum of all relative positions of all parents at the time of the last redraw and m_vXPosRelVisible is the relative X-coordinate at the time of the last redraw.
|
inline |
Calculates the horizontal center of the object at the time of the last redraw.
|
inline |
Returns the X-position of the object's lower right corner + 1 in screen coordinates (absolute position) at the time of the last redraw. If the function is called in DoDraw() the result will reflect the state of the upcoming redraw. Why + 1 ? Because Guiliani's drawing functions do not draw the last pixel. e.g. FilledRect(0, 0, 10, 10); the rect is drawn from (0,0) to (9,9) (both included) But if you draw a rectangle with (FilledRect(GetAbsXPos(),GetAbsYPos(), GetAbsXPosREdge(), GetAbsYPosBEdge()) then the lower right corner of the object will be drawn, because GetAbsXPosREdge() returns the last pixel +1
|
inline |
Returns this object's absolute Y-position at the time of the last redraw.
|
inline |
Returns the Y-position of the object's lower right corner + 1 in screen coordinates (absolute position) at the time of the last redraw. If the function is called in DoDraw() the result will reflect the state of the upcoming redraw. Why + 1 ? Because Guiliani's drawing functions do not draw the last pixel. e.g. FilledRect(0, 0, 10, 10); the rect is drawn from (0,0) to (9,9) (both included) But if you draw a rectangle with (FilledRect(GetAbsXPos(),GetAbsYPos(), GetAbsXPosREdge(), GetAbsYPosBEdge()) then the lower right corner of the object will be drawn, because GetAbsYPosBEdge() returns the last pixel +1
|
inline |
Calculates the vertical center of the object at the time of the last redraw.
|
inline |
Accessor for the alpha (transparency) value of the object
|
inline |
Returns the pointer to the current behaviour.
|
inline |
Returns the pointer to the current behaviour.
|
inline |
Accessor for the ID of the BitmapPlane of this GUIObject
CGUIBitmapPlane & CGUIObject::GetBitmapPlane | ( | ) | const |
Accessor for the BitmapPlane of this GUIObject
CGUIRect CGUIObject::GetCurrentAbsRect | ( | ) | const |
Get the current absolute bounding rectangle of this object, recalculated from the current relative positions of all its parents.
eC_Value CGUIObject::GetCurrentAbsXPos | ( | ) | const |
Get the current absolute X position of this object, recalculated from the relative positions of all parents. Be aware: If relative X coordinates of any parents of the reference object change then the position returned by this function will most likely also change, because it is the sum of the current relative X positions of all its parents.
|
inline |
Calculates the current horizontal center of the object. Be aware: If relative X coordinates of any parents of the reference object change then the position returned by this function will most likely also change, because it is based on the sum of the current relative X positions of all its parents.
|
inline |
Get the current absolute X position of the right edge of this object, recalculated from the current relative positions of all its parents. Be aware: If relative X coordinates of any parents of the reference object change then the position returned by this function will most likely also change, because it is based on the sum of the current relative X positions of all its parents.
eC_Value CGUIObject::GetCurrentAbsYPos | ( | ) | const |
Get the current absolute Y position of this object, recalculated from the relative positions of all parents. Be aware: If relative Y coordinates of any parents of the reference object change then the position returned by this function will most likely also change, because it is the sum of the current relative Y positions of all its parents.
|
inline |
Get the current absolute Y position of the bottom edge of this object, recalculated from the current relative positions of all its parents. Be aware: If relative Y coordinates of any parents of the reference object change then the position returned by this function will most likely also change, because it is based on the sum of the current relative Y positions of all its parents.
|
inline |
Calculates the current vertical center of the object. Be aware: If relative Y coordinates of any parents of the reference object change then the position returned by this function will most likely also change, because it is based on the sum of the current relative Y positions of all its parents.
CDataPoolConnector & CGUIObject::GetDataPoolConnector | ( | ) |
Returns this object's DataPoolConnector and creates it, if it did not previously exist.
eC_Value CGUIObject::GetDistanceBottom | ( | ) | const |
Returns the distance from this object's bottom edge to the parent's bottom edge. If the parent pointer is NULL it will just return 0 in the release build and in the debug build an assertion is violated additionally.
eC_Value CGUIObject::GetDistanceRight | ( | ) | const |
Returns the distance from this object's right edge to the parent's right edge. If the parent pointer is NULL it will just return 0 in the release build and in the debug build an assertion is violated additionally.
|
inline |
Calculates the current vertical center of the object relative to itself.
|
inline |
Calculates the current horizontal center of the object relative to itself.
|
inline |
Returns this object's current height.
|
inline |
Gets the ID of the object.
|
inline |
Returns the pointer to the current layouter.
|
inline |
Returns a const pointer to the current layouter.
|
inline |
Used by the 4-way focusing algorithm.
|
inline |
Used by the 4-way focusing algorithm.
|
inline |
Used by the 4-way focusing algorithm.
|
inline |
Used by the 4-way focusing algorithm.
|
inline |
Searches for an object by its ID.
There is another implementation of the same method with a slightly different signature, GetObjectByID(const ObjectHandle_t&) const. The compiler will choose the appropriate method depending on what return type the caller expects.
eID | ID of the object for which to search. |
bOnlyVisible | ignore elements which are not currently visible |
const CGUIObject * CGUIObject::GetObjectByID | ( | const ObjectHandle_t & | eID, |
const eC_Bool & | bOnlyVisible = false |
||
) | const |
Searches for an object by its ID.
There is another implementation of the same method with a slightly different signature, GetObjectByID(). The compiler will choose the appropriate method depending on what return type the caller expects.
eID | ID of the object for which to search. |
bOnlyVisible | ignore elements which are not currently visible |
|
inline |
Returns a copy of the bounding rectangle of this object as if it would be placed at the origin.
|
inline |
Returns a pointer to this object's parent object.
There is another implementation of the same method with a slightly different signature, GetParent() const. The compiler will choose the appropriate method depending on what return type the caller expects.
|
inline |
Returns a pointer to this object's parent object.
There is another implementation of the same method with a slightly different signature, GetParent(). The compiler will choose the appropriate method depending on what return type the caller expects.
|
inline |
Returns a copy of the bounding rectangle of this object in coordinates that are relative to the parent object.
|
inline |
Returns this object's current relative X-position.
|
inline |
Calculates the current horizontal center of the object relative to the parent.
|
inline |
Returns this object's current relative X-position of the object's lower right corner + 1. This position is relative to parent's origin.
|
inline |
Returns this object's current relative Y-position.
|
inline |
Returns this object's current relative Y-position of the object's lower right corner + 1. This position is relative to parent's origin.
|
inline |
Calculates the current vertical center of the object relative to the parent.
|
inline |
Returns this object's current width.
void CGUIObject::InvalidateArea | ( | ) |
Invalidates the area covered by this object, thus causing DoDraw() to be called during the GUI's next redraw. If the object is invisible, this method does not invalidate anything.
eC_Bool CGUIObject::IsClickable | ( | ) | const |
This method checks if an object is able to be clicked. This refers to whether it can be clicked with the mouse/keyboard via the event handler. If true the event handler may call DoClick or DoDoubleClick of this object.
|
inline |
|
inlinevirtual |
Checks if a control is derived from CGUICompositeObject or if it is just derived from CGUIObject. Thus, this function should not be overridden by any other class than CGUICompositeObject but may be called by user code.
Reimplemented in CGUICompositeObject.
eC_Bool CGUIObject::IsDescendantOf | ( | const CGUIObject *const | pAncestor | ) | const |
This method checks if a given object is an ancestor of this object
pAncestor | Pointer to object of which this might be a descendant |
|
inline |
Checks if the disabled object state is set. By default, if an object is disabled then it will never get the focus and is not clickable. DoClick() and RequestFocus() will not be called on disabled objects.
eC_Bool CGUIObject::IsDragable | ( | ) | const |
This method checks if an object is able to be dragged. This refers to whether it can be dragged with the mouse/keyboard via the event handler. If true, the event handler may call DoDrag of this object.
eC_Bool CGUIObject::IsDragged | ( | ) | const |
Checks if the object is currently being dragged.
|
inline |
Accessor for the Snapshot-Draw-Status.
eC_Bool CGUIObject::IsFocussable | ( | ) | const |
This method checks if an object is focusable. This refers to whether it can be focused with the mouse/keyboard via functions like FocusNext().
eC_Bool CGUIObject::IsFocussed | ( | ) | const |
Checks if the object is the one which is in focus.
|
inline |
Checks if the grayed out object state is set. By default, if an object is grayed out it will be displayed with a different visual shape than usual in order to give the user a hint that it will never be clickable or highlighted but may be dragged if it supports dragging.
|
virtual |
This method checks if an object is highlightable. This refers to whether it can be highlighted via the event handler. If true the event handler may mark this object as the currently highlighted one. Thus, there is no special flag in CGUIObject that determines if an object is highlightable. The default determination is that the control is in none of the following states:
Reimplemented in CGUIGraph, CGUIPlot, CGUIGauge, CGUIProgressBar, CGUIWheel, CGUISegmentBar, CGUIClock, CGUIChart, CGUIImage, CGUICarousel, CGUIVideo, CGUIEdit, CGUIRangeSlider, CGUIGeometryObject, CGUIRadialProgressBar, CGUIKnob, and CGUICalendar.
eC_Bool CGUIObject::IsHighlighted | ( | ) | const |
Checks if the object is being highlighted.
|
inline |
Checks if the invisible object state is set. If an object is invisible it will not be drawn, i.e., its DoDraw() will not be called.
eC_Bool CGUIObject::IsPressed | ( | ) | const |
Checks if the object is currently being pressed.
|
inline |
Checks if the parent object may be asked to get focus via FocusNext() and FocusPrevious(). The flag that is returned alters the algorithm used to search in the creation tree.
|
inline |
Notifies all observing DataPoolEntries of this object's DataPoolConnector that it's value has changed
kValue | The new value |
uiX | X-Index within the DataPoolEntries at which to set the new Value |
uiY | Y-Index within the DataPoolEntries at which to set the new Value |
CGUIObject & CGUIObject::operator= | ( | const CGUIObject & | kSource | ) |
CGUIObject operator= to copy the whole CGUIObject. Behaviour and Layout are set to NULL, because they cannot be copied.
kSource | Source object to be copied |
|
virtual |
Reads all object attributes from streaming file. Only for use with GUIFactory. GUIStreamingFileReader has to be set in CGUI::Init().
Reimplemented from CGUIStreamableObject.
Reimplemented in CGUIChart, CGUIComboBox, CGUIClock, CGUIMultiLineEdit, CGUIListBox, CGUIBaseInputField, CGUIProgressBar, CGUIEdit, CGUIWheel, CGUITabContainer, CGUIGraph, CGUIScrollView, CGUIKeyboard, CGUIAbstractBar, CGUICarousel, CGUITableView, CGUIPlot, CGUIImageStack, CGUIKnob, CGUIIconButton, CGUIBaseTextField, CGUIMenuBar, CGUIGauge, CGUIPrimitiveButton, CGUIAnimatedImage, CGUIWheelContainer, CGUITouchScrollView, CGUICircularSlider, CGUITabItem, CGUIButton, CGUIExpandingComposite, CGUIMenuItem, CGUITextField, CGUIBaseCheckBox, CGUIScrollBar, CGUIListItem, CGUICenterFocusContainer, CGUISegmentBar, CGUIScrollingTextField, CGUIBaseMessageBox, CGUIGroupContainer, CGUIBaseButton, CGUISlider, CGUIRadioButtonGroup, CGUIBaseSlider, CGUICheckBox, CGUIInputField, CGUIRadialBar, CGUIVideo, CGUIImage, CGUIBlendButton, CGUIRepositionCompositeObject, CGUIFragmentContainer, CGUIPageContainer, CGUILayerContainer, CGUICompositeObject, CGUIMenu, CGUIRangeSlider, CGUIBaseRadioButton, CGUIRadioButton, CGUIRadialSlider, CGUITabClientArea, CGUIGeometryObject, CGUIRadialProgressBar, CGUIComboBoxHeader, CGUIMenuItemSeparator, CGUITextContainer, CGUIMenuBase, CGUICalendar, and CGUISplitContainer.
|
virtual |
Recalculates the object's layout.
eMovedEdges | This indicates in which direction the distance to the parent object's borders has changed (Only relevant for layouters, which depend on their parent object's size, such as CGUILayouterAnchor) |
Reimplemented in CGUICompositeObject.
|
inline |
Unsubscribe an observer that subscribed as value observer.
pObserver | The Observer that wants to unsubscribe. |
void CGUIObject::RenderToBitmap | ( | eC_UInt | uiBitmapID, |
eC_Value | vXOffset = eC_FromInt(0) , |
||
eC_Value | vYOffset = eC_FromInt(0) |
||
) |
Renders this GUIObject into the bitmapPlane with given ID and the given X and Y Offset.
uiBitmapID | ID of the BitmapPlane in which this control should be drawn. |
vXOffset | Draw offset in x direction. Drawing of this control starts at position vXOffset |
vYOffset | Draw offset in y direction. Drawing of this control starts at position vYOffset |
eC_Bool CGUIObject::RequestFocus | ( | ) |
This method requests the focus for the current object. It will only receive the focus, if the currently focused object is willing to release it.
void CGUIObject::SetAlpha | ( | eC_UByte | ubAlpha | ) |
Sets the alpha (transparency) value of the object
ubAlpha | Value in the range of 0 (transparent) to 255 (opaque) |
void CGUIObject::SetBehaviour | ( | CGUIBehaviourDecorator * | pBehaviour | ) |
Attaches the supplied behaviour to this object.
pBehaviour | Pointer to CGUIBehaviourDecorator object which is to be appended |
|
inline |
Set m_bClickThrough to a new value. This specifies whether this object can be clicked. Else clicks will go right through it and are thereby forwarded to an object lying under it (in z-order). The typical use case for this flag is to pass click events to a brother of this object when this and the brother object overlap and the overlapped part of the brother is below this object. Attention: This attribute is not streamed
bClickThrough | the new value |
|
virtual |
Set the object's status to disabled (true) or not disabled (false). Does not influence the appearance of the control. Therefore, the control will not be drawn again after changing this flag.
bDisabled | Boolean value indicating the new state. |
Reimplemented in CGUIComboBox, and CGUICompositeObject.
|
virtual |
Set the object's state to focusable (true) or not focusable (false).
bFocussable | Boolean value indicating the new state. |
Reimplemented in CGUICompositeObject.
|
virtual |
Set the object's status to grayed out (true) or not grayed out (false).
bGrayOut | Boolean value indicating the new state. |
Reimplemented in CGUIComboBox, CGUICompositeObject, and CGUIPrimitiveButton.
|
virtual |
Sets this object's height to a new value.
vY | the new height |
Reimplemented in CGUIComboBox, CGUIProgressBar, CGUITableView, CGUIListBox, CGUITabContainer, CGUIBaseButton, CGUIBaseTextField, CGUIWheel, CGUIEdit, CGUIBaseInputField, CGUIBaseSlider, CGUIChart, CGUIScrollView, CGUISegmentBar, CGUICompositeObject, CGUICarousel, CGUIPageContainer, CGUIComboBoxHeader, CGUIWheelContainer, CGUIRangeSlider, CGUIFragmentContainer, CGUIRadialProgressBar, CGUIRadialSlider, CGUIExpandingComposite, CGUICalendar, CGUISplitContainer, and CGUIPlot.
|
inline |
Sets the ID of the object.
eID | Object ID to set |
|
virtual |
Set the object's status to invisible (true) or not invisible (false).
bInvisible | Boolean value indicating the new state. |
Reimplemented in CGUICompositeObject, and CGUILayerContainer.
void CGUIObject::SetLayouter | ( | CGUILayouter * | pLayouter | ) |
Sets the layouter for this object. Attention: This will delete any other layouter which is currently attached to this object.
pLayouter | Pointer to CGUILayouter instance, which will be attached to this object |
|
inline |
Sets the bottom neighbor, that is used by the 4-way focusing algorithm.
eNewNeighborBottomID | The ID of the object to the bottom ('south') of this object. |
|
inline |
Sets all neighbors, that are used by the 4-way focusing algorithm.
eNewNeighborLeftID | The ID of the object to the left ('west') of this object. |
eNewNeighborRightID | The ID of the object to the right ('east') of this object. |
eNewNeighborTopID | The ID of the object to the top ('north') of this object. |
eNewNeighborBottomID | The ID of the object to the bottom ('south') of this object. |
|
inline |
Sets the left neighbor, that is used by the 4-way focusing algorithm.
eNewNeighborLeftID | The ID of the object to the left ('west') of this object. |
|
inline |
Sets the right neighbor, that is used by the 4-way focusing algorithm.
eNewNeighborRightID | The ID of the object to the right ('east') of this object. |
|
inline |
Sets the top neighbor, that is used by the 4-way focusing algorithm.
eNewNeighborTopID | The ID of the object to the top ('north') of this object. |
|
virtual |
Assign this object to a different parent. This will automatically remove it from the current parent's childlist, and append it to the new parent.
pParent | Pointer to new parent object |
Reimplemented in CGUIListItem.
|
inline |
Sets the bounding rectangle of the object in coordinates that are relative to the parent object.
kNewRect | Rectangle describing the new size and position of the object in relative coordinates |
|
virtual |
Sets this object's current relative X-position.
vX | The position |
|
inline |
Sets this object's current relative X-position of the object's center to the given X-position 'vXCenter' by modifying X-position of the object accordingly. These positions are relative to parent's origin.
vXCenter | The position |
|
inline |
Sets this object's current relative X-position of the object's lower right corner + 1 to the given X-position 'vX' by modifying X-position of the object accordingly. These positions are relative to parent's origin.
vX | The position |
|
virtual |
Sets this object's current relative Y-position.
vY | The position |
|
inline |
Sets this object's current relative Y-position of the object's lower right corner + 1 to the given Y-position 'vY' by modifying Y-position of the object accordingly. These positions are relative to parent's origin.
vY | The position |
|
inline |
Sets this object's current relative Y-position of the object's center to the given Y-position 'vYCenter' by modifying Y-position of the object accordingly. These positions are relative to parent's origin.
vYCenter | The position |
|
inline |
Prevents the object from moving the focus upwards in the GUI Object tree. Setting the StopFocus flag for a CompositeObject will prevent the focus from moving out of this CompositeObject once it is inside.
bDontFocusToParent | TRUE if the focus is not allowed to leave this object. |
|
inlinevirtual |
Generic interface for setting object values. The SetValue() API enables you to forward any data of type CGUIValue to any object. How this value finally gets interpreted is up to the receiving object's implementation.
This concept is particularly useful for linking GUI-objects to an external data source. You can for instance forward an integer value as a CGUIValue object to a GUIObject without the need to know whether it is a CGUITextField, or a CGUIProgressBar, or something completely different. The receiving object will interpret the value in the most sensible way. In the given example the integer will be displayed as a string in the Textfield, while it will cause the ProgressBar to fill up to the respective value.
rkValue | DataPoolEntry containing the value to be handed over to the object on which SetValue was called. |
Reimplemented in CGUIClock, CGUIKnob, CGUIWheel, CGUICircularSlider, CGUIBaseButton, CGUIBaseTextField, CGUIComboBox, CGUIBaseInputField, CGUIBaseCheckBox, CGUIImageStack, CGUICarousel, CGUIPageContainer, CGUIAnimatedImage, CGUIWheelContainer, CGUIRadialSlider, CGUIScrollBar, CGUIRangeSlider, CGUIRadioButtonGroup, and CGUIAbstractBar.
|
inlinevirtual |
Generic interface used by the DataPool for setting values in GUIObjects. By default, this maps directly onto the SetValue() API dealing with a single CGUIValue.
rkValue | Reference to the DataPoolEntry used for retrieving the value(s) |
Reimplemented in CGUIChart, and CGUIComboBox.
|
virtual |
Sets this object's width to a new value.
vX | the new width |
Reimplemented in CGUIComboBox, CGUIProgressBar, CGUITableView, CGUIListBox, CGUITabContainer, CGUIBaseButton, CGUIBaseTextField, CGUIWheel, CGUIEdit, CGUIBaseInputField, CGUIBaseSlider, CGUIChart, CGUIScrollView, CGUISegmentBar, CGUICompositeObject, CGUICarousel, CGUIPageContainer, CGUIComboBoxHeader, CGUIWheelContainer, CGUIRangeSlider, CGUIFragmentContainer, CGUIRadialProgressBar, CGUIExpandingComposite, CGUIRadialSlider, CGUICalendar, CGUISplitContainer, and CGUIPlot.
|
virtual |
Writes all object attributes to the streaming file. StreamWriter has to be initialized. Only for use with GUIStreamWriter.
bWriteClassID | This flag is used to select if writing of ControlID, leading and trailing tags is performed. Only GUIStreamWriter and GUICompositeObject have to set this flag true. |
Reimplemented from CGUIStreamableObject.
Reimplemented in CGUIChart, CGUIComboBox, CGUIClock, CGUIMultiLineEdit, CGUIListBox, CGUIBaseInputField, CGUIProgressBar, CGUIEdit, CGUIWheel, CGUITabContainer, CGUIGraph, CGUIScrollView, CGUIKeyboard, CGUITableView, CGUIPlot, CGUIAbstractBar, CGUICarousel, CGUIImageStack, CGUIKnob, CGUIIconButton, CGUIBaseTextField, CGUIMenuBar, CGUIGauge, CGUIPrimitiveButton, CGUIWheelContainer, CGUIAnimatedImage, CGUITouchScrollView, CGUICircularSlider, CGUITabItem, CGUIButton, CGUIExpandingComposite, CGUIMenuItem, CGUITextField, CGUIBaseCheckBox, CGUIScrollBar, CGUISegmentBar, CGUIListItem, CGUIScrollingTextField, CGUICenterFocusContainer, CGUIBaseMessageBox, CGUIGroupContainer, CGUIBaseButton, CGUIRadioButtonGroup, CGUISlider, CGUICheckBox, CGUIBaseSlider, CGUIInputField, CGUIRadialBar, CGUIVideo, CGUIImage, CGUIBlendButton, CGUIRepositionCompositeObject, CGUIFragmentContainer, CGUIPageContainer, CGUILayerContainer, CGUICompositeObject, CGUIMenu, CGUIRangeSlider, CGUIBaseRadioButton, CGUIRadioButton, CGUIRadialSlider, CGUITabClientArea, CGUIGeometryObject, CGUIRadialProgressBar, CGUIComboBoxHeader, CGUIMenuItemSeparator, CGUITextContainer, CGUIMenuBase, CGUICalendar, and CGUISplitContainer.
|
friend |
|
friend |
CompositeObject's HandleDraw() should be able to update the absolute coordinates before DoDraw() is called. No derived class should manipulate absolute coordinates as they are recalculated automatically by the framework.
Also CGUIObject::FourWayNext() will be called by CompositeObject's FourWayNext() and CGUI's FourWayFocusNext()