Crazy Eddie's GUI System
0.8.4
|
A Layout Container window layouting it's children into a grid. More...
Public Types | |
enum | AutoPositioning { AP_Disabled, AP_LeftToRight, AP_TopToBottom } |
Public Member Functions | |
GridLayoutContainer (const String &type, const String &name) | |
Constructor for GUISheet windows. | |
virtual | ~GridLayoutContainer (void) |
Destructor for GUISheet windows. | |
void | setGridDimensions (size_t width, size_t height) |
Sets grid's dimensions. | |
void | setGrid (const Sizef &size) |
Sets grid's dimensions. | |
size_t | getGridWidth () const |
Retrieves grid width, the amount of cells in one row. | |
size_t | getGridHeight () const |
Retrieves grid height, the amount of rows in the grid. | |
Sizef | getGrid () const |
Retrieves grid width, the amount of cells in one row. | |
void | setAutoPositioning (AutoPositioning positioning) |
Sets new auto positioning method. | |
AutoPositioning | getAutoPositioning () const |
Retrieves current auto positioning method. | |
void | setNextAutoPositioningIdx (size_t idx) |
Sets the next auto positioning "sequence position", this will be used next time when addChild is called. | |
size_t | getNextAutoPositioningIdx () const |
Retrieves auto positioning "sequence position", this will be used next time when addChild is called. | |
void | autoPositioningSkipCells (size_t cells) |
Skips given number of cells in the auto positioning sequence. | |
void | addChildToPosition (Window *window, size_t gridX, size_t gridY) |
Add the specified Window to specified grid position as a child of this Grid Layout Container. If the Window window is already attached to a Window, it is detached before being added to this Window. | |
Window * | getChildAtPosition (size_t gridX, size_t gridY) |
Retrieves child window that is currently at given grid position. | |
void | removeChildFromPosition (size_t gridX, size_t gridY) |
Removes the child window that is currently at given grid position. | |
virtual void | swapChildPositions (size_t wnd1, size_t wnd2) |
Swaps positions of 2 windows given by their index. | |
void | swapChildPositions (size_t gridX1, size_t gridY1, size_t gridX2, size_t gridY2) |
Swaps positions of 2 windows given by grid positions. | |
void | swapChildren (Window *wnd1, Window *wnd2) |
Swaps positions of given windows. | |
void | swapChildren (Window *wnd1, const String &wnd2) |
Swaps positions of given windows. | |
void | swapChildren (const String &wnd1, Window *wnd2) |
Swaps positions of given windows. | |
void | moveChildToPosition (Window *wnd, size_t gridX, size_t gridY) |
Moves given child window to given grid position. | |
void | moveChildToPosition (const String &wnd, size_t gridX, size_t gridY) |
Moves named child window to given grid position. | |
virtual void | layout () |
Static Public Attributes | |
static const String | WidgetTypeName |
The unique typename of this widget. | |
static const String | DummyName |
Widget name for dummies. | |
static const String | EventNamespace |
Namespace for global events. | |
static const String | EventChildOrderChanged |
fired when child windows get rearranged | |
Protected Member Functions | |
virtual void | onChildOrderChanged (WindowEventArgs &e) |
Handler called when children of this window gets rearranged in any way. | |
size_t | mapFromGridToIdx (size_t gridX, size_t gridY, size_t gridWidth, size_t gridHeight) const |
converts from grid cell position to idx | |
void | mapFromIdxToGrid (size_t idx, size_t &gridX, size_t &gridY, size_t gridWidth, size_t gridHeight) const |
converts from idx to grid cell position | |
UVector2 | getGridCellOffset (const std::vector< UDim > &colSizes, const std::vector< UDim > &rowSizes, size_t gridX, size_t gridY) const |
USize | getGridSize (const std::vector< UDim > &colSizes, const std::vector< UDim > &rowSizes) const |
calculates total grid size | |
size_t | translateAPToGridIdx (size_t APIdx) const |
translates auto positioning index to absolute grid index | |
Window * | createDummy () |
creates a dummy window | |
bool | isDummy (Window *wnd) const |
checks whether given window is a dummy | |
virtual void | addChild_impl (Element *element) |
virtual void | removeChild_impl (Element *element) |
Protected Attributes | |
size_t | d_gridWidth |
stores grid width - amount of columns | |
size_t | d_gridHeight |
stores grid height - amount of rows | |
AutoPositioning | d_autoPositioning |
stores currently used auto positioning method | |
size_t | d_nextAutoPositioningIdx |
size_t | d_nextGridX |
size_t | d_nextGridY |
size_t | d_nextDummyIdx |
A Layout Container window layouting it's children into a grid.
virtual void CEGUI::GridLayoutContainer::addChild_impl | ( | Element * | element | ) | [protected, virtual] |
Add given element to child list at an appropriate position.
Reimplemented from CEGUI::LayoutContainer.
void CEGUI::GridLayoutContainer::addChildToPosition | ( | Window * | window, |
size_t | gridX, | ||
size_t | gridY | ||
) |
Add the specified Window to specified grid position as a child of this Grid Layout Container. If the Window window is already attached to a Window, it is detached before being added to this Window.
UVector2 CEGUI::GridLayoutContainer::getGridCellOffset | ( | const std::vector< UDim > & | colSizes, |
const std::vector< UDim > & | rowSizes, | ||
size_t | gridX, | ||
size_t | gridY | ||
) | const [protected] |
calculates grid cell offset (relative to position of this layout container)
virtual void CEGUI::GridLayoutContainer::layout | ( | ) | [virtual] |
(re)layouts all windows inside this layout container immediately
Implements CEGUI::LayoutContainer.
virtual void CEGUI::GridLayoutContainer::onChildOrderChanged | ( | WindowEventArgs & | e | ) | [protected, virtual] |
Handler called when children of this window gets rearranged in any way.
e | WindowEventArgs object whose 'window' field is set this layout container. |
virtual void CEGUI::GridLayoutContainer::removeChild_impl | ( | Element * | element | ) | [protected, virtual] |
Remove given element from child list.
Reimplemented from CEGUI::LayoutContainer.
void CEGUI::GridLayoutContainer::removeChildFromPosition | ( | size_t | gridX, |
size_t | gridY | ||
) |
Removes the child window that is currently at given grid position.
void CEGUI::GridLayoutContainer::setAutoPositioning | ( | AutoPositioning | positioning | ) |
Sets new auto positioning method.
virtual void CEGUI::GridLayoutContainer::swapChildPositions | ( | size_t | wnd1, |
size_t | wnd2 | ||
) | [virtual] |
Swaps positions of 2 windows given by their index.
size_t CEGUI::GridLayoutContainer::d_nextAutoPositioningIdx [protected] |
stores next auto positioning index (will be used for next added window if d_autoPositioning != AP_Disabled)
size_t CEGUI::GridLayoutContainer::d_nextDummyIdx [protected] |
stores next used dummy suffix index (used to generate unique dummy names)
size_t CEGUI::GridLayoutContainer::d_nextGridX [protected] |
stores next used grid X position (only used if d_autoPositioning == AP_Disabled)
size_t CEGUI::GridLayoutContainer::d_nextGridY [protected] |
stores next used grid Y position (only used if d_autoPositioning == AP_Disabled)