ManaPlus
|
#include <layoutcell.h>
Public Types | |
enum | Alignment { LEFT = 0 , RIGHT , CENTER , FILL } |
enum | { NONE = 0 , WIDGET , ARRAY } |
Public Member Functions | |
virtual | ~LayoutCell () |
LayoutCell & | setPadding (int p) |
int | getVPadding () const |
int | getHPadding () const |
LayoutCell & | setVPadding (int p) |
LayoutCell & | setHPadding (int p) |
LayoutCell & | setHAlign (const Alignment a) |
LayoutCell & | setVAlign (const Alignment a) |
LayoutCell & | at (const int x, const int y) |
LayoutCell & | place (Widget *const wg, const int x, const int y, const int w, const int h) |
void | matchColWidth (const int n1, const int n2) |
void | setColWidth (const int n, const int w) |
void | setRowHeight (const int n, const int h) |
void | extend (const int x, const int y, const int w, const int h) |
void | computeSizes () |
void | setType (int t) |
int | getWidth () const |
int | getHeight () const |
void | setWidth (const int w) |
void | setHeight (const int h) |
Static Public Attributes | |
static LayoutCell | emptyCell |
Private Member Functions | |
LayoutCell () | |
LayoutCell (LayoutCell const &) | |
LayoutCell & | operator= (LayoutCell const &) |
LayoutArray & | getArray () |
void | reflow (int nx, int ny, int nw, int nh) |
Private Attributes | |
union { | |
Widget * mWidget | |
LayoutArray * mArray | |
}; | |
int | mSize [2] |
int | mHPadding |
int | mVPadding |
int | mExtent [2] |
Alignment | mAlign [2] |
int | mNbFill [2] |
int | mType |
Friends | |
class | Layout |
class | LayoutArray |
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 39 of file layoutcell.h.
anonymous enum |
|
virtual |
Definition at line 36 of file layoutcell.cpp.
|
inlineprivate |
Definition at line 159 of file layoutcell.h.
|
explicitprivate |
LayoutCell & LayoutCell::at | ( | const int | x, |
const int | y | ||
) |
Definition at line 106 of file layoutcell.cpp.
References LayoutArray::at(), getArray(), x, and y.
Referenced by ContainerPlacer::at(), and LayoutHelper::getPlacer().
void LayoutCell::computeSizes | ( | ) |
Sets the minimum widths and heights of this cell and of all the inner cells.
Definition at line 79 of file layoutcell.cpp.
References ARRAY, computeSizes(), LayoutArray::getSize(), mArray, LayoutArray::mCells, mSize, and mType.
Referenced by computeSizes(), and Layout::reflow().
void LayoutCell::extend | ( | const int | x, |
const int | y, | ||
const int | w, | ||
const int | h | ||
) |
Definition at line 133 of file layoutcell.cpp.
References LayoutArray::extend(), getArray(), x, and y.
Referenced by TradeWindow::TradeWindow().
|
private |
Returns the embedded array. Creates it if the cell does not contain anything yet. Aborts if it contains a widget.
Definition at line 42 of file layoutcell.cpp.
References ARRAY, FILL, LayoutArray, mAlign, mArray, mExtent, mHPadding, mType, mVPadding, tempArray, and WIDGET.
Referenced by at(), extend(), Layout::Layout(), matchColWidth(), place(), setColWidth(), and setRowHeight().
|
inline |
|
inline |
Definition at line 66 of file layoutcell.h.
References mHPadding.
Referenced by StatsClanTab::updateClan(), and RelationClanTab::updateClan().
|
inline |
Definition at line 63 of file layoutcell.h.
References mVPadding.
Referenced by StatsClanTab::updateClan(), and RelationClanTab::updateClan().
|
inline |
Definition at line 137 of file layoutcell.h.
References mExtent.
Referenced by InventoryWindow::widgetResized().
void LayoutCell::matchColWidth | ( | const int | n1, |
const int | n2 | ||
) |
Definition at line 118 of file layoutcell.cpp.
References getArray(), and LayoutArray::matchColWidth().
Referenced by InfoClanTab::InfoClanTab(), MapDebugTab::MapDebugTab(), NetDebugTab::NetDebugTab(), and TargetDebugTab::TargetDebugTab().
|
private |
LayoutCell & LayoutCell::place | ( | Widget *const | wg, |
const int | x, | ||
const int | y, | ||
const int | w, | ||
const int | h | ||
) |
Definition at line 111 of file layoutcell.cpp.
References getArray(), LayoutArray::place(), x, and y.
Referenced by ContainerPlacer::operator()(), LayoutHelper::place(), and Window::place().
|
private |
Definition at line 64 of file layoutcell.cpp.
References ARRAY, mArray, mHPadding, mType, mVPadding, mWidget, NONE, LayoutArray::reflow(), and Widget::setDimension().
Referenced by LayoutArray::reflow(), and Layout::reflow().
void LayoutCell::setColWidth | ( | const int | n, |
const int | w | ||
) |
Definition at line 123 of file layoutcell.cpp.
References getArray(), and LayoutArray::setColWidth().
Referenced by OutfitWindow::OutfitWindow(), and TradeWindow::TradeWindow().
|
inline |
Sets the horizontal alignment of the cell content.
Definition at line 84 of file layoutcell.h.
References mAlign.
Referenced by ConnectionDialog::ConnectionDialog(), and LoginDialog::LoginDialog().
|
inline |
|
inline |
Sets the horisontal padding around the cell content.
Definition at line 78 of file layoutcell.h.
References mHPadding.
|
inline |
Sets the padding around the cell content.
Definition at line 60 of file layoutcell.h.
References mHPadding, and mVPadding.
Referenced by ChangePasswordDialog::ChangePasswordDialog(), DidYouKnowWindow::DidYouKnowWindow(), EditServerDialog::EditServerDialog(), HelpWindow::HelpWindow(), InventoryWindow::InventoryWindow(), KillStats::KillStats(), Layout::Layout(), ServerDialog::ServerDialog(), ServerInfoWindow::ServerInfoWindow(), Layout::setMargin(), ShortcutWindow::ShortcutWindow(), StatusWindow::StatusWindow(), TradeWindow::TradeWindow(), and WorldSelectDialog::WorldSelectDialog().
void LayoutCell::setRowHeight | ( | const int | n, |
const int | h | ||
) |
Definition at line 128 of file layoutcell.cpp.
References getArray(), and LayoutArray::setRowHeight().
Referenced by NpcDialog::buildLayout(), DidYouKnowWindow::DidYouKnowWindow(), HelpWindow::HelpWindow(), BuyDialog::init(), InventoryWindow::InventoryWindow(), MailWindow::MailWindow(), OutfitWindow::OutfitWindow(), SellDialog::postInit(), TextSelectDialog::postInit(), QuestsWindow::QuestsWindow(), ServerDialog::ServerDialog(), ServerInfoWindow::ServerInfoWindow(), ShopWindow::ShopWindow(), ShortcutWindow::ShortcutWindow(), StatusWindow::StatusWindow(), TradeWindow::TradeWindow(), UpdaterWindow::UpdaterWindow(), and WorldSelectDialog::WorldSelectDialog().
|
inline |
Definition at line 134 of file layoutcell.h.
References mType.
Referenced by InventoryWindow::widgetResized().
|
inline |
Sets the vertical alignment of the cell content.
Definition at line 90 of file layoutcell.h.
References mAlign.
|
inline |
Sets the vertical padding around the cell content.
Definition at line 72 of file layoutcell.h.
References mVPadding.
|
inline |
Definition at line 143 of file layoutcell.h.
References mExtent.
Referenced by InventoryWindow::widgetResized().
|
friend |
Definition at line 41 of file layoutcell.h.
|
friend |
Definition at line 42 of file layoutcell.h.
Referenced by getArray().
union { ... } |
|
static |
Definition at line 156 of file layoutcell.h.
Referenced by ContainerPlacer::operator()().
|
private |
Definition at line 200 of file layoutcell.h.
Referenced by getArray(), LayoutCell(), LayoutArray::place(), setHAlign(), and setVAlign().
LayoutArray* LayoutCell::mArray |
Definition at line 182 of file layoutcell.h.
Referenced by computeSizes(), getArray(), reflow(), and ~LayoutCell().
|
private |
Definition at line 199 of file layoutcell.h.
Referenced by LayoutArray::extend(), getArray(), getHeight(), LayoutArray::getSizes(), getWidth(), LayoutCell(), LayoutArray::place(), setHeight(), and setWidth().
|
private |
Definition at line 197 of file layoutcell.h.
Referenced by getArray(), getHPadding(), LayoutArray::place(), Layout::reflow(), reflow(), setHPadding(), and setPadding().
|
private |
Definition at line 201 of file layoutcell.h.
Referenced by LayoutCell().
|
private |
Definition at line 196 of file layoutcell.h.
Referenced by computeSizes(), LayoutArray::getSizes(), LayoutCell(), LayoutArray::place(), and Layout::reflow().
|
private |
Definition at line 202 of file layoutcell.h.
Referenced by computeSizes(), getArray(), LayoutArray::getSizes(), LayoutArray::place(), LayoutArray::reflow(), reflow(), setType(), and ~LayoutCell().
|
private |
Definition at line 198 of file layoutcell.h.
Referenced by getArray(), LayoutArray::getSizes(), getVPadding(), LayoutArray::place(), Layout::reflow(), reflow(), setPadding(), and setVPadding().
Widget* LayoutCell::mWidget |
Definition at line 181 of file layoutcell.h.
Referenced by LayoutArray::place(), and reflow().