CrystalSpace

Public API Reference

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

csBorderLayout Class Reference
[Layouting]

Displays upto 5 components. More...

#include <csbdrlay.h>

Inheritance diagram for csBorderLayout:

csLayout2 csLayout csDialog csComponent List of all members.

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.

virtual csLayoutConstraintAddLayoutComponent (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 90 of file csbdrlay.h.


Member Enumeration Documentation

enum csBorderLayout::ALIGNMENT_ENUM_INTERNAL [protected]
 

for your convenience here are prebuild constraints

Definition at line 143 of file csbdrlay.h.


Constructor & Destructor Documentation

csBorderLayout::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.


Member Function Documentation

virtual csLayoutConstraint* csBorderLayout::AddLayoutComponent csComponent   comp [virtual]
 

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.

virtual void csBorderLayout::LayoutContainer   [virtual]
 

recalc positions and sizes of components

Implements csLayout.

virtual void csBorderLayout::RemoveLayoutComponent csComponent   comp [virtual]
 

remove a component from the layout

Reimplemented from csLayout.

virtual void csBorderLayout::SuggestSize int &    w,
int &    h
[virtual]
 

return best size for this layout

Implements csLayout.


Member Data Documentation

csBorderConstraint csBorderLayout::c
 

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.


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