os::LayoutNode Class Reference
[The Syllable Graphical User Interface API]

Layout node. More...

Inheritance diagram for os::LayoutNode:

os::HLayoutNode os::LayoutSpacer os::VLayoutNode os::HLayoutSpacer os::VLayoutSpacer List of all members.

Public Member Functions

 LayoutNode (const String &cName, float vWeight=1.0f, LayoutNode *pcParent=NULL, View *pcView=NULL)
virtual ~LayoutNode ()
virtual void SetView (View *pcView)
ViewGetView () const
virtual void Layout ()
virtual void SetBorders (const Rect &cBorder)
virtual Rect GetBorders () const
void ExtendMinSize (const Point &cMinSize)
void LimitMaxSize (const Point &cMaxSize)
void ExtendMaxSize (const Point &cMaxSize)
float GetWeight () const
void SetWeight (float vWeight)
virtual void SetFrame (const Rect &cFrame)
virtual Rect GetFrame () const
virtual Rect GetBounds () const
Rect GetAbsFrame () const
void SetHAlignment (alignment eAlignment)
void SetVAlignment (alignment eAlignment)
alignment GetHAlignment () const
alignment GetVAlignment () const
void AdjustPrefSize (Point *pcMinSize, Point *pcMaxSize)
virtual Point GetPreferredSize (bool bLargest)
void AddChild (LayoutNode *pcChild)
LayoutNodeAddChild (View *pcChild, float vWeight=1.0f)
void RemoveChild (LayoutNode *pcChild)
void RemoveChild (View *pcChild)
String GetName () const
const std::vector< LayoutNode * > & GetChildList () const
LayoutNodeGetParent () const
LayoutViewGetLayoutView () const
LayoutNodeFindNode (const String &cName, bool bRecursive=true, bool bIncludeSelf=false)
void SameWidth (const char *pzName1,...)
void SameHeight (const char *pzName1,...)
void SetBorders (const Rect &cBorders, const char *pzFirstName,...)
void SetWeights (float vWeight, const char *pzFirstName,...)
void SetHAlignments (alignment eAlign, const char *pzFirstName,...)
void SetVAlignments (alignment eAlign, const char *pzFirstName,...)
void AddToWidthRing (LayoutNode *pcRing)
void AddToHeightRing (LayoutNode *pcRing)

Protected Member Functions

virtual Point CalculatePreferredSize (bool bLargest)


class LayoutView


class  Private

Detailed Description

This class is a base class for those classes that arrange GUI items by a specific algorithm, such as horizontal layout or vertical layout. Unless you intend to create such an algorithm yourself, you will not use this class directly, but instead one of its subclasses (HLayoutNode or VLayoutNode).
        HLayoutNode* pcRoot = HLayoutNode( "pcRoot" );

        pcRoot->AddChild( new Button( Rect(), "Button1", "One", new Message( ID_ONE ) ), 2.0 );
        pcRoot->AddChild( new HLayoutSpacer( "Spacer" ) );
        pcRoot->AddChild( new Button( Rect(), "Button2", "Two", new Message( ID_TWO ) ), 1.0 );

        LayoutView* pcLayoutView = new LayoutView( pcMyWindow->GetBounds(), "pcLayoutView" );
        pcLayoutView->SetRoot( pcRoot );
        pcMyWindow->AddChild( pcLayoutView );
This example will result in a layout like this:
If the window is made larger, the weights and the spacer will cause the layout to look like this:
[ One ] [Two]
That is, "One" has twice the weight of the two others, thus it will get twice the amount of excess screen space.
See also:
VLayoutNode, HLayoutNode, LayoutSpacer, SameWidth, SameHeight
Kurt Skauen ([email protected])

Constructor & Destructor Documentation

LayoutNode::LayoutNode ( const String cName,
float  vWeight = 1.0f,
LayoutNode pcParent = NULL,
View pcView = NULL 

LayoutNode::~LayoutNode (  )  [virtual]

Member Function Documentation

void LayoutNode::SetView ( View pcView  )  [virtual]

View * LayoutNode::GetView (  )  const

void LayoutNode::Layout (  )  [virtual]

Reimplemented in os::HLayoutNode, and os::VLayoutNode.

void LayoutNode::SetBorders ( const Rect cBorder  )  [virtual]

Rect LayoutNode::GetBorders (  )  const [virtual]

void LayoutNode::ExtendMinSize ( const Point cMinSize  ) 

void LayoutNode::LimitMaxSize ( const Point cMaxSize  ) 

void LayoutNode::ExtendMaxSize ( const Point cMaxSize  ) 

float LayoutNode::GetWeight (  )  const

void LayoutNode::SetWeight ( float  vWeight  ) 

void LayoutNode::SetFrame ( const Rect cFrame  )  [virtual]

Rect LayoutNode::GetFrame (  )  const [virtual]

Rect LayoutNode::GetBounds (  )  const [virtual]

Rect LayoutNode::GetAbsFrame (  )  const

void LayoutNode::SetHAlignment ( alignment  eAlignment  ) 

void LayoutNode::SetVAlignment ( alignment  eAlignment  ) 

alignment LayoutNode::GetHAlignment (  )  const

alignment LayoutNode::GetVAlignment (  )  const

void LayoutNode::AdjustPrefSize ( Point pcMinSize,
Point pcMaxSize 

Point LayoutNode::GetPreferredSize ( bool  bLargest  )  [virtual]

void LayoutNode::AddChild ( LayoutNode pcChild  ) 

LayoutNode * LayoutNode::AddChild ( View pcChild,
float  vWeight = 1.0f 

void LayoutNode::RemoveChild ( LayoutNode pcChild  ) 

void LayoutNode::RemoveChild ( View pcChild  ) 

String LayoutNode::GetName (  )  const

const std::vector< LayoutNode * > & LayoutNode::GetChildList (  )  const

LayoutNode * LayoutNode::GetParent (  )  const

LayoutView * LayoutNode::GetLayoutView (  )  const

LayoutNode * LayoutNode::FindNode ( const String cName,
bool  bRecursive = true,
bool  bIncludeSelf = false 

void LayoutNode::SameWidth ( const char *  pzName1,

void LayoutNode::SameHeight ( const char *  pzName1,

void LayoutNode::SetBorders ( const Rect cBorders,
const char *  pzFirstName,

void LayoutNode::SetWeights ( float  vWeight,
const char *  pzFirstName,

void LayoutNode::SetHAlignments ( alignment  eAlign,
const char *  pzFirstName,

void LayoutNode::SetVAlignments ( alignment  eAlign,
const char *  pzFirstName,

void LayoutNode::AddToWidthRing ( LayoutNode pcRing  ) 

void LayoutNode::AddToHeightRing ( LayoutNode pcRing  ) 

Point LayoutNode::CalculatePreferredSize ( bool  bLargest  )  [protected, virtual]

Reimplemented in os::HLayoutNode, and os::VLayoutNode.

Friends And Related Function Documentation

friend class LayoutView [friend]

Generated on Sat May 9 22:51:33 2009 for Syllable higlevel API by  doxygen 1.5.1