diff options
author | Guillaume Melquiond <guillaume.melquiond@gmail.com> | 2007-10-27 20:23:48 +0000 |
---|---|---|
committer | Guillaume Melquiond <guillaume.melquiond@gmail.com> | 2007-10-27 20:23:48 +0000 |
commit | 97bbe57e21a28544646da087e2a522390bf2ce5c (patch) | |
tree | a1899345f3b3928b3b0747b2429a45d08f79ae59 /src/gui/window.h | |
parent | ee15a808a1e0d36167f80d9f96147103ba5583de (diff) | |
download | mana-client-97bbe57e21a28544646da087e2a522390bf2ce5c.tar.gz mana-client-97bbe57e21a28544646da087e2a522390bf2ce5c.tar.bz2 mana-client-97bbe57e21a28544646da087e2a522390bf2ce5c.tar.xz mana-client-97bbe57e21a28544646da087e2a522390bf2ce5c.zip |
Improved layout handler to support trees of nested arrays. Needed for converting and fixing the trade window.
Diffstat (limited to 'src/gui/window.h')
-rw-r--r-- | src/gui/window.h | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/gui/window.h b/src/gui/window.h index a09a9bbc..df756be3 100644 --- a/src/gui/window.h +++ b/src/gui/window.h @@ -30,11 +30,12 @@ #include "windowlistener.h" -class Cell; class ConfigListener; +class ContainerPlacer; class Image; class ImageRect; class Layout; +class LayoutCell; class ResizeGrip; class WindowContainer; @@ -93,12 +94,6 @@ class Window : public gcn::Window void setContentSize(int width, int height); /** - * Called when either the user or resetToDefaultSize resizes the - * windows, so that the windows can manage its widgets. - */ - virtual void updateContentSize() {} - - /** * Sets the size of this window. */ void setSize(int width, int height); @@ -292,19 +287,24 @@ class Window : public gcn::Window Layout &getLayout(); /** - * Deletes the layout handler. + * Computes the position of the widgets according to the current + * layout. Resizes the window so that the layout fits. Deletes the + * layout. + * @param w if non-zero, force the window to this width. + * @param h if non-zero, force the window to this height. + * @note This function is meant to be called with fixed-size windows. */ - void forgetLayout(); + void reflowLayout(int w = 0, int h = 0); /** - * Resizes the window after computing the position of the widgets. + * Adds a widget to the window and sets it at given cell. */ - void reflowLayout(); + LayoutCell &place(int x, int y, gcn::Widget *, int w = 1, int h = 1); /** - * Adds a widget to the window and sets it at given cell. + * Returns a proxy for adding widgets in an inner table of the layout. */ - Cell &place(int x, int y, gcn::Widget *, int w = 1, int h = 1); + ContainerPlacer getPlacer(int x, int y); private: /** |