Mana
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes | Friends | List of all members
LayoutCell Class Reference

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

#include <layout.h>

Inheritance diagram for LayoutCell:
Layout

Public Types

enum  Alignment { LEFT , RIGHT , CENTER , FILL }
 

Public Member Functions

 LayoutCell ()=default
 
 ~LayoutCell ()
 
 LayoutCell (LayoutCell const &)=delete
 
LayoutCelloperator= (LayoutCell const &)=delete
 
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

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 = NONE
 

Friends

class Layout
 
class LayoutArray
 

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 158 of file layout.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private
Enumerator
NONE 
WIDGET 
ARRAY 

Definition at line 243 of file layout.h.

◆ Alignment

Enumerator
LEFT 
RIGHT 
CENTER 
FILL 

Definition at line 164 of file layout.h.

Constructor & Destructor Documentation

◆ LayoutCell() [1/2]

LayoutCell::LayoutCell ( )
default

◆ ~LayoutCell()

LayoutCell::~LayoutCell ( )

Definition at line 38 of file layout.cpp.

◆ LayoutCell() [2/2]

LayoutCell::LayoutCell ( LayoutCell const &  )
delete

Member Function Documentation

◆ at()

LayoutCell & LayoutCell::at ( int  x,
int  y 
)
inline
See also
LayoutArray::at

Definition at line 197 of file layout.h.

◆ computeSizes()

void LayoutCell::computeSizes ( )

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

Definition at line 72 of file layout.cpp.

◆ extend()

void LayoutCell::extend ( int  x,
int  y,
int  w,
int  h 
)
inline
See also
LayoutArray::extend.

Definition at line 227 of file layout.h.

◆ getArray()

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 44 of file layout.cpp.

◆ matchColWidth()

void LayoutCell::matchColWidth ( int  n1,
int  n2 
)
inline
See also
LayoutArray::matchColWidth

Definition at line 209 of file layout.h.

◆ operator=()

LayoutCell & LayoutCell::operator= ( LayoutCell const &  )
delete

◆ place()

LayoutCell & LayoutCell::place ( gcn::Widget *  wg,
int  x,
int  y,
int  w = 1,
int  h = 1 
)
inline
See also
LayoutArray::place

Definition at line 203 of file layout.h.

◆ reflow()

void LayoutCell::reflow ( int  nx,
int  ny,
int  nw,
int  nh 
)
private
See also
LayoutArray::reflow

Definition at line 59 of file layout.cpp.

◆ setColWidth()

void LayoutCell::setColWidth ( int  n,
int  w 
)
inline
See also
LayoutArray::setColWidth

Definition at line 215 of file layout.h.

◆ setHAlign()

LayoutCell & LayoutCell::setHAlign ( Alignment  a)
inline

Sets the horizontal alignment of the cell content.

Definition at line 185 of file layout.h.

◆ setPadding()

LayoutCell & LayoutCell::setPadding ( int  p)
inline

Sets the padding around the cell content.

Definition at line 179 of file layout.h.

◆ setRowHeight()

void LayoutCell::setRowHeight ( int  n,
int  h 
)
inline
See also
LayoutArray::setRowHeight

Definition at line 221 of file layout.h.

◆ setVAlign()

LayoutCell & LayoutCell::setVAlign ( Alignment  a)
inline

Sets the vertical alignment of the cell content.

Definition at line 191 of file layout.h.

Friends And Related Symbol Documentation

◆ Layout

friend class Layout
friend

Definition at line 160 of file layout.h.

◆ LayoutArray

friend class LayoutArray
friend

Definition at line 161 of file layout.h.

Member Data Documentation

◆ [union]

union { ... } LayoutCell

◆ mAlign

char LayoutCell::mAlign[2]
private

Definition at line 262 of file layout.h.

◆ mArray

LayoutArray* LayoutCell::mArray

Definition at line 240 of file layout.h.

◆ mExtent

char LayoutCell::mExtent[2]
private

Definition at line 261 of file layout.h.

◆ mNbFill

char LayoutCell::mNbFill[2]
private

Definition at line 263 of file layout.h.

◆ mPadding

char LayoutCell::mPadding
private

Definition at line 260 of file layout.h.

◆ mSize

short LayoutCell::mSize[2]
private

Definition at line 259 of file layout.h.

◆ mType

char LayoutCell::mType = NONE
private

Definition at line 264 of file layout.h.

◆ mWidget

gcn::Widget* LayoutCell::mWidget

Definition at line 239 of file layout.h.


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