![]() |
Public API Reference |
#include <csbdrlay.h>
Inheritance diagram for csBorderLayout:
Public Methods | |
csBorderLayout (csComponent *pParent, int hgap, int vgap) | |
Make sure there is at least a horizontal gap of hgap pixels and a vertical gap of vgap pixels. More... | |
virtual csLayoutConstraint * | AddLayoutComponent (csComponent *comp) |
A components is added to a layout by creating it and passing the layout component as its parent component. More... | |
virtual void | RemoveLayoutComponent (csComponent *comp) |
remove a component from the layout. More... | |
virtual void | SuggestSize (int &w, int &h) |
return best size for this layout. More... | |
virtual void | LayoutContainer () |
recalc positions and sizes of components. More... | |
Public Attributes | |
csBorderConstraint | c |
Here we have the constraint a components will be layout with. More... | |
Protected Types | |
enum | ALIGNMENT_ENUM_INTERNAL |
for your convenience here are prebuild constraints. More... |
They are located in the north, south, west, east and center of the canvas.
Sample:
csBorderLayout *border = new csFlowLayout (wnd); wnd->SendCommand (cscmdWindowSetClient, (void*)border);
csBorderConstraint *blc[5] = {csBorderLayout::CENTER, csBorderLayout::EAST, csBorderLayout::NORTH, csBorderLayout::WEST, csBorderLayout::SOUTH}; for (int k=0; k<5; k++) { border->c = *blc[k]; csButton *b= new csButton (border, 7000+k); b->SetPos ((9+k)*10, 20); b->SetSuggestedSize (0, 0); char text[20]; sprintf (text, "Test d", k); b->SetText (text); } csWindow *wnd = new csWindow (theApp, "BorderLayout", CSWS_DEFAULTVALUE & ~CSWS_MENUBAR); wnd->SetSize (400, 300); wnd->Center (); wnd->Select ();
Definition at line 90 of file csbdrlay.h.
|
for your convenience here are prebuild constraints.
Definition at line 143 of file csbdrlay.h. |
|
Make sure there is at least a horizontal gap of hgap pixels and a vertical gap of vgap pixels.
|
|
A components is added to a layout by creating it and passing the layout component as its parent component. If you insist of doing some voodoo you should use AddLayoutComponent to add it to the layout. IN: the component to add OUT: the constraint that is used to layout the component (a copy of variable c see above) Reimplemented from csLayout. |
|
recalc positions and sizes of components.
Implements csLayout. |
|
remove a component from the layout.
Reimplemented from csLayout. |
|
return best size for this layout.
Implements csLayout. |
|
Here we have the constraint a components will be layout with. When a component is added a copy of this will be made and attached to the component. Reimplemented from csLayout. Definition at line 128 of file csbdrlay.h. |