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

This class is an helper for setting the position of widgets. More...

#include <layout.h>

Inheritance diagram for Layout:
LayoutCell

Public Types

enum  { AUTO_DEF = -42 , AUTO_SET = -43 , AUTO_ADD = -44 }
 When the minimum size of the layout is less than the available size, the remaining pixels are equally split amongst the FILL items. More...
 
- Public Types inherited from LayoutCell
enum  Alignment { LEFT , RIGHT , CENTER , FILL }
 

Public Member Functions

 Layout ()
 
void setMargin (int m)
 Sets the margin around the layout.
 
void reflow (int &nW, int &nH)
 Sets the positions of all the widgets.
 
- Public Member Functions inherited from LayoutCell
 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 Attributes

bool mComputed
 

Detailed Description

This class is an helper for setting the position of widgets.

They are positioned along the cells of some rectangular tables. The layout may either be a single table or a tree of nested tables.

The size of a given table column can either be set manually or be chosen from the widest widget of the column. An empty column has a AUTO_DEF width, which means it will be extended so that the layout fits its minimum width.

The process is similar for table rows. By default, there is a spacing of 4 pixels between rows and between columns, and a margin of 6 pixels around the whole layout.

Definition at line 280 of file layout.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

When the minimum size of the layout is less than the available size, the remaining pixels are equally split amongst the FILL items.

Enumerator
AUTO_DEF 

Default value, behaves like AUTO_ADD.

AUTO_SET 

Uses the share as the new size.

AUTO_ADD 

Adds the share to the current size.

Definition at line 301 of file layout.h.

Constructor & Destructor Documentation

◆ Layout()

Layout::Layout ( )

Definition at line 315 of file layout.cpp.

Member Function Documentation

◆ reflow()

void Layout::reflow ( int &  nW,
int &  nH 
)

Sets the positions of all the widgets.

See also
LayoutArray::reflow

Definition at line 321 of file layout.cpp.

◆ setMargin()

void Layout::setMargin ( int  m)
inline

Sets the margin around the layout.

Definition at line 288 of file layout.h.

Member Data Documentation

◆ mComputed

bool Layout::mComputed
private

Definition at line 309 of file layout.h.


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