29 #ifndef _CEGUIGridLayoutContainer_h_
30 #define _CEGUIGridLayoutContainer_h_
32 #include "./LayoutContainer.h"
33 #include "../WindowFactory.h"
36 # pragma warning(push)
37 # pragma warning(disable : 4251)
113 void setGridDimensions(
size_t width,
size_t height);
118 void setGrid(
const Sizef &size);
124 size_t getGridWidth()
const;
130 size_t getGridHeight()
const;
136 Sizef getGrid()
const;
160 void setNextAutoPositioningIdx(
size_t idx);
167 size_t getNextAutoPositioningIdx()
const;
173 void autoPositioningSkipCells(
size_t cells);
192 void addChildToPosition(
Window* window,
size_t gridX,
size_t gridY);
198 Window* getChildAtPosition(
size_t gridX,
size_t gridY);
207 void removeChildFromPosition(
size_t gridX,
size_t gridY);
216 virtual void swapChildPositions(
size_t wnd1,
size_t wnd2);
222 void swapChildPositions(
size_t gridX1,
size_t gridY1,
223 size_t gridX2,
size_t gridY2);
247 void moveChildToPosition(
Window* wnd,
size_t gridX,
size_t gridY);
253 void moveChildToPosition(
const String& wnd,
254 size_t gridX,
size_t gridY);
257 virtual void layout();
271 size_t mapFromGridToIdx(
size_t gridX,
size_t gridY,
272 size_t gridWidth,
size_t gridHeight)
const;
274 void mapFromIdxToGrid(
size_t idx,
size_t& gridX,
size_t& gridY,
275 size_t gridWidth,
size_t gridHeight)
const;
280 UVector2 getGridCellOffset(
const std::vector<UDim>& colSizes,
281 const std::vector<UDim>& rowSizes,
282 size_t gridX,
size_t gridY)
const;
284 USize getGridSize(
const std::vector<UDim>& colSizes,
285 const std::vector<UDim>& rowSizes)
const;
288 size_t translateAPToGridIdx(
size_t APIdx)
const;
319 bool isDummy(
Window* wnd)
const;
322 virtual void addChild_impl(
Element* element);
324 virtual void removeChild_impl(
Element* element);
327 void addGridLayoutContainerProperties(
void);
339 static const String& getDataTypeName()
341 static String type(
"AutoPositioning");
348 if (str ==
"Disabled")
352 else if (str ==
"Top to Bottom")
366 return "Left to Right";
374 return "Top to Bottom";
378 assert(
false &&
"Invalid Auto Positioning");
379 return "Left to Right";
386 #if defined(_MSC_VER)
387 # pragma warning(pop)
390 #endif // end of guard _CEGUIGridLayoutContainer_h_