CrystalSpace

Public API Reference

Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

csFlowLayout Class Reference
[Layouting]

In a flow layout components are displayed in a row and wraped at parents boundaries. More...

#include <csflwlay.h>

Inheritance diagram for csFlowLayout:

csLayout csDialog csComponent List of all members.

Public Types

enum  ALIGNMNET_ENUM { CENTER = 0 }

Public Methods

 csFlowLayout (csComponent *pParent)
 Create a flow layout.

int GetAlignment ()
 Get the aligning of components that dont fill the canvas width.

int GetHgap ()
 Get the horizontal gap between components.

int GetVgap ()
 Get the vertical gap between components.

void SetAlignment (int align)
 Set the aligning of components that dont fill the canvas width.

void SetHgap (int hgap)
 Set the horizontal gap between components.

void SetVgap (int vgap)
 Set the vertical gap between components.

virtual void SuggestSize (int &sugw, int &sugh)
 return best size for this layout

virtual void LayoutContainer ()
 recalc positions and sizes of components


Detailed Description

In a flow layout components are displayed in a row and wraped at parents boundaries.

Sample:

csWindow *wnd = new csWindow (theApp, "FlowLayout", CSWS_DEFAULTVALUE & ~CSWS_MENUBAR); wnd->SetSize (400, 300); wnd->Center (); wnd->Select ();

csFlowLayout *flow = new csFlowLayout (wnd); wnd->SendCommand (cscmdWindowSetClient, (void*)flow); for (int k=0; k<10; k++) { char tt[20]; sprintf (tt, "t d", k); csButton *b= new csButton (flow, 7000+k); b->SetPos (k*20, 20); b->SetSuggestedSize (0, 0); b->SetText (tt); }

Definition at line 59 of file csflwlay.h.


Member Enumeration Documentation

enum csFlowLayout::ALIGNMNET_ENUM
 

Enumeration values:
CENTER  If the last row of components do not fill the entire width of the layout then they are aligned either left or right or they are centered.

Definition at line 98 of file csflwlay.h.


Constructor & Destructor Documentation

csFlowLayout::csFlowLayout (  csComponent *    pParent ) 
 

Create a flow layout.

The default aligning is CENTER. The default horizontal and vertical gap between components is 0.


Member Function Documentation

int csFlowLayout::GetAlignment (    ) 
 

Get the aligning of components that dont fill the canvas width.

int csFlowLayout::GetHgap (    ) 
 

Get the horizontal gap between components.

int csFlowLayout::GetVgap (    ) 
 

Get the vertical gap between components.

virtual void csFlowLayout::LayoutContainer (    )  [virtual]
 

recalc positions and sizes of components

Implements csLayout.

void csFlowLayout::SetAlignment (  int    align ) 
 

Set the aligning of components that dont fill the canvas width.

void csFlowLayout::SetHgap (  int    hgap ) 
 

Set the horizontal gap between components.

void csFlowLayout::SetVgap (  int    vgap ) 
 

Set the vertical gap between components.

virtual void csFlowLayout::SuggestSize (  int &    sugw,
int &    sugh
)  [virtual]
 

return best size for this layout

Implements csLayout.


The documentation for this class was generated from the following file:
Generated for Crystal Space by doxygen 1.2.18