CrystalSpace

Public API Reference

Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound 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 <cslayout.h>

Inheritance diagram for csLayout:

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

Public Methods

virtual csLayoutConstraintAddLayoutComponent (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 &sugw, int &sugh)=0
 return best size for this layout. More...

virtual void LayoutContainer ()=0
 recalc positions and sizes of components. More...

virtual void InvalidateLayout ()
 make sure next time the layout is drawn the components are layed out first. More...

virtual int GetLayoutingPhase ()
 return current phase of layouting. More...

virtual void SetLayoutingPhase (int phase)
 set current phase of layouting. More...

virtual csPoint GetPhase0Size ()
 save size of first phase for later reference. More...

virtual bool TwoPhaseLayoutingEnabled ()
 is the two phase layouting enabled ? More...

virtual void Insert (csComponent *child)
 new impl. for csComponent. More...

virtual bool HandleEvent (iEvent &Event)
 Handle input events. More...

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

virtual bool SetRect (int xmin, int ymin, int xmax, int ymax)
 Do auto-placement work if enabled. More...

virtual void FixSize (int &newWidth, int &newHeight)
 Fix dialog size when resizing. More...


Static Public Methods

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


Public Attributes

csRect insets
 preserve space at the 4 borders of a layout. More...

csLayoutConstraint c
 Here we have the constraint a components will be layout with. More...


Protected Attributes

bool bRecalcLayout
 do we need to recalc the positions and sizes of placed components ? More...

csConstraintVector vConstraints
 collect all constraints here. More...

csLayoutConstraintlc
 a pointer to the current constraint. More...


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. More...


Detailed Description

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

Definition at line 95 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.

virtual void csLayout::RemoveLayoutComponent csComponent   comp [virtual]
 

remove a component from the layout.

Reimplemented in csGridBagLayout.

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.

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 107 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.

Definition at line 122 of file cslayout.h.

csRect csLayout::insets
 

preserve space at the 4 borders of a layout.

Definition at line 115 of file cslayout.h.

csLayoutConstraint* csLayout::lc [protected]
 

a pointer to the current constraint.

Definition at line 111 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 104 of file cslayout.h.

csConstraintVector csLayout::vConstraints [protected]
 

collect all constraints here.

Definition at line 109 of file cslayout.h.


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