SuperTuxKart
Loading...
Searching...
No Matches
Static Public Member Functions | Static Private Member Functions | List of all members
GUIEngine::LayoutManager Class Reference

Static Public Member Functions

static void calculateLayout (PtrVector< Widget > &widgets, AbstractTopLevelContainer *topLevelContainer)
 Recursive call that lays out children widget within parent (or screen if none).
 
static void applyCoords (Widget *self, AbstractTopLevelContainer *topLevelContainer, Widget *parent)
 Find a widget's x, y, w and h coords from what is specified in the XML properties.
 
static void readCoords (Widget *self)
 Find a widget's x, y, w and h coords from what is specified in the XML properties.
 

Static Private Member Functions

static bool convertToCoord (std::string &x, int *absolute, int *percentage)
 Receives as string the raw property value retrieved from XML file.
 
static void recursivelyReadCoords (PtrVector< Widget > &widgets)
 
static void doCalculateLayout (PtrVector< Widget > &widgets, AbstractTopLevelContainer *topLevelContainer, Widget *parent)
 Recursive call that lays out children widget within parent (or screen if none).
 

Member Function Documentation

◆ applyCoords()

void LayoutManager::applyCoords ( Widget self,
AbstractTopLevelContainer topLevelContainer,
Widget parent 
)
static

Find a widget's x, y, w and h coords from what is specified in the XML properties.

Most notably, expands coords relative to parent and percentages.

◆ calculateLayout()

void LayoutManager::calculateLayout ( PtrVector< Widget > &  widgets,
AbstractTopLevelContainer topLevelContainer 
)
static

Recursive call that lays out children widget within parent (or screen if none).

Manages 'horizontal-row' and 'vertical-row' layouts, along with the proportions of the remaining children, as well as absolute sizes and locations.

◆ convertToCoord()

bool LayoutManager::convertToCoord ( std::string &  x,
int *  absolute,
int *  percentage 
)
staticprivate

Receives as string the raw property value retrieved from XML file.

Will try to make sense of it, as an absolute value or a percentage.

Return values : Will write to either absolute or percentage, depending on the case. Returns false if couldn't convert to either

◆ doCalculateLayout()

void LayoutManager::doCalculateLayout ( PtrVector< Widget > &  widgets,
AbstractTopLevelContainer topLevelContainer,
Widget parent 
)
staticprivate

Recursive call that lays out children widget within parent (or screen if none).

Manages 'horizontal-row' and 'vertical-row' layouts, along with the proportions of the remaining children, as well as absolute sizes and locations.

◆ readCoords()

void LayoutManager::readCoords ( Widget self)
static

Find a widget's x, y, w and h coords from what is specified in the XML properties.

(First step; 'applyCoords' is the second step)


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