LayoutCell Class Reference

#include <layout.h>

Inheritance diagram for LayoutCell:

Layout

List of all members.


Detailed Description

This class describes the formatting of a widget in the cell of a layout table.

Horizontally, a widget can either fill the width of the cell (minus the cell padding), or it can retain its size and be flushed left, or flush right, or centered in the cell. The process is similar for the vertical alignment, except that top is represented by LEFT and bottom by RIGHT.

Definition at line 161 of file layout.h.


Public Types

enum  Alignment { LEFT, RIGHT, CENTER, FILL }

Public Member Functions

 LayoutCell ()
 ~LayoutCell ()
LayoutCellsetPadding (int p)
 Sets the padding around the cell content.
LayoutCellsetHAlign (Alignment a)
 Sets the horizontal alignment of the cell content.
LayoutCellsetVAlign (Alignment a)
 Sets the vertical alignment of the cell content.
LayoutCellat (int x, int y)
LayoutCellplace (gcn::Widget *wg, int x, int y, int w=1, int h=1)
void matchColWidth (int n1, int n2)
void setColWidth (int n, int w)
void setRowHeight (int n, int h)
void extend (int x, int y, int w, int h)
void computeSizes ()
 Sets the minimum widths and heights of this cell and of all the inner cells.

Private Types

enum  { NONE, WIDGET, ARRAY }

Private Member Functions

 LayoutCell (LayoutCell const &)
LayoutCelloperator= (LayoutCell const &)
LayoutArraygetArray ()
 Returns the embedded array.
void reflow (int nx, int ny, int nw, int nh)

Private Attributes

union {
   gcn::Widget *   mWidget
   LayoutArray *   mArray
}; 
short mSize [2]
char mPadding
char mExtent [2]
char mAlign [2]
char mNbFill [2]
char mType

Friends

class Layout
class LayoutArray

Member Enumeration Documentation

Enumerator:
LEFT 
RIGHT 
CENTER 
FILL 

Definition at line 168 of file layout.h.

anonymous enum [private]

Enumerator:
NONE 
WIDGET 
ARRAY 

Definition at line 249 of file layout.h.


Constructor & Destructor Documentation

LayoutCell::LayoutCell (  )  [inline]

Definition at line 173 of file layout.h.

LayoutCell::~LayoutCell (  ) 

Definition at line 38 of file layout.cpp.

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


Member Function Documentation

LayoutCell& LayoutCell::setPadding ( int  p  )  [inline]

Sets the padding around the cell content.

Definition at line 180 of file layout.h.

LayoutCell& LayoutCell::setHAlign ( Alignment  a  )  [inline]

Sets the horizontal alignment of the cell content.

Definition at line 186 of file layout.h.

LayoutCell& LayoutCell::setVAlign ( Alignment  a  )  [inline]

Sets the vertical alignment of the cell content.

Definition at line 192 of file layout.h.

LayoutCell& LayoutCell::at ( int  x,
int  y 
) [inline]

See also:
LayoutArray::at

Definition at line 198 of file layout.h.

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

See also:
LayoutArray::place

Definition at line 204 of file layout.h.

void LayoutCell::matchColWidth ( int  n1,
int  n2 
) [inline]

See also:
LayoutArray::matchColWidth

Definition at line 210 of file layout.h.

void LayoutCell::setColWidth ( int  n,
int  w 
) [inline]

See also:
LayoutArray::setColWidth

Definition at line 216 of file layout.h.

void LayoutCell::setRowHeight ( int  n,
int  h 
) [inline]

See also:
LayoutArray::setRowHeight

Definition at line 222 of file layout.h.

void LayoutCell::extend ( int  x,
int  y,
int  w,
int  h 
) [inline]

See also:
LayoutArray::extend.

Definition at line 228 of file layout.h.

void LayoutCell::computeSizes (  ) 

Sets the minimum widths and heights of this cell and of all the inner cells.

Definition at line 70 of file layout.cpp.

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

LayoutArray & LayoutCell::getArray (  )  [private]

Returns the embedded array.

Creates it if the cell does not contain anything yet. Aborts if it contains a widget.

Definition at line 43 of file layout.cpp.

void LayoutCell::reflow ( int  nx,
int  ny,
int  nw,
int  nh 
) [private]

See also:
LayoutArray::reflow

Definition at line 57 of file layout.cpp.


Friends And Related Function Documentation

friend class Layout [friend]

Definition at line 163 of file layout.h.

friend class LayoutArray [friend]

Definition at line 164 of file layout.h.


Member Data Documentation

gcn::Widget* LayoutCell::mWidget

Definition at line 245 of file layout.h.

Definition at line 246 of file layout.h.

union { ... } [private]

short LayoutCell::mSize[2] [private]

Definition at line 265 of file layout.h.

char LayoutCell::mPadding [private]

Definition at line 266 of file layout.h.

char LayoutCell::mExtent[2] [private]

Definition at line 267 of file layout.h.

char LayoutCell::mAlign[2] [private]

Definition at line 268 of file layout.h.

char LayoutCell::mNbFill[2] [private]

Definition at line 269 of file layout.h.

char LayoutCell::mType [private]

Definition at line 270 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