Guiliani  Version 2.5 revision 7293 (documentation build 13)
CGUILayouterGrid Class Reference

Layouter for size-dependant grid. More...

#include <GUILayouterGrid.h>

Inheritance diagram for CGUILayouterGrid:

Public Member Functions

 CGUILayouterGrid (CGUICompositeObject *const pkObject, eC_UInt uiRow, eC_UInt uiColumn, eC_Bool bMakeSameSize, eC_Bool bTakeOverParentLayout)
 
virtual ~CGUILayouterGrid ()
 Destructor a Reposition-Layouter.
 
virtual void DoLayout (eMovedEdges_t eMovedEdges)
 
eC_UInt GetColumn () const
 
eC_Bool GetMakeSameSize () const
 
eC_UInt GetRow () const
 
virtual void InitLayouter (eMovedEdges_t eMovedEdges)
 
virtual void ReadFromStream ()
 
void SetColumn (const eC_UInt uiColumn)
 
void SetMakeSameSize (const eC_Bool bMakeSameSize)
 
void SetRow (const eC_UInt uiRow)
 
virtual void WriteToStream (const eC_Bool bWriteClassID=false)
 
- Public Member Functions inherited from CGUIGroupLayouter
 CGUIGroupLayouter ()
 Default constuctor.
 
 CGUIGroupLayouter (CGUICompositeObject *pkObject, eC_Bool bTakeOverParentLayout)
 
virtual ~CGUIGroupLayouter ()
 Destructor a Reposition-Layouter.
 
virtual eC_Bool IsDependentOnParentSize ()
 
virtual eC_Bool IsGroupLayouter () const
 
virtual void ReadFromStream ()
 
virtual void SetAssociatedObject (CGUIObject *const pkObject)
 
virtual void WriteToStream (const eC_Bool bWriteClassID=false)
 
- Public Member Functions inherited from CGUILayouter
virtual ~CGUILayouter ()
 Destructor. More...
 
virtual void DoLayout (eMovedEdges_t eMovedEdges)=0
 
CGUIObjectGetAssociatedObject () const
 
virtual void InitLayouter (eMovedEdges_t eMovedEdges)
 
virtual eC_Bool IsDependentOnParentSize ()=0
 
virtual eC_Bool IsGroupLayouter () const
 
virtual void SetAssociatedObject (CGUIObject *const pkObject)
 
- Public Member Functions inherited from CGUIStreamableObject
const eC_String & GetXMLTag () const
 
virtual void ReadFromStream ()
 
void SetXMLTag (const eC_String &kXMLTag)
 
virtual void WriteToStream (const eC_Bool bWriteClassID=false)
 

Static Public Attributes

static const eC_UInt LAYOUTER_GRID_CLASS_VERSION
 Class version of grid layouter class.
 
- Static Public Attributes inherited from CGUIGroupLayouter
static const eC_UInt GROUP_LAYOUTER_CLASS_VERSION
 Class version of group layouter class.
 
- Static Public Attributes inherited from CGUILayouter
static const eC_Char XMLTAG_LAYOUTERCLASSID []
 XML tag to be used when writing a layouter class ID into a stream.
 
- Static Public Attributes inherited from CGUIStreamableObject
static const eC_Char XMLTAG_CLASSVERSION []
 

Additional Inherited Members

- Public Types inherited from CGUILayouter
enum  eMovedEdges_t {
  CHANGED_WIDTH , CHANGED_HEIGHT , CHANGED_RELXPOS , CHANGED_RELYPOS ,
  CHANGED_EDGE_ALL
}
 Enumerate possible reasons for calling layout,. More...
 
- Protected Member Functions inherited from CGUIGroupLayouter
eC_Bool LayoutAction ()
 
- Protected Member Functions inherited from CGUILayouter
 CGUILayouter (CGUIObject *const pkObject=NULL)
 
- Protected Member Functions inherited from CGUIStreamableObject
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
 

Detailed Description

Layouter for size-dependant grid.

This is a layouter which implements repositioning of the children of the associated object in a grid according to the size of the associated object.

Constructor & Destructor Documentation

◆ CGUILayouterGrid()

CGUILayouterGrid::CGUILayouterGrid ( CGUICompositeObject *const  pkObject,
eC_UInt  uiRow,
eC_UInt  uiColumn,
eC_Bool  bMakeSameSize,
eC_Bool  bTakeOverParentLayout 
)

Constructs a Grid-Layouter.

Parameters
pkObjectPointer to the object to which the layouter is attached.
uiRowThe number of rows.
uiColumnThe number of columns.
bMakeSameSizeIndicate whether the children change their dimensions to be the same as the grid or not.
bTakeOverParentLayoutTrue if LayoutAction() shall take over the size of the associated object's parent to the associated object and set the x and y position of the associated to zero.

