CrystalSpace

Public API Reference

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

csLayout Class Reference
[Layouting]

csLayout is our baseclass for various derived classes like csFlowLayout, csBoxLayout, csGridBagLayout and others. More...

#include <csws/cslayout.h>

Inheritance diagram for csLayout:

csDialog csComponent csAbsoluteLayout csBoxLayout csFlowLayout csGridLayout csLayout2 csBorderLayout csGridBagLayout List of all members.

Public Member Functions

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 &sugw, int &sugh)=0
 return best size for this layout
virtual void LayoutContainer ()=0
 recalc positions and sizes of components
virtual void InvalidateLayout ()
 make sure next time the layout is drawn the components are layed out first
virtual int GetLayoutingPhase ()
 return current phase of layouting
virtual void SetLayoutingPhase (int phase)
 set current phase of layouting
virtual csPoint GetPhase0Size ()
 save size of first phase for later reference
virtual bool TwoPhaseLayoutingEnabled ()
 is the two phase layouting enabled ?
virtual void Insert (csComponent *child)
 new impl. for csComponent
virtual bool HandleEvent (iEvent &Event)
 Handle input events.
virtual void Draw ()
 Draw the component (only dirty rectangle should be redrawn).
virtual bool SetRect (int xmin, int ymin, int xmax, int ymax)
 Do auto-placement work if enabled.
virtual void FixSize (int &newWidth, int &newHeight)
 Fix dialog size when resizing.

Static Public Member Functions

void SetTwoPhaseLayoutingGlobally (bool on)
 enable or disable 2 phase layouting

Public Attributes

csRect insets
 preserve space at the 4 borders of a layout
csLayoutConstraint c
 Here we have the constraint a components will be layout with.

Protected Attributes

bool bRecalcLayout
 do we need to recalc the positions and sizes of placed components ?
csConstraintVector vConstraints
 collect all constraints here
csLayoutConstraintlc
 a pointer to the current constraint

Static Protected Attributes

bool mUseTwoPhaseLayoutingGlobally
 A shortcoming of the original java layouts is that components are asked for its preferred size without knowing at what size its parent component will be layout in the end.

Detailed Description

csLayout is our baseclass for various derived classes like csFlowLayout, csBoxLayout, csGridBagLayout and others.

Definition at line 103 of file cslayout.h.


Member Function Documentation

virtual csLayoutConstraint* csLayout::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 in csBorderLayout.

virtual void csLayout::Draw  )  [virtual]
 

Draw the component (only dirty rectangle should be redrawn).

Reimplemented from csComponent.

virtual void csLayout::FixSize int &  newWidth,
int &  newHeight
[virtual]
 

Fix dialog size when resizing.

Reimplemented from csDialog.

virtual int csLayout::GetLayoutingPhase  )  [virtual]
 

return current phase of layouting

virtual csPoint csLayout::GetPhase0Size  )  [virtual]
 

save size of first phase for later reference

virtual bool csLayout::HandleEvent iEvent Event  )  [virtual]
 

Handle input events.

Reimplemented from csDialog.

virtual void csLayout::Insert csComponent child  )  [virtual]
 

new impl. for csComponent

Reimplemented from csComponent.

virtual void csLayout::InvalidateLayout  )  [virtual]
 

make sure next time the layout is drawn the components are layed out first

virtual void csLayout::LayoutContainer  )  [pure virtual]
 

recalc positions and sizes of components

Implemented in csAbsoluteLayout, csGridBagLayout, csBorderLayout, csBoxLayout, csFlowLayout, and csGridLayout.

virtual void csLayout::RemoveLayoutComponent csComponent comp  )  [virtual]
 

remove a component from the layout

Reimplemented in csGridBagLayout, and csBorderLayout.

virtual void csLayout::SetLayoutingPhase int  phase  )  [virtual]
 

set current phase of layouting

virtual bool csLayout::SetRect int  xmin,
int  ymin,
int  xmax,
int  ymax
[virtual]
 

Do auto-placement work if enabled.

Reimplemented from csDialog.

void csLayout::SetTwoPhaseLayoutingGlobally bool  on  )  [static]
 

enable or disable 2 phase layouting

virtual void csLayout::SuggestSize int &  sugw,
int &  sugh
[pure virtual]
 

return best size for this layout

Reimplemented from csDialog.

Implemented in csAbsoluteLayout, csGridBagLayout, csBorderLayout, csBoxLayout, csFlowLayout, and csGridLayout.

virtual bool csLayout::TwoPhaseLayoutingEnabled  )  [virtual]
 

is the two phase layouting enabled ?


Member Data Documentation

bool csLayout::bRecalcLayout [protected]
 

do we need to recalc the positions and sizes of placed components ?

Definition at line 115 of file cslayout.h.

csLayoutConstraint csLayout::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 in csGridBagLayout, and csBorderLayout.

Definition at line 130 of file cslayout.h.

csRect csLayout::insets
 

preserve space at the 4 borders of a layout

Definition at line 123 of file cslayout.h.

csLayoutConstraint* csLayout::lc [protected]
 

a pointer to the current constraint

Definition at line 119 of file cslayout.h.

bool csLayout::mUseTwoPhaseLayoutingGlobally [static, protected]
 

A shortcoming of the original java layouts is that components are asked for its preferred size without knowing at what size its parent component will be layout in the end.

So the two phase layout is an attempt to overcome this. Currently only FlowLayout uses this.

Definition at line 112 of file cslayout.h.

csConstraintVector csLayout::vConstraints [protected]
 

collect all constraints here

Definition at line 117 of file cslayout.h.


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