#include <csflwlay.h>
Inheritance diagram for csFlowLayout:
Public Types | |
enum | ALIGNMNET_ENUM { LEFT = 1, RIGHT = 2, LEADING = LEFT, TRAILING = RIGHT } |
Public Methods | |
csFlowLayout (csComponent *pParent) | |
Create a flow layout. More... | |
csFlowLayout (csComponent *pParent, int align) | |
csFlowLayout (csComponent *pParent, int align, int hgap, int vgap) | |
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. | |
Protected Attributes | |
int | mAlign |
int | mHgap |
int | mVgap |
csPoint | mPrefDimOfPhase1 |
Sample:
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); } csWindow *wnd = new csWindow (theApp, "FlowLayout", CSWS_DEFAULTVALUE & ~CSWS_MENUBAR); wnd->SetSize (400, 300); wnd->Center (); wnd->Select ();
|
Create a flow layout. The default aligning is CENTER. The default horizontal and vertical gap between components is 0. |