diff options
author | Yohann Ferreira <bertram@cegetel.net> | 2005-09-28 21:26:23 +0000 |
---|---|---|
committer | Yohann Ferreira <bertram@cegetel.net> | 2005-09-28 21:26:23 +0000 |
commit | eb8dc37bfa07e1185308bc8d4748d92c69af1783 (patch) | |
tree | 43f8b726cc7f2c071c0641fdacb187c747aaaf5a /src/gui/window.cpp | |
parent | e93e064373c382b80ecb37919335fbfe424efeea (diff) | |
download | mana-eb8dc37bfa07e1185308bc8d4748d92c69af1783.tar.gz mana-eb8dc37bfa07e1185308bc8d4748d92c69af1783.tar.bz2 mana-eb8dc37bfa07e1185308bc8d4748d92c69af1783.tar.xz mana-eb8dc37bfa07e1185308bc8d4748d92c69af1783.zip |
Save and load X, Y, Height, and Width to useful wins.
Diffstat (limited to 'src/gui/window.cpp')
-rw-r--r-- | src/gui/window.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/gui/window.cpp b/src/gui/window.cpp index 706780be..0446e6eb 100644 --- a/src/gui/window.cpp +++ b/src/gui/window.cpp @@ -131,6 +131,15 @@ Window::~Window() { logger->log("Window::~Window(\"%s\")", getCaption().c_str()); + // Saving X, Y and Width and Height for resizables in the config + config.setValue(std::string(getWindowName() + "WinX"), getX()); + config.setValue(std::string(getWindowName() + "WinY"), getY()); + if ( resizable ) + { + config.setValue(std::string(getWindowName() + "WinWidth"), getWidth()); + config.setValue(std::string(getWindowName() + "WinHeight"), getHeight()); + } + instances--; if (instances == 0) @@ -416,3 +425,19 @@ std::string Window::getWindowName() { return mWindowName; } + +void Window::loadWindowState() +{ + setPosition((int)config.getValue(std::string(getWindowName() + "WinX"), getX()), + (int)config.getValue(std::string(getWindowName() + "WinY"), getY()) ); + + if ( resizable ) + { + setWidth((int)config.getValue(std::string(getWindowName() + "WinWidth"), getWidth()) ); + setHeight((int)config.getValue(std::string(getWindowName() + "WinHeight"), getHeight()) ); + if (mContent != NULL) + { + mContent->setDimension(getContentDimension()); + } + } +} |