30 #ifndef _CEGUIGridLayoutContainer_h_
31 #define _CEGUIGridLayoutContainer_h_
33 #include "./LayoutContainer.h"
34 #include "../WindowFactory.h"
37 # pragma warning(push)
38 # pragma warning(disable : 4251)
114 void setGridDimensions(
size_t width,
size_t height);
119 void setGrid(
const Sizef &size);
125 size_t getGridWidth()
const;
131 size_t getGridHeight()
const;
137 Sizef getGrid()
const;
161 void setNextAutoPositioningIdx(
size_t idx);
168 size_t getNextAutoPositioningIdx()
const;
174 void autoPositioningSkipCells(
size_t cells);
193 void addChildToPosition(
Window* window,
size_t gridX,
size_t gridY);
199 Window* getChildAtPosition(
size_t gridX,
size_t gridY);
208 void removeChildFromPosition(
size_t gridX,
size_t gridY);
217 virtual void swapChildPositions(
size_t wnd1,
size_t wnd2);
223 void swapChildPositions(
size_t gridX1,
size_t gridY1,
224 size_t gridX2,
size_t gridY2);
248 void moveChildToPosition(
Window* wnd,
size_t gridX,
size_t gridY);
254 void moveChildToPosition(
const String& wnd,
255 size_t gridX,
size_t gridY);
258 virtual void layout();
272 size_t mapFromGridToIdx(
size_t gridX,
size_t gridY,
273 size_t gridWidth,
size_t gridHeight)
const;
275 void mapFromIdxToGrid(
size_t idx,
size_t& gridX,
size_t& gridY,
276 size_t gridWidth,
size_t gridHeight)
const;
281 UVector2 getGridCellOffset(
const std::vector<UDim>& colSizes,
282 const std::vector<UDim>& rowSizes,
283 size_t gridX,
size_t gridY)
const;
285 USize getGridSize(
const std::vector<UDim>& colSizes,
286 const std::vector<UDim>& rowSizes)
const;
289 size_t translateAPToGridIdx(
size_t APIdx)
const;
320 bool isDummy(
Window* wnd)
const;
323 virtual void addChild_impl(
Element* element);
325 virtual void removeChild_impl(
Element* element);
328 void addGridLayoutContainerProperties(
void);
340 static const String& getDataTypeName()
342 static String type(
"AutoPositioning");
349 if (str ==
"Disabled")
353 else if (str ==
"Top to Bottom")
367 return "Left to Right";
375 return "Top to Bottom";
379 assert(
false &&
"Invalid Auto Positioning");
380 return "Left to Right";
387 #if defined(_MSC_VER)
388 # pragma warning(pop)
391 #endif // end of guard _CEGUIGridLayoutContainer_h_