LayoutHelper Class Reference

#include <layouthelper.h>

List of all members.


Detailed Description

A helper class for adding a layout to a Guichan container widget.

The layout will register itself as a widget listener and relayout the widgets in the container dynamically on resize.

Definition at line 34 of file layouthelper.h.


Public Member Functions

 LayoutHelper (gcn::Container *container)
 Constructor.
 ~LayoutHelper ()
 Destructor.
LayoutgetLayout ()
 Gets the layout handler.
void reflowLayout (int w=0, int h=0)
 Computes the position of the widgets according to the current layout.
LayoutCellplace (int x, int y, gcn::Widget *, int w=1, int h=1)
 Adds a widget to the container and sets it at given cell.
ContainerPlacer getPlacer (int x, int y)
 Returns a proxy for adding widgets in an inner table of the layout.
void widgetResized (const gcn::Event &event)
 Called whenever the managed container changes size.

Private Attributes

Layout mLayout
 Layout handler.
gcn::Container * mContainer
 Managed container.

Constructor & Destructor Documentation

LayoutHelper::LayoutHelper ( gcn::Container *  container  ) 

Constructor.

Definition at line 24 of file layouthelper.cpp.

LayoutHelper::~LayoutHelper (  ) 

Destructor.

Definition at line 30 of file layouthelper.cpp.


Member Function Documentation

Layout & LayoutHelper::getLayout (  ) 

Gets the layout handler.

Definition at line 35 of file layouthelper.cpp.

void LayoutHelper::reflowLayout ( int  w = 0,
int  h = 0 
)

Computes the position of the widgets according to the current layout.

Resizes the managed container so that the layout fits.

Note:
This function is meant to be called with fixed-size containers.
Parameters:
w if non-zero, force the container to this width.
h if non-zero, force the container to this height.

Definition at line 51 of file layouthelper.cpp.

LayoutCell & LayoutHelper::place ( int  x,
int  y,
gcn::Widget *  wg,
int  w = 1,
int  h = 1 
)

Adds a widget to the container and sets it at given cell.

Definition at line 40 of file layouthelper.cpp.

ContainerPlacer LayoutHelper::getPlacer ( int  x,
int  y 
)

Returns a proxy for adding widgets in an inner table of the layout.

Definition at line 46 of file layouthelper.cpp.

void LayoutHelper::widgetResized ( const gcn::Event &  event  ) 

Called whenever the managed container changes size.

Definition at line 57 of file layouthelper.cpp.


Member Data Documentation

Layout handler.

Definition at line 80 of file layouthelper.h.

gcn::Container* LayoutHelper::mContainer [private]

Managed container.

Definition at line 81 of file layouthelper.h.


The documentation for this class was generated from the following files:

Generated on Sun Apr 26 17:30:43 2009 for The Mana World by  doxygen 1.5.5