summaryrefslogtreecommitdiff
path: root/src/gui/window.h
diff options
context:
space:
mode:
authorGuillaume Melquiond <guillaume.melquiond@gmail.com>2007-08-07 17:03:55 +0000
committerGuillaume Melquiond <guillaume.melquiond@gmail.com>2007-08-07 17:03:55 +0000
commitb2b13c21091b516b57b4bf3c91a313f019bf3579 (patch)
tree995e63ecadf1ea16c94b9d39b66a367358b5a27a /src/gui/window.h
parentc09825097c0231c57f9ac416fae0003c5d68398c (diff)
downloadmana-client-b2b13c21091b516b57b4bf3c91a313f019bf3579.tar.gz
mana-client-b2b13c21091b516b57b4bf3c91a313f019bf3579.tar.bz2
mana-client-b2b13c21091b516b57b4bf3c91a313f019bf3579.tar.xz
mana-client-b2b13c21091b516b57b4bf3c91a313f019bf3579.zip
Fixed my breakage of persistent window dimensions. Cleaned a few things along the way.
Diffstat (limited to 'src/gui/window.h')
-rw-r--r--src/gui/window.h39
1 files changed, 16 insertions, 23 deletions
diff --git a/src/gui/window.h b/src/gui/window.h
index 03248908..1ba23fb2 100644
--- a/src/gui/window.h
+++ b/src/gui/window.h
@@ -99,6 +99,12 @@ 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 width of this window.
*/
void setWidth(int width);
@@ -193,39 +199,27 @@ class Window : public gcn::Window
void mouseDragged(gcn::MouseEvent &event);
/**
- * Sets the name of the window. This is not the window title.
- */
- void
- setWindowName(const std::string &name) { mWindowName = name; }
-
- /**
- * Returns the name of the window. This is not the window title.
- */
- const std::string&
- getWindowName() { return mWindowName; }
-
- /**
* Read the x, y, and width and height for resizables in the config
- * based on the name of the window.
+ * based on the given string.
* That function let the values set with set{X, Y, Height, width}()
* if no config value is found.
* Don't forget to set these default values and resizable before
* calling this function.
*/
- virtual void loadWindowState();
+ void loadWindowState(std::string const &);
/**
* Set the default win pos and size.
* (which can be different of the actual ones.)
*/
- virtual void setDefaultSize(int defaultX, int defaultY,
- int defaultWidth, int defaultHeight);
+ void setDefaultSize(int defaultX, int defaultY,
+ int defaultWidth, int defaultHeight);
/**
* Reset the win pos and size to default.
* Don't forget to set defaults first.
*/
- virtual void resetToDefaultSize();
+ void resetToDefaultSize();
enum ResizeHandles
{
@@ -235,12 +229,14 @@ class Window : public gcn::Window
LEFT = 0x08
};
- protected:
+ /** The window container windows add themselves to. */
+ static WindowContainer *windowContainer;
+
+ private:
GCContainer *mChrome; /**< Contained container */
ResizeGrip *mGrip; /**< Resize grip */
Window *mParent; /**< The parent window */
- std::string mWindowName; /**< Name of the window */
- bool mShowTitle; /**< Window has a title bar */
+ std::string mConfigName; /**< Name used for saving window-related data */
bool mModal; /**< Window is modal */
bool mResizable; /**< Window can be resized */
int mMouseResize; /**< Window is being resized */
@@ -254,9 +250,6 @@ class Window : public gcn::Window
int mDefaultWidth; /**< Default window width */
int mDefaultHeight; /**< Default window height */
- /** The window container windows add themselves to. */
- static WindowContainer *windowContainer;
-
/**
* The config listener that listens to changes relevant to all windows.
*/