csBorderLayout Class Reference
[Layouting]
Displays upto 5 components.
More...
#include <csws/csbdrlay.h>
Inheritance diagram for csBorderLayout:

Public Member Functions | |
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. | |
virtual csLayoutConstraint * | AddLayoutComponent (csComponent *comp) |
A components is added to a layout by creating it and passing the layout component as its parent component. | |
virtual void | RemoveLayoutComponent (csComponent *comp) |
remove a component from the layout | |
virtual void | SuggestSize (int &w, int &h) |
return best size for this layout | |
virtual void | LayoutContainer () |
recalc positions and sizes of components | |
Public Attributes | |
csBorderConstraint | c |
Here we have the constraint a components will be layout with. | |
Protected Types | |
enum | ALIGNMENT_ENUM_INTERNAL |
for your convenience here are prebuild constraints More... |
Detailed Description
Displays upto 5 components.They are located in the north, south, west, east and center of the canvas.
Sample:
csWindow *wnd = new csWindow (theApp, "BorderLayout", CSWS_DEFAULTVALUE & ~CSWS_MENUBAR); wnd->SetSize (400, 300); wnd->Center (); wnd->Select ();
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); }
Definition at line 92 of file csbdrlay.h.
Member Enumeration Documentation
|
for your convenience here are prebuild constraints
Definition at line 145 of file csbdrlay.h. |
Constructor & Destructor Documentation
|
Make sure there is at least a horizontal gap of hgap pixels and a vertical gap of vgap pixels.
|
Member Function Documentation
|
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. |
Member Data Documentation
|
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 130 of file csbdrlay.h. |
The documentation for this class was generated from the following file:
- csws/csbdrlay.h
Generated for Crystal Space by doxygen 1.3.9.1