diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-05-14 22:15:54 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-05-14 22:15:54 +0300 |
commit | 4e7b98accb8f6fa927711174e4ee82a731317c74 (patch) | |
tree | 0d024c46b41771aa178771ec57eafe2f5f39f819 /src/gui/widgets/layout.h | |
parent | ffee866c7eea91d38f6a27fbd4ecf38b573d32ee (diff) | |
download | ManaVerse-4e7b98accb8f6fa927711174e4ee82a731317c74.tar.gz ManaVerse-4e7b98accb8f6fa927711174e4ee82a731317c74.tar.bz2 ManaVerse-4e7b98accb8f6fa927711174e4ee82a731317c74.tar.xz ManaVerse-4e7b98accb8f6fa927711174e4ee82a731317c74.zip |
Move layoutarray into separate file.
Diffstat (limited to 'src/gui/widgets/layout.h')
-rw-r--r-- | src/gui/widgets/layout.h | 89 |
1 files changed, 0 insertions, 89 deletions
diff --git a/src/gui/widgets/layout.h b/src/gui/widgets/layout.h index c41c6570f..9e2cbb698 100644 --- a/src/gui/widgets/layout.h +++ b/src/gui/widgets/layout.h @@ -33,95 +33,6 @@ class BasicContainer2; class Widget; /** - * This class contains a rectangular array of cells. - */ -class LayoutArray final -{ - friend class LayoutCell; - - public: - LayoutArray(); - - ~LayoutArray(); - - /** - * Returns a reference on the cell at given position. - */ - LayoutCell &at(const int x, const int y, - const int w = 1, const int h = 1) A_WARN_UNUSED; - - /** - * Places a widget in a given cell. - * @param w number of columns the widget spawns. - * @param h number of rows the widget spawns. - * @note When @a w is 1, the width of column @a x is reset to zero if - * it was AUTO_DEF. Similarly for @a h. - */ - LayoutCell &place(Widget *const widget, const int x, const int y, - const int w = 1, const int h = 1); - - /** - * Sets the minimum width of a column. - */ - void setColWidth(const int n, const int w); - - /** - * Sets the minimum height of a row. - */ - void setRowHeight(const int n, const int h); - - /** - * Sets the widths of two columns to the maximum of their widths. - */ - void matchColWidth(const int n1, const int n2); - - /** - * Spawns a cell over several columns/rows. - */ - void extend(const int x, const int y, const int w, const int h); - - /** - * Computes and sets the positions of all the widgets. - * @param nW width of the array, used to resize the AUTO_ columns. - * @param nH height of the array, used to resize the AUTO_ rows. - */ - void reflow(const int nX, const int nY, const int nW, const int nH); - - private: - // Copy not allowed, as the array owns all its cells. - explicit LayoutArray(LayoutArray const &); - LayoutArray &operator=(LayoutArray const &); - - /** - * Gets the position and size of a widget along a given axis - */ - void align(int &restrict pos, int &restrict size, const int dim, - LayoutCell const &restrict cell, - const int *restrict const sizes, const int sizeCount) const; - - /** - * Ensures the private vectors are large enough. - */ - void resizeGrid(int w, const int h); - - /** - * Gets the column/row sizes along a given axis. - * @param upp target size for the array. Ignored if AUTO_DEF. - */ - std::vector<int> getSizes(const int dim, int upp) const A_WARN_UNUSED; - - /** - * Gets the total size along a given axis. - */ - int getSize(const int dim) const A_WARN_UNUSED; - - std::vector<int> mSizes[2]; - std::vector< std::vector < LayoutCell * > > mCells; - - int mSpacing; -}; - -/** * This class is an helper for setting the position of widgets. They are * positioned along the cells of some rectangular tables. The layout may either * be a single table or a tree of nested tables. |