My Project
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | Friends | List of all members
ParaEngine::CGUIContainer Class Reference

m_objResource->m_objArtwork->DrawingRects[0]: client rectangle; m_objResource->m_objArtwork->DrawingRects[1]: container rectangle, including scrollbars m_objResource->m_objArtwork->DrawingRects[2]: container rectangle, including scrollbars, including borders m_objResource->m_objArtwork->DrawingRects[3-11]: [optional] for nine element containers. More...

#include <GUIContainer.h>

Inheritance diagram for ParaEngine::CGUIContainer:
ParaEngine::CGUIBase ParaEngine::IAttributeFields ParaEngine::IObjectDrag ParaEngine::CPaintDevice ParaEngine::IObject ParaEngine::CRefCounted ParaEngine::CGUIListBox ParaEngine::CGUIPainter ParaEngine::CGUIRoot

Public Types

enum  GUI_POPUP_STYLE { Popup_None =0, Popup_Autohide =1, Popup_Autodelete =2 }
 
- Public Types inherited from ParaEngine::CGUIBase
typedef ParaEngine::weak_ptr< IObject, CGUIBaseWeakPtr_type
 
- Public Types inherited from ParaEngine::IAttributeFields
typedef ParaEngine::weak_ptr< IObject, IAttributeFieldsWeakPtr_type
 
- Public Types inherited from ParaEngine::IObject
typedef ParaEngine::weak_ptr< IObjectWeakPtr_type
 
- Public Types inherited from ParaEngine::CPaintDevice
enum  PaintDeviceMetric { PdmWidth = 1, PdmHeight, PdmDepth }
 

Public Member Functions

 ATTRIBUTE_DEFINE_CLASS (CGUIContainer)
 
virtual int GetChildCount ()
 
virtual GUIBase_List_Type * GetChildren ()
 Gets the control's children. More...
 
virtual CGUIBaseGetChildByID (int nChildID)
 get a child node by its id More...
 
virtual CGUIBaseGetChildByName (const string &name)
 get the first child node whose name is name. More...
 
void AddChild (CGUIBase *pChild, int nIndex=-1)
 add a child object. More...
 
virtual void DestroyChildren ()
 Clear all the control's children.
 
bool SortChildrenByZOrder ()
 Sort children by z-order. More...
 
virtual int GetZOrder () const
 z order affect the order of rendering. More...
 
virtual void SetDepth (float fDepth)
 set the 3D depth. More...
 
void SetKeyFocus (CGUIBase *control)
 Set key focus of this control. More...
 
void SetMouseFocus (CGUIBase *control)
 Set mouse focus of this control. More...
 
virtual CGUIBaseGetKeyFocus ()
 Gets the direct key focus of the current control. More...
 
virtual CGUIBaseGetMouseFocus ()
 Gets the direct mouse focus of the current control. More...
 
int GetScrollType ()
 Get the scroll type of the control. More...
 
void SetScrollType (int etype)
 Set the scroll type of the control. More...
 
virtual bool IsScrollable ()
 return true if it is scrollable. More...
 
void SetScrollable (bool bScrollable)
 set scrollable More...
 
void ResetScrollbar ()
 Reset the scroll bar.
 
virtual CGUIBaseGetObjectAtPoint (int x, int y)
 Gets the direct object at the given point. More...
 
virtual CGUIBaseGetObjectAtPointRecursive (int x, int y)
 Gets the deepest non-click-through object at the given point. More...
 
virtual void Begin (GUIState *pGUIState, float fElapsedTime)
 Render a mask of the container to ensure none of its descendants is rendered outside its boundary. More...
 
virtual HRESULT Render (GUIState *pGUIState, float fElapsedTime)
 Render function of the control. More...
 
virtual void End (GUIState *pGUIState, float fElapsedTime)
 Do some fininsh-ups after render. More...
 
virtual bool OnFocusOut ()
 
void SetFastRender (bool fastrender)
 
bool GetFastRender ()
 
virtual void UpdateScroll (int nXDelta, int nYDelta)
 Tell the container how many items are scrolled in both X and Y direction. More...
 
virtual void UpdateRects ()
 
virtual bool InvalidateRect (const RECT *lpRect)
 adds a rectangle to the specified window's update region. More...
 
void UpdateScrollSize ()
 
virtual void UpdateClientRect (const CGUIPosition &pos, bool unupdate=false)
 this function will update the client rectangle of this object. More...
 
virtual string ToScript (int option=0)
 
virtual void InitObject (const char *strObjectName, const char *alignment, int x, int y, int width, int height)
 
virtual HRESULT RestoreDeviceObjects ()
 
virtual bool MsgProc (MSG *event)
 First, send the message to the scrollbar. More...
 
virtual void NextKeyFocus ()
 
virtual bool ActivateDefaultButton ()
 click the default button inside this container. More...
 
virtual CGUIButtonGetDefaultButton ()
 get the default button inside this container. More...
 
virtual bool ActivateNextEdit (CGUIEditBox *curCtrl=nullptr)
 
virtual CGUIEditBoxGetNextEdit (CGUIEditBox *curCtrl=nullptr)
 get the next editbox inside this container. More...
 
virtual GUITextureElementGetTextureElement (const char *texturename)
 Get the texture element. More...
 
