LayoutArray Class Reference

#include <layout.h>

List of all members.


Detailed Description

This class contains a rectangular array of cells.

Definition at line 69 of file layout.h.


Public Member Functions

 LayoutArray ()
 ~LayoutArray ()
LayoutCellat (int x, int y, int w=1, int h=1)
 Returns a reference on the cell at given position.
LayoutCellplace (gcn::Widget *, int x, int y, int w=1, int h=1)
 Places a widget in a given cell.
void setColWidth (int n, int w)
 Sets the minimum width of a column.
void setRowHeight (int n, int h)
 Sets the minimum height of a row.
void matchColWidth (int n1, int n2)
 Sets the widths of two columns to the maximum of their widths.
void extend (int x, int y, int w, int h)
 Spawns a cell over several columns/rows.
void reflow (int nX, int nY, int nW, int nH)
 Computes and sets the positions of all the widgets.

Private Member Functions

 LayoutArray (LayoutArray const &)
LayoutArrayoperator= (LayoutArray const &)
void align (int &pos, int &size, int dim, LayoutCell const &cell, short *sizes) const
 Gets the position and size of a widget along a given axis.
void resizeGrid (int w, int h)
 Ensures the private vectors are large enough.
std::vector< short > getSizes (int dim, int upp) const
 Gets the column/row sizes along a given axis.
int getSize (int dim) const
 Gets the total size along a given axis.

Private Attributes

std::vector< short > mSizes [2]
std::vector< std::vector
< LayoutCell * > > 
mCells
char mSpacing

Friends

class LayoutCell

Constructor & Destructor Documentation

LayoutArray::LayoutArray (  ) 

Definition at line 90 of file layout.cpp.

LayoutArray::~LayoutArray (  ) 

Definition at line 94 of file layout.cpp.

LayoutArray::LayoutArray ( LayoutArray const &   )  [private]


Member Function Documentation

LayoutCell & LayoutArray::at ( int  x,
int  y,
int  w = 1,
int  h = 1 
)

Returns a reference on the cell at given position.

Definition at line 107 of file layout.cpp.

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

Places a widget in a given cell.

Parameters:
w number of columns the widget spawns.
h number of rows the widget spawns.
Note:
When w is 1, the width of column x is reset to zero if it was AUTO_DEF. Similarly for h.

Definition at line 171 of file layout.cpp.

void LayoutArray::setColWidth ( int  n,
int  w 
)

Sets the minimum width of a column.

Definition at line 143 of file layout.cpp.

void LayoutArray::setRowHeight ( int  n,
int  h 
)

Sets the minimum height of a row.

Definition at line 149 of file layout.cpp.

void LayoutArray::matchColWidth ( int  n1,
int  n2 
)

Sets the widths of two columns to the maximum of their widths.

Definition at line 155 of file layout.cpp.

void LayoutArray::extend ( int  x,
int  y,
int  w,
int  h 
)

Spawns a cell over several columns/rows.

Definition at line 164 of file layout.cpp.

void LayoutArray::reflow ( int  nX,
int  nY,
int  nW,
int  nH 
)

Computes and sets the positions of all the widgets.

Parameters:
nW width of the array, used to resize the AUTO_ columns.
nH height of the array, used to resize the AUTO_ rows.

Definition at line 283 of file layout.cpp.

LayoutArray& LayoutArray::operator= ( LayoutArray const &   )  [private]

void LayoutArray::align ( int &  pos,
int &  size,
int  dim,
LayoutCell const &  cell,
short *  sizes 
) const [private]

Gets the position and size of a widget along a given axis.

Definition at line 190 of file layout.cpp.

void LayoutArray::resizeGrid ( int  w,
int  h 
) [private]

Ensures the private vectors are large enough.

Definition at line 118 of file layout.cpp.

std::vector< short > LayoutArray::getSizes ( int  dim,
int  upp 
) const [private]

Gets the column/row sizes along a given axis.

Parameters:
upp target size for the array. Ignored if AUTO_DEF.

Definition at line 214 of file layout.cpp.

int LayoutArray::getSize ( int  dim  )  const [private]

Gets the total size along a given axis.

Definition at line 270 of file layout.cpp.


Friends And Related Function Documentation

friend class LayoutCell [friend]

Definition at line 71 of file layout.h.


Member Data Documentation

std::vector< short > LayoutArray::mSizes[2] [private]

Definition at line 148 of file layout.h.

std::vector< std::vector < LayoutCell * > > LayoutArray::mCells [private]

Definition at line 149 of file layout.h.

char LayoutArray::mSpacing [private]

Definition at line 151 of file layout.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