43 STD_VECTOR <STD_VECTOR <LayoutCell *> >::iterator
45 const STD_VECTOR <STD_VECTOR <LayoutCell *> >::iterator
49 STD_VECTOR< LayoutCell * >::iterator j = i->begin();
50 const STD_VECTOR< LayoutCell * >::iterator j_end = i->end();
61 const int w,
const int h)
89 STD_VECTOR <STD_VECTOR <LayoutCell *> >::iterator
91 const STD_VECTOR <STD_VECTOR <LayoutCell *> >::iterator
116 const int s = std::max(widths[
CAST_SIZE(n1)],
130 const int y,
const int w,
const int h)
136 if (widget !=
nullptr)
164 const int sizeCount)
const
166 if (dim < 0 || dim >= 2)
168 int size_max = sizes[0];
169 int cnt = cell.mExtent[dim];
170 if ((sizeCount != 0) && cell.mExtent[dim] > sizeCount)
173 for (
int i = 1; i < cnt; ++i)
175 size = std::min<int>(cell.mSize[dim], size_max);
177 switch (cell.mAlign[dim])
182 pos += size_max -
size;
185 pos += (size_max -
size) / 2;
191 logger->
log1(
"LayoutArray::align unknown layout");
198 if (dim < 0 || dim >= 2)
203 STD_VECTOR<int> sizes =
mSizes[dim];
206 for (
int gridY = 0; gridY < gridH; ++gridY)
208 for (
int gridX = 0; gridX < gridW; ++gridX)
217 const int n = (dim == 0 ? gridX : gridY);
229 const int nb =
CAST_S32(sizes.size());
231 for (
int i = 0; i < nb; ++i)
251 for (
int i = 0; i < nb; ++i)
259 const int s = upp / nbFill;
272 const int nb =
CAST_S32(sizes.size());
273 for (
int i = 0; i < nb; ++i)
283 const int nw,
const int nh)
288 STD_VECTOR<int> widths =
getSizes(0, nw);
289 STD_VECTOR<int> heights =
getSizes(1, nh);
291 const int szW =
CAST_S32(widths.size());
292 const int szH =
CAST_S32(heights.size());
294 for (
int gridY = 0; gridY < gridH; ++gridY)
297 for (
int gridX = 0; gridX < gridW; ++gridX)
307 align(dx, dw, 0, *cell,
309 align(dy, dh, 1, *cell,
310 &heights[
CAST_SIZE(gridY)], szH - gridY);
311 cell->
reflow(dx, dy, dw, dh);
std::vector< std::vector< LayoutCell * > > mCells
void resizeGrid(int w, const int h)
void extend(const int x, const int y, const int w, const int h)
int getSize(const int dim) const
void align(int &pos, int &size, const int dim, LayoutCell const &cell, const int *const sizes, const int sizeCount) const
void setColWidth(const int n, const int w)
void matchColWidth(const int n1, const int n2)
void setRowHeight(const int n, const int h)
std::vector< int > getSizes(const int dim, int upp) const
LayoutCell & at(const int x, const int y, const int w, const int h)
LayoutCell & place(Widget *const widget, const int x, const int y, const int w, const int h)
void reflow(const int nX, const int nY, const int nW, const int nH)
std::vector< int > mSizes[2]
void reflow(int nx, int ny, int nw, int nh)
void log1(const char *const log_text)