Member Function Documentation

◆ DoLayout()

virtual void CGUILayouterGrid::DoLayout ( eMovedEdges_t  eMovedEdges)
virtual

Called when the size of the parent of the associated object has changed.

This method must be re-implemented in derived classes to perform the actual layout change, typically adjustments to the associated object's dimension or position.

It is called by the framework every time the width or height of the parent of the associated object has changed. The framework first calls DoLayout() on the associated object itself and then on all children of the associated object in any depth in the hierarchy.

There are two valid types of layouters: Either: Implementations of DoLayout() shall only adjust the associated object and/or direct children of it. No other decendants of the associated object shall be changed in position or size! This is called a group layouter. CGUILayouterReposition and CGUILayouterGrid are examples of group layouters. Or: Implementations of DoLayout() shall only adjust the associated object depending on the layout of its parent object. No other objects shall be changed in position or size! This is called a child layouter. CGUILayouterAnchor is an example of a child layouter.

Implementing other types of layouters may compromise the framework architecture.

The two use cases may overlap: If a direct child of a group layouter composite object has a child layouter then while streaming in the composite object associated with the group layouter, the composite will first call DoLayout() on its layouter and then call InitLayouter() on the layouters of all direct children of that composite object. Therefore, the group layouter will re-initialize the child layouter. For an anchor layouter this implies that the child layouter will have no effect and should be removed. Still the child layouter's DoLayout() will be called after the parent layouter's DoLayout() later on for any change of the size of the parent so that the child layouter might change (override) the layouting of the group layouter concerning its child layout, for example if using hardcoded values for anchor distances.

Parameters
eMovedEdgesReason for layouter call

Implements CGUILayouter.

◆ GetColumn()

eC_UInt CGUILayouterGrid::GetColumn ( ) const
inline

Get 'column' repositioning parameter, see CGUILayoutHelper::AlignToGrid().

Returns
column

◆ GetMakeSameSize()

eC_Bool CGUILayouterGrid::GetMakeSameSize ( ) const
inline

Get 'MakeSameSize' repositioning parameter, see CGUILayoutHelper::AlignToGrid().

Returns
MakeSameSize

◆ GetRow()

eC_UInt CGUILayouterGrid::GetRow ( ) const
inline

Get 'row' repositioning parameter, see CGUILayoutHelper::AlignToGrid().

Returns
row

◆ InitLayouter()

virtual void CGUILayouterGrid::InitLayouter ( eMovedEdges_t  eMovedEdges)
inlinevirtual

This function is useful for child layouters. Called when the layout of the associated object itself has changed. It is called by the framework every time the width or height or x or y relative position of the associated object is changed. That is, for example when the new distance to parent's border(s) shall be set in a child layouter to base upcoming layouting on this data the framework calls this method.

InitLayouter() is only called on the layouter of the associated object for one change of the position or size of the associated object. DoLayout() in contrast is called on the layouter of the associated object and on the layouters of all decendants of the associated object for one change of the size of the associated object.

This function usually does not implement changes to any layout. It is typically used to remember layout data to be used in DoLayout() later on (useful for child layouters that depend on changes of their associated object's parent).

Parameters
eMovedEdgesReason for layouter call

Reimplemented from CGUILayouter.

◆ ReadFromStream()

virtual void CGUILayouterGrid::ReadFromStream ( )
virtual

Reads attributes from the streaming file. Only for use with GUIFactoryManager.

See also
CGUIObject::ReadFromStream()

Reimplemented from CGUIGroupLayouter.

◆ SetColumn()

void CGUILayouterGrid::SetColumn ( const eC_UInt  uiColumn)
inline

Set 'column' repositioning parameter, see CGUILayoutHelper::AlignToGrid().

Parameters
uiColumn

◆ SetMakeSameSize()

void CGUILayouterGrid::SetMakeSameSize ( const eC_Bool  bMakeSameSize)
inline

Set 'MakeSameSize' repositioning parameter, see CGUILayoutHelper::AlignToGrid().

Parameters
bMakeSameSize

◆ SetRow()

void CGUILayouterGrid::SetRow ( const eC_UInt  uiRow)
inline

Set 'row' repositioning parameter, see CGUILayoutHelper::AlignToGrid().

Parameters
uiRow

◆ WriteToStream()

virtual void CGUILayouterGrid::WriteToStream ( const eC_Bool  bWriteClassID = false)
virtual

Writes attributes to the streaming file. A CGUIStreamWriter has to be initialized.

Parameters
bWriteClassIDThis flag is used to switch writing of the class ID, leading and trailing tags. When implementing a new streamable object, check this flag. If it is true, first write the class ID, then continue with this object's attributes, and finally call the base class implementation with this flag set to false (this is the default).

Reimplemented from CGUIGroupLayouter.


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