void SetScrollbarWidth (int width)
 
int GetScrollbarWidth () const
 
void Clone (IObject *pobj) const
 This is not a complete clone. More...
 
IObjectClone () const
 Clone the object's contains and return a pointer to the newly created object. More...
 
virtual const ITypeGetType () const
 
virtual void BringToFront (CGUIBase *obj)
 Bring the obj to the front of z-order if the obj is child of this container.
 
virtual void SendToBack (CGUIBase *obj)
 Send the obj to the back of z-order if the obj is child of this container.
 
virtual void SetVisible (bool visible)
 If set invisible, the control will make itself not on top.
 
virtual void SetCandrag (bool bCandrag)
 If set dragable, the control will make itself not on top.
 
virtual void SetTopLevel (bool value)
 Sets the container as the top-level control. More...
 
virtual bool GetTopLevel () const
 
virtual void SetPopUp (int popup)
 
virtual int GetPopUp () const
 
virtual void BeginUpdate ()
 
virtual void EndUpdate ()
 
virtual QPoint GetCompositionPoint ()
 get composition point. More...
 
virtual void SetCompositionPoint (const QPoint &point)
 if set to (0,0) it will use the bounding bottom. More...
 
virtual bool CanPaintOnDevice (CPaintDevice *val)
 whether this object is allowed to paint on the given device. More...
 
CGUIScrollBarGetScrollBar (int nVerticalHorizontal=0)
 get the vertical or horizontal scroll bar. More...
 
int GetChildIndex (CGUIBase *pChild)
 get the index of the given child. More...
 
virtual bool IsNonClientTestEnabled ()
 
virtual void EnableNonClientTest (bool val)
 
- Public Member Functions inherited from ParaEngine::CGUIBase
virtual int GetAttributeClassID ()
 attribute class ID should be identical, unless one knows how overriding rules work. More...
 
virtual const char * GetAttributeClassName ()
 a static string, describing the attribute class object's name
 
virtual const char * GetAttributeClassDescription ()
 a static string, describing the attribute class object
 
virtual int InstallFields (CAttributeClass *pClass, bool bOverride)
 this class should be implemented if one wants to add new attribute. More...
 
virtual void * QueryObject (int nObjectType)
 convert to object of a given type. More...
 
virtual IAttributeFieldsGetChildAttributeObject (const std::string &sName)
 get attribute by child object. More...
 
virtual int GetChildAttributeObjectCount (int nColumnIndex=0)
 get the number of child objects (row count) in the given column. More...
 
virtual int GetChildAttributeColumnCount ()
 we support multi-dimensional child object. More...
 
virtual IAttributeFieldsGetChildAttributeObject (int nRowIndex, int nColumnIndex=0)
 
 ATTRIBUTE_METHOD1 (CGUIBase, GetName_s, const char **)
 
 ATTRIBUTE_METHOD1 (CGUIBase, SetName_s, const char *)
 
 ATTRIBUTE_METHOD1 (CGUIBase, GetTextScale_s, float *)
 
 ATTRIBUTE_METHOD1 (CGUIBase, SetTextScale_s, float)
 
 ATTRIBUTE_METHOD1 (CGUIBase, GetUseTextShadow_s, bool *)
 
 ATTRIBUTE_METHOD1 (CGUIBase, SetUseTextShadow_s, bool)
 
 ATTRIBUTE_METHOD1 (CGUIBase, GetTextShadowQuality_s, int *)
 
 ATTRIBUTE_METHOD1 (CGUIBase, SetTextShadowQuality_s, int)
 
 ATTRIBUTE_METHOD1 (CGUIBase, GetTextShadowColor_s, int *)
 
 ATTRIBUTE_METHOD1 (CGUIBase, SetTextShadowColor_s, int)
 
 ATTRIBUTE_METHOD1 (CGUIBase, GetTextOffsetX_s, int *)
 
 ATTRIBUTE_METHOD1 (CGUIBase, SetTextOffsetX_s, int)
 
 ATTRIBUTE_METHOD1 (CGUIBase, GetTextOffsetY_s, int *)
 
 ATTRIBUTE_METHOD1 (CGUIBase, SetTextOffsetY_s, int)
 
 ATTRIBUTE_METHOD1 (CGUIBase, GetEnabled_s, bool *)
 
 ATTRIBUTE_METHOD1 (CGUIBase, SetEnabled_s, bool)
 
 ATTRIBUTE_METHOD1 (CGUIBase, GetAlwaysMouseOver_s, bool *)
 
 ATTRIBUTE_METHOD1 (CGUIBase, SetAlwaysMouseOver_s, bool)
 
 ATTRIBUTE_METHOD1 (CGUIBase, GetDepth_s, float *)
 
 ATTRIBUTE_METHOD1 (CGUIBase, SetDepth_s, float)
 
 ATTRIBUTE_METHOD1 (CGUIBase, GetLifeTime_s, int *)
 
 ATTRIBUTE_METHOD1 (CGUIBase, SetLifeTime_s, int)
 
 ATTRIBUTE_METHOD1 (CGUIBase, GetX_s, int *)
 
 ATTRIBUTE_METHOD1 (CGUIBase, SetX_s, int)
 
 ATTRIBUTE_METHOD1 (CGUIBase, GetY_s, int *)
 
 ATTRIBUTE_METHOD1 (CGUIBase, SetY_s, int)
 
 ATTRIBUTE_METHOD1 (CGUIBase, GetWidth_s, int *)
 
 ATTRIBUTE_METHOD1 (CGUIBase, SetWidth_s, int)
 
 ATTRIBUTE_METHOD1 (CGUIBase, GetHeight_s, int *)
 
 ATTRIBUTE_METHOD1 (CGUIBase, SetHeight_s, int)
 
 ATTRIBUTE_METHOD1 (CGUIBase, GetRotation_s, float *)
 
 ATTRIBUTE_METHOD1 (CGUIBase, SetRotation_s, float)
 
 ATTRIBUTE_METHOD1 (CGUIBase, GetScaling_s, Vector2 *)
 
 ATTRIBUTE_METHOD1 (CGUIBase, SetScaling_s, Vector2)
 
 ATTRIBUTE_METHOD1 (CGUIBase, GetTranslation_s, Vector2 *)
 
 ATTRIBUTE_METHOD1 (CGUIBase, SetTranslation_s, Vector2)
 
 ATTRIBUTE_METHOD1 (CGUIBase, GetRotOriginOffset_s, Vector2 *)
 
 ATTRIBUTE_METHOD1 (CGUIBase, SetRotOriginOffset_s, Vector2)
 
 ATTRIBUTE_METHOD1 (CGUIBase, GetColorMask_s, DWORD *)
 
 ATTRIBUTE_METHOD1 (CGUIBase, SetColorMask_s, DWORD)
 
 ATTRIBUTE_METHOD1 (CGUIBase, GetText_s, const char **)
 
 ATTRIBUTE_METHOD1 (CGUIBase, SetText_s, const char *)
 
 ATTRIBUTE_METHOD1 (CGUIBase, GetSpacing_s, int *)
 
 ATTRIBUTE_METHOD1 (CGUIBase, SetSpacing_s, int)
 
 ATTRIBUTE_METHOD1 (CGUIBase, GetPadding_s, int *)
 
 ATTRIBUTE_METHOD1 (CGUIBase, SetPadding_s, int)
 
 ATTRIBUTE_METHOD1 (CGUIBase, GetZOrder_s, int *)
 
 ATTRIBUTE_METHOD1 (CGUIBase, SetZOrder_s, int)
 
 ATTRIBUTE_METHOD1 (CGUIBase, GetCursor_s, const char **)
 
 ATTRIBUTE_METHOD1 (CGUIBase, SetCursor_s, const char *)
 
 ATTRIBUTE_METHOD1 (CGUIBase, GetIndex_s, int *)
 
 ATTRIBUTE_METHOD1 (CGUIBase, GetID_s, int *)
 
 ATTRIBUTE_METHOD1 (CGUIBase, SetID_s, int)
 
 ATTRIBUTE_METHOD1 (CGUIBase, GetVisible_s, bool *)
 
 ATTRIBUTE_METHOD1 (CGUIBase, SetVisible_s, bool)
 
 ATTRIBUTE_METHOD1 (CGUIBase, GetVisibleRecursive_s, bool *)
 
 ATTRIBUTE_METHOD1 (CGUIBase, GetHighlightStyle_s, int *)
 
 ATTRIBUTE_METHOD1 (CGUIBase, SetHighlightStyle_s, int)
 
 ATTRIBUTE_METHOD1 (CGUIBase, GetAnimationStyle_s, int *)
 
 ATTRIBUTE_METHOD1 (CGUIBase, SetAnimationStyle_s, int)
 
 ATTRIBUTE_METHOD1 (CGUIBase, IsPressed_s, bool *)
 
 ATTRIBUTE_METHOD1 (CGUIBase, IsClickThrough_s, bool *)
 
 ATTRIBUTE_METHOD1 (CGUIBase, SetClickThrough_s, bool)
 
 ATTRIBUTE_METHOD1 (CGUIBase, CanHaveFocus_s, bool *)
 
 ATTRIBUTE_METHOD1 (CGUIBase, SetCanHaveFocus_s, bool)
 
 ATTRIBUTE_METHOD1 (CGUIBase, IsDirty_s, bool *)
 
 ATTRIBUTE_METHOD1 (CGUIBase, SetDirty_s, bool)
 
 ATTRIBUTE_METHOD1 (CGUIBase, IsOwnerDraw_s, bool *)
 
 ATTRIBUTE_METHOD1 (CGUIBase, SetOwnerDraw_s, bool)
 
 ATTRIBUTE_METHOD1 (CGUIBase, IsUVWrappingEnabled_s, bool *)
 
 ATTRIBUTE_METHOD1 (CGUIBase, EnableUVWrapping_s, bool)
 
 ATTRIBUTE_METHOD1 (CGUIBase, HasKeyFocus_s, bool *)
 
 ATTRIBUTE_METHOD1 (CGUIBase, GetUsePointTextureFiltering_s, bool *)
 
 ATTRIBUTE_METHOD1 (CGUIBase, SetUsePointTextureFiltering_s, bool)
 
 ATTRIBUTE_METHOD (CGUIBase, ApplyColorMask_s)
 
 ATTRIBUTE_METHOD (CGUIBase, ApplyAnim_s)
 
 ATTRIBUTE_METHOD1 (CGUIBase, IsSelfPaintEnabled_s, bool *)
 
 ATTRIBUTE_METHOD1 (CGUIBase, EnableSelfPaint_s, bool)
 
 ATTRIBUTE_METHOD1 (CGUIBase, IsAutoClearBackground_s, bool *)
 
 ATTRIBUTE_METHOD1 (CGUIBase, SetAutoClearBackground_s, bool)
 
 ATTRIBUTE_METHOD1 (CGUIBase, IsMouseCaptured_s, bool *)
 
 ATTRIBUTE_METHOD1 (CGUIBase, SetMouseCaptured_s, bool)
 
 ATTRIBUTE_METHOD1 (CGUIBase, IsInputMethodEnabled_s, bool *)
 
 ATTRIBUTE_METHOD1 (CGUIBase, SetInputMethodEnabled_s, bool)
 
 ATTRIBUTE_METHOD1 (CGUIBase, GetCompositionPoint_s, Vector2 *)
 
 ATTRIBUTE_METHOD1 (CGUIBase, SetCompositionPoint_s, Vector2)
 
 ATTRIBUTE_METHOD1 (CGUIBase, IsNonClientTestEnabled_s, bool *)
 
 ATTRIBUTE_METHOD1 (CGUIBase, EnableNonClientTest_s, bool)
 
virtual CPaintEnginepaintEngine () const
 Returns the paint engine. More...
 
void DeleteThis ()
 
CGUIContainerGetParent ()
 get the parent container
 
CGUIContainerGetPainterWindow ()
 get the parent container which has a self painted painter device. More...
 
bool IsPainterWindow ()
 if control contains its own painting device. More...
 
virtual bool HasClickEvent ()
 return true, if this control can be clicked. More...
 
bool IsAncestorOf (CGUIBase *pChild)
 return true if current control is a parent of pChild. More...
 
bool HasParent (CGUIContainer *pParent)
 return true if pParent is a predecessor of this object. More...
 
void SetParent (CGUIContainer *parent)
 set the parent container
 
int GetIndex ()
 get the child index in the parent object. More...
 
bool GetEnabled ()
 whether control is enabled. More...
 
void SetEnabled (bool bEnabled)
 set whether the control is enabled or not
 
bool IsInputMethodEnabled () const
 
void SetInputMethodEnabled (bool val)
 
void SetNeedUpdate (bool bNeedUpdate=true)
 set need update
 
bool IsNeedUpdate (bool bRecursive=false)
 whether this control needs update. More...
 
void SetAlwaysMouseOver (bool bAlwaysMouseOver)
 set whether make mouse over to true as long as it contains the mouse point, no matter it has mouse focus or not. More...
 
bool GetAlwaysMouseOver ()
 get whether make mouse over to true as long as it contains the mouse point, no matter it has mouse focus or not. More...
 
virtual bool IsPressed ()
 whether it is pressed. More...
 
virtual void SetTextA (const char *szText)
 Set the text of this object. More...
 
virtual void SetText (const char16_t *wszText)
 Set the text of this object The control internally store everything in Unicode. More...
 
virtual int GetTextA (std::string &out)
 get the text of the control More...
 
virtual const char16_t * GetText ()
 get the text of the control The control internally store everything in Unicode. More...
 
virtual void Reset ()
 Resets the objects states. More...
 
bool HasEvent (int etype)
 check if the object has any events More...
 
void ClearAllEvent ()
 Clear all events in the event buffer (m_objEvents), not including interpreted events such as m_pMouseEvent and m_pKeyEvent.
 
void ClearEvent (int etype)
 Clear specific kind of events in the event buffer (m_objEvents), including interpreted events such as m_pMouseEvent and m_pKeyEvent. More...
 
void BeginDepthTest (GUIState *pState=NULL)
 draw calls between BeginDepthTest() and EndDepthTest() are rendered with depth enabled, such as for relative to 3d objects. More...
 
void EndDepthTest (GUIState *pState=NULL)
 
virtual void GetAbsolutePosition (CGUIPosition *pOut, const CGUIPosition *pIn)
 Gets the absolute position of a CGUIPosition structure. More...
 
virtual float GetDepth ()
 Get the 3D depth.
 
bool HasFocus () const
 
virtual bool HasKeyFocus ()
 whether this control has key focus. More...
 
virtual void SetLifeTime (int lifttime)
 Set/get how many frames the control will survive. More...
 
virtual int GetLifeTime () const
 
- Public Member Functions inherited from ParaEngine::IAttributeFields
 ATTRIBUTE_METHOD1 (IAttributeFields, GetName_s, const char **)
 
 ATTRIBUTE_METHOD1 (IAttributeFields, SetName_s, const char *)
 
 ATTRIBUTE_METHOD (IAttributeFields, PrintObject_s)
 
 ATTRIBUTE_METHOD (IAttributeFields, AddRef_s)
 
 ATTRIBUTE_METHOD1 (IAttributeFields, GetRefCount_s, int *)
 
 ATTRIBUTE_METHOD1 (IAttributeFields, SetTime_s, int)
 
 ATTRIBUTE_METHOD1 (IAttributeFields, GetTime_s, int *)
 
 ATTRIBUTE_METHOD (IAttributeFields, Release_s)
 
virtual const std::string & GetIdentifier ()
 
virtual void SetIdentifier (const std::string &sID)
 
virtual bool IsModified ()
 whether some of the fields are modified.It is up to the implementation class to provide this functionality if necessary. More...
 
virtual void SetModified (bool bModified)
 set whether any field has been modified. More...
 
virtual bool ValidateFields ()
 validate all fields and return true if validation passed. More...
 
virtual string GetValidationMessage ()
 get the recent validation message due to the most recent call to ValidateFields()
 
virtual bool ResetField (int nFieldID)
 Reset the field to its initial or default value. More...
 
virtual bool InvokeEditor (int nFieldID, const std::string &sParameters)
 Invoke an (external) editor for a given field. More...
 
virtual bool AddChildAttributeObject (IAttributeFields *pChild, int nRowIndex=-1, int nColumnIndex=0)
 add child object. More...
 
virtual void * QueryObjectByName (const std::string &sObjectType)
 convert to object of a given type. More...
 
virtual int GetTime ()
 get the current local time in case it is animated in milli seconds frames. More...
 
virtual void SetTime (int nTime)
 
virtual CDynamicAttributeFieldGetDynamicField (const std::string &sName)
 Get a dynamic field with a given name. More...
 
virtual CDynamicAttributeFieldGetDynamicField (int nIndex)
 Get a dynamic field with a given index. More...
 
virtual const char * GetDynamicFieldNameByIndex (int nIndex)
 get field name by index
 
virtual int GetDynamicFieldCount ()
 how many dynamic field this object currently have. More...
 
virtual int SetDynamicField (const std::string &sName, const CVariable &value)
 set a dynamic field with a given name. More...
 
virtual int AddDynamicField (const std::string &sName, ATTRIBUTE_FIELDTYPE dwType)
 add dynamic field and return field index
 
virtual void RemoveAllDynamicFields ()
 remove all dynamic fields
 
virtual int SaveDynamicFieldsToString (std::string &output)
 save only text dynamic fields to fieldname = value text strings. More...
 
virtual int LoadDynamicFieldsFromString (const std::string &input)
 load only text dynamic fields from string More...
 
CAttributeClassGetAttributeClass ()
 get the main attribute class object. More...
 
void PrintObject ()
 print the content of this object to a text file at temp/doc/[ClassName].txt. More...
 
- Public Member Functions inherited from ParaEngine::IObject
virtual bool Equals (const IObject *obj) const
 Compare the object with another object. More...
 
virtual std::string ToString () const
 
WeakPtr_typeGetWeakReference ()
 get weak reference object. More...
 
virtual int ProcessObjectEvent (const ObjectEvent &event)
 this function is only used to backward compatibility of ParaObject:AddEvent() function. More...
 
- Public Member Functions inherited from ParaEngine::CRefCounted
void addref () const
 add reference count of the object. More...
 
bool delref () const
 decrease reference count of the object. More...
 
int GetRefCount () const
 get the reference count
 
virtual int Release ()
 
CRefCountedAddToAutoReleasePool ()
 addref and releases the ownership sometime soon automatically (usually at the end of the current frame). More...
 
- Public Member Functions inherited from ParaEngine::IObjectDrag
virtual bool GetCandrag () const =0
 
virtual void BeginDrag (int nEvent, int x, int y, int z)=0
 Default BeginDrag handle function. More...
 
virtual void EndDrag (int nEvent, int x, int y, int z)=0
 Default EndDrag handle function. More...
 
virtual BOOL IsOnObject (int x, int y, int z)=0
 Decide whether the input position is on this object This function is to help other function to decide if the currently pointing position is logically "on" the object. More...
 
virtual void SetPositionI (const CGUIPosition &position)
 restore to a given position. More...
 
- Public Member Functions inherited from ParaEngine::CPaintDevice
virtual int devType () const
 
bool paintingActive () const
 
int width () const
 
int height () const
 
int depth () const
 
virtual float GetUIScalingX () const
 
virtual float GetUIScalingY () const
 
virtual float GetViewportLeft () const
 
virtual float GetViewportTop () const
 

Static Public Member Functions

static void StaticInit ()
 
- Static Public Member Functions inherited from ParaEngine::CGUIBase
static void StaticInit ()
 Initialize the event mapping for the default CGUIBase class All its inheritances should have a StaticInit() for each kind of class.
 
- Static Public Member Functions inherited from ParaEngine::IAttributeFields
static HRESULT GetAttributeClassID_s (IAttributeFields *cls, int *p1)
 
static HRESULT GetAttributeClassName_s (IAttributeFields *cls, const char **p1)
 
static bool OpenWithDefaultEditor (const char *sFilename, bool bWaitOnReturn=false)
 Open a given file with the default registered editor in the game engine. More...
 
- Static Public Member Functions inherited from ParaEngine::IObjectDrag
static bool CancelDrag (STRUCT_DRAG_AND_DROP *pdrag)
 try cancel the drag operation. More...
 

Protected Member Functions

virtual CRenderTargetCreateGetRenderTarget (bool bCreateIfNotExist=true)
 a render target will be created with the same name as this object. More...
 
- Protected Member Functions inherited from ParaEngine::IAttributeFields
virtual CAttributeClassCreateAttributeClass ()
 initialize fields
 
virtual CDynamicAttributesSetGetDynamicAttributes (bool bCreateIfNotExist=false)
 
- Protected Member Functions inherited from ParaEngine::CPaintDevice
virtual int metric (PaintDeviceMetric metric) const
 
virtual void initPainter (CPainter *painter) const
 
virtual CPaintersharedPainter () const
 

Protected Attributes

bool m_bScrollable
 whether it can automatically scroll
 
CGUIScrollBarm_VScroll
 Vertical scrollbar.
 
CGUIScrollBarm_HScroll
 Horizontal scrollbar.
 
GUIBase_List_Type m_children
 child object
 
CGUIBasem_pKeyFocus
 one of its children control which has Key focus
 
CGUIBasem_pMouseFocus
 one of its children control where the mouse located
 
int m_ScrollType
 Scroll type.
 
WeakPtr m_renderTarget
 only used when self paint is enabled, when we will render into our own render target. More...
 
int m_nBorder
 
int m_nMargin
 
int m_nSBWidth
 
bool m_bFastRender
 
RECT m_oldRect
 
RECT m_clientRect
 
QPoint m_compositionPoint
 
int m_nPopupStyle
 
bool m_bIsTop
 
bool m_bBatching
 
bool m_bNeedCalClientRect
 
bool m_bEnableNonClientTest
 default to false. More...
 
- Protected Attributes inherited from ParaEngine::IObject
WeakPtr_type m_weak_reference
 
- Protected Attributes inherited from ParaEngine::CRefCounted
int m_refcount
 
- Protected Attributes inherited from ParaEngine::IObjectDrag
bool m_bCandrag
 
- Protected Attributes inherited from ParaEngine::CPaintDevice
int32 painters
 refcount
 

Static Protected Attributes

static const ITypem_type = NULL
 

Friends

class CGUIRoot
 

Additional Inherited Members

- Static Public Attributes inherited from ParaEngine::IObjectDrag
static STRUCT_DRAG_AND_DROP DraggingObject
 This structure contains the information about the dragging object.
 

Detailed Description

m_objResource->m_objArtwork->DrawingRects[0]: client rectangle; m_objResource->m_objArtwork->DrawingRects[1]: container rectangle, including scrollbars m_objResource->m_objArtwork->DrawingRects[2]: container rectangle, including scrollbars, including borders m_objResource->m_objArtwork->DrawingRects[3-11]: [optional] for nine element containers.

Member Function Documentation

§ ActivateDefaultButton()

bool ParaEngine::CGUIContainer::ActivateDefaultButton ( )
virtual

click the default button inside this container.

If no default button is found, this function will return false.

§ AddChild()

void CGUIContainer::AddChild ( CGUIBase pChild,
int  nIndex = -1 
)

add a child object.

Please note that this function does not check if the child is already a children of this node.

Parameters
pChildthe child object to attach.
nIndexif this is -1, child is attached to end of the child list.

§ Begin()

void CGUIContainer::Begin ( GUIState pGUIState,
float  fElapsedTime 
)
virtual

Render a mask of the container to ensure none of its descendants is rendered outside its boundary.

Please note that click-through object are NOT returned. Disabled and invisible controls are ignored.

Parameters
pGUIStatea pointer to the GUIState object;
rcWindowthe rectangle which all drawings should lie inside it
Returns
: return S_OK if success; Do some preparations before render.
Parameters
pGUIStatea pointer to the GUIState object;

§ CanPaintOnDevice()

bool ParaEngine::CGUIContainer::CanPaintOnDevice ( CPaintDevice val)
virtual

whether this object is allowed to paint on the given device.

By default, object is allowed to paint on any device. unless SetForcedPaintDevice is called.

§ Clone() [1/2]

void CGUIContainer::Clone ( IObject pobj) const
virtual

This is not a complete clone.

The m_children, m_pKeyFocus, m_pMouseFocus, m_oldRect are not cloned.

Reimplemented from ParaEngine::IObject.

Reimplemented in ParaEngine::CGUIListBox.

§ Clone() [2/2]

IObject * CGUIContainer::Clone ( ) const
virtual

Clone the object's contains and return a pointer to the newly created object.

The caller should free the memory of the return object. Inheritance should implement this function void Clone(IObject*) and IObject* Clone() should have the same behavior

Reimplemented from ParaEngine::IObject.

Reimplemented in ParaEngine::CGUIListBox.

§ CreateGetRenderTarget()

CRenderTarget * ParaEngine::CGUIContainer::CreateGetRenderTarget ( bool  bCreateIfNotExist = true)
protectedvirtual

a render target will be created with the same name as this object.

§ End()

void CGUIContainer::End ( GUIState pGUIState,
float  fElapsedTime 
)
virtual

Do some fininsh-ups after render.

Parameters
pGUIStatea pointer to the GUIState object;

§ GetChildByID()

CGUIBase * CGUIContainer::GetChildByID ( int  nChildID)
virtual

get a child node by its id

Parameters
nChildIDchild ID usually obtained by GetID() method.
Returns
: return the child object found. it may return NULL if not found.

§ GetChildByName()

CGUIBase * CGUIContainer::GetChildByName ( const string &  name)
virtual

get the first child node whose name is name.

Since a name may not be unique among its sibling children. One is advised to use GetChildByID() instead.

Parameters
namechild name usually obtained by GetName() method.
Returns
: return the child object found. it may return NULL if not found.

§ GetChildIndex()

int ParaEngine::CGUIContainer::GetChildIndex ( CGUIBase pChild)

get the index of the given child.

§ GetChildren()

virtual GUIBase_List_Type* ParaEngine::CGUIContainer::GetChildren ( )
inlinevirtual

Gets the control's children.

Returns
: a pointer to the children list;

Reimplemented from ParaEngine::CGUIBase.

§ GetCompositionPoint()

ParaEngine::QPoint ParaEngine::CGUIContainer::GetCompositionPoint ( )
virtual

get composition point.

default to bottom of the current bounding box.

§ GetDefaultButton()

CGUIButton * ParaEngine::CGUIContainer::GetDefaultButton ( )
virtual

get the default button inside this container.

If no default button is found, this function will return NULL.

§ GetKeyFocus()

virtual CGUIBase* ParaEngine::CGUIContainer::GetKeyFocus ( )
inlinevirtual

Gets the direct key focus of the current control.

It searches its children but not all its descendant.

Returns
: a pointer to the focused control
Remarks
: It's different from the GetUIKeyFocus() in CGUIRoot.

§ GetMouseFocus()

virtual CGUIBase* ParaEngine::CGUIContainer::GetMouseFocus ( )
inlinevirtual

Gets the direct mouse focus of the current control.

It searches its children but not all its descendant.

Returns
: a pointer to the focused control
Remarks
: It's different from the GetUIMouseFocus() in CGUIRoot.

§ GetNextEdit()

CGUIEditBox * CGUIContainer::GetNextEdit ( CGUIEditBox curCtrl = nullptr)
virtual

get the next editbox inside this container.

If no default button is found, this function will return nullptr.

§ GetObjectAtPoint()

CGUIBase * CGUIContainer::GetObjectAtPoint ( int  x,
int  y 
)
virtual

Gets the direct object at the given point.

It searches its first level children but not all its descendant. Please note that click-through object are also returned. Disabled and invisible controls are ignored.

Returns
: a pointer to the control(maybe this)
Remarks
: It's different from the GetUIObjectAtPoint() in CGUIRoot.

§ GetObjectAtPointRecursive()

CGUIBase * CGUIContainer::GetObjectAtPointRecursive ( int  x,
int  y 
)
virtual

Gets the deepest non-click-through object at the given point.

It searches all of its children recursively.

Returns
: a pointer to the control(maybe this)

§ GetScrollBar()

CGUIScrollBar * CGUIContainer::GetScrollBar ( int  nVerticalHorizontal = 0)

get the vertical or horizontal scroll bar.

Parameters
nVerticalHorizontal: if 0, vertical scroll bar is returned; if 1 horizontal scroll bar object is returned.
Returns
scroll bar object linked to this object. It may be NULL.

§ GetScrollType()

int CGUIContainer::GetScrollType ( )

Get the scroll type of the control.

Returns
: a combination of GUI_SCROLL_TYPE
See also
GUI_SCROLL_TYPE for more details

§ GetTextureElement()

GUITextureElement * CGUIContainer::GetTextureElement ( const char *  texturename)
virtual

Get the texture element.

This is an overloaded function to provide container class specific functionality.

Parameters
texturenamename of texture. Extra textures are support here. They are "vscrollbar.track", "vscrollbar.upbutton", "vscrollbar.downbutton", "vscrollbar.thumb", "hscrollbar.track", "hscrollbar.leftbutton", "hscrollbar.rightbutton", "hscrollbar.thumb"

§ GetZOrder()

int ParaEngine::CGUIContainer::GetZOrder ( ) const
virtual

z order affect the order of rendering.

The parent control sort and render child control from small z value to larger z value. default value is 0. if this is a top level control it will add 1000 to zorder.

§ InvalidateRect()

bool CGUIContainer::InvalidateRect ( const RECT lpRect)
virtual

adds a rectangle to the specified window's update region.

The update region represents the portion of the window's client(child) area that must be recalculated and redrawn

Parameters
lpRect:[in]Pointer to a RECT structure that contains the client coordinates of the rectangle to be added to the update region. If this parameter is NULL, the entire client(child) area is added to the update region.
Returns
true if succeed.

§ IsScrollable()

bool CGUIContainer::IsScrollable ( )
virtual

return true if it is scrollable.

Returns

§ MsgProc()

bool CGUIContainer::MsgProc ( MSG event)
virtual

First, send the message to the scrollbar.

If scrollbar does not handle the message, let the container handle it. Container only handle EM_MOUSE_WHEEL, other events are sent further to CGUIBase::MsgProc

object should at least has a life count greater than 1, and isEnabled

object should at least has a life count greater than 1, and isEnabled

Reimplemented from ParaEngine::CGUIBase.

Reimplemented in ParaEngine::CGUIRoot, and ParaEngine::CGUIListBox.

§ Render()

HRESULT CGUIContainer::Render ( GUIState pGUIState,
float  fElapsedTime 
)
virtual

Render function of the control.

Parameters
pGUIStatea pointer to the GUIState object;
Returns
: return S_OK if success;

skip any node that is not visible

Reimplemented in ParaEngine::CGUIRoot, ParaEngine::CGUIListBox, and ParaEngine::CGUIPainter.

§ SetCompositionPoint()

void ParaEngine::CGUIContainer::SetCompositionPoint ( const QPoint point)
virtual

if set to (0,0) it will use the bounding bottom.

§ SetDepth()

void ParaEngine::CGUIContainer::SetDepth ( float  fDepth)
virtual

set the 3D depth.

this is usually automatically set when object is attached to 3d object. it the object contains children. it will also affect all children automatically.

Parameters
fDeptha value of [0,1). Default to 0, which is closest to the screen.

Reimplemented from ParaEngine::CGUIBase.

§ SetKeyFocus()

void CGUIContainer::SetKeyFocus ( CGUIBase control)

Set key focus of this control.

We want to set the m_pKeyFocus property of all its parents.

It will also change all related key focus and triggers OnFocusIn and OnFocusOut event

Parameters
controlthe new focused control

For example, the control that gets focus is A, its parent is B, root is R The control that lost focus is D, its parent is C. The current focus is B.m_pKeyFocus=NULL, R.m_pKeyFocus=C, C.m_pKeyFocus=D See the follow hierarchy tree. R / \ B C / \ A D Case 1: Our desirable result is B.m_pKeyFocus=A, R.m_pKeyFocus=B, C.m_pKeyFocus=NULL We are calling B.SetKeyFocus(A). The following is the steps:

  1. We first follows the B.m_parent link of A upwards until we comes to a control whose m_pKeyFocus!=NULL. We call it the Common Parent(CP). In the above case it is R.
  2. Then we follow the CP.m_pKeyFocus link downwards until reach D. Follow the D.m_parent upwards and sets all the m_pKeyFocus in that link to NULL and trigger the "OnFocusOut" event of each controls in that link until we get to CP.
  3. We follows the A.m_parent link upwards and sets the the m_pKeyFocus in that link and trigger "OnFocusIn" event in reverse sequence for each node until we get to CP.

Case 2: On another case, when we want to set R.m_pKeyFocus=C, C.m_pKeyFocus=NULL;

  1. We know the C's parent's m_pKeyFocus=C. We set the Common Parent(CP) to C;
  2. Do the same as case 1;
  3. The same as case 1 but only do it for C;

§ SetMouseFocus()

void CGUIContainer::SetMouseFocus ( CGUIBase control)

Set mouse focus of this control.

It will also change all related mouse focus and triggers OnMouseEnter and OnMouseLeave event

Parameters
controlthe new focused control

§ SetScrollable()

void CGUIContainer::SetScrollable ( bool  bScrollable)

set scrollable

Parameters
bScrollable

§ SetScrollType()

void CGUIContainer::SetScrollType ( int  etype)

Set the scroll type of the control.

Parameters
etypea combination of GUI_SCROLL_TYPE
See also
GUI_SCROLL_TYPE for more details

§ SetTopLevel()

void CGUIContainer::SetTopLevel ( bool  value)
virtual

Sets the container as the top-level control.

If you call the SetTopLevel method of a container and pass in a value of true, the container will be the top container which receive all messages. You can only pass a value of true when the container is attached to root. After you pass a value of false, the container will behave as a normal container.

Remarks
: If the container is the top-level control, set it invisible or set it dragable will make it no longer the top-level control. If CanDrag or visible property is false, you can't set it top-level control.
Parameters
valuetrue to set the control as the top-level control; otherwise, false

§ SortChildrenByZOrder()

bool ParaEngine::CGUIContainer::SortChildrenByZOrder ( )

Sort children by z-order.

it will just move child in min distance to make them in order.

Returns
true if at least one child's position is changed.

§ UpdateClientRect()

void CGUIContainer::UpdateClientRect ( const CGUIPosition pos,
bool  unupdate = false 
)
virtual

this function will update the client rectangle of this object.

Usually a child object need to inform a parent object to update its client area, whenever a child object size changes. if a container's child rectangle is bigger than the container itself, scroll bar may be displayed.

Parameters
posthe position of the child object specified in any coordinate system.

disable update client if it is not scrollable

§ UpdateRects()

void CGUIContainer::UpdateRects ( )
virtual

skip any node that is not visible

skip any node that is not visible

§ UpdateScroll()

void CGUIContainer::UpdateScroll ( int  nXDelta,
int  nYDelta 
)
virtual

Tell the container how many items are scrolled in both X and Y direction.

It's usually called by its scroll bars in order to update the container's information.

Parameters
nXDeltaThe horizontal scroll bar scrolls by nXDelta items (plus or minus)
nYDeltaThe vertical scroll bar scrolls by nYDelta items (plus or minus)

Reimplemented in ParaEngine::CGUIListBox.

Member Data Documentation

§ m_bEnableNonClientTest

bool ParaEngine::CGUIContainer::m_bEnableNonClientTest
protected

default to false.

if true, we will set GUIRoot's non-client attribute.

§ m_renderTarget

WeakPtr ParaEngine::CGUIContainer::m_renderTarget
protected

only used when self paint is enabled, when we will render into our own render target.


The documentation for this class was generated from the following files: