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:

Public Methods | |
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 &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 Methods | |
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 | |
csLayoutConstraint * | lc |
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
|
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. |
|
Draw the component (only dirty rectangle should be redrawn).
Reimplemented from csComponent. |
|
Fix dialog size when resizing.
Reimplemented from csDialog. |
|
return current phase of layouting
|
|
save size of first phase for later reference
|
|
Handle input events.
Reimplemented from csDialog. |
|
new impl. for csComponent
Reimplemented from csComponent. |
|
make sure next time the layout is drawn the components are layed out first
|
|
recalc positions and sizes of components
Implemented in csAbsoluteLayout, csGridBagLayout, csBorderLayout, csBoxLayout, csFlowLayout, and csGridLayout. |
|
remove a component from the layout
Reimplemented in csGridBagLayout, and csBorderLayout. |
|
set current phase of layouting
|
|
Do auto-placement work if enabled.
Reimplemented from csDialog. |
|
enable or disable 2 phase layouting
|
|
return best size for this layout
Reimplemented from csDialog. Implemented in csAbsoluteLayout, csGridBagLayout, csBorderLayout, csBoxLayout, csFlowLayout, and csGridLayout. |
|
is the two phase layouting enabled ?
|
Member Data Documentation
|
do we need to recalc the positions and sizes of placed components ?
Definition at line 115 of file cslayout.h. |
|
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. |
|
preserve space at the 4 borders of a layout
Definition at line 123 of file cslayout.h. |
|
a pointer to the current constraint
Definition at line 119 of file cslayout.h. |
|
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. |
|
collect all constraints here
Definition at line 117 of file cslayout.h. |
The documentation for this class was generated from the following file:
- csws/cslayout.h
Generated for Crystal Space by doxygen 1.2.18