summaryrefslogtreecommitdiff
path: root/src/gui/window.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2005-04-18 21:56:06 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2005-04-18 21:56:06 +0000
commit7d8ea8914bc230d473f558116d932f26f2b5d055 (patch)
treebf77bf707beb6a70b69d76dad7f19c0a69654c5f /src/gui/window.cpp
parent708384a6b1fca22c6352deb79e52422266dc307e (diff)
downloadmana-7d8ea8914bc230d473f558116d932f26f2b5d055.tar.gz
mana-7d8ea8914bc230d473f558116d932f26f2b5d055.tar.bz2
mana-7d8ea8914bc230d473f558116d932f26f2b5d055.tar.xz
mana-7d8ea8914bc230d473f558116d932f26f2b5d055.zip
Fixed tileset loading to clear tilesets vector when finished.
Diffstat (limited to 'src/gui/window.cpp')
-rw-r--r--src/gui/window.cpp38
1 files changed, 19 insertions, 19 deletions
diff --git a/src/gui/window.cpp b/src/gui/window.cpp
index c9c51032..62daa9cd 100644
--- a/src/gui/window.cpp
+++ b/src/gui/window.cpp
@@ -33,11 +33,11 @@ Window::Window(const std::string& caption, bool modal, Window *parent):
parent(parent),
snapSize(8),
modal(modal),
+ resizeable(false),
minWinWidth(256),
minWinHeight(128),
maxWinWidth(512),
- maxWinHeight(512),
- isWinResizeable(false)
+ maxWinHeight(512)
{
logger.log("Window::Window(\"%s\")", caption.c_str());
@@ -183,12 +183,12 @@ void Window::setMaxHeight(unsigned int height)
void Window::setResizeable(bool r)
{
- isWinResizeable = r;
+ resizeable = r;
}
bool Window::getResizeable()
{
- return isWinResizeable;
+ return resizeable;
}
Window *Window::getParentWindow()
@@ -229,24 +229,24 @@ void Window::mouseMotion(int mx, int my)
//if (y < snapSize) y = 0;
//if (x + winWidth + snapSize > screen->w) x = screen->w - winWidth;
//if (y + winHeight + snapSize > screen->h) y = screen->h - winHeight;
-
- if (isWinResizeable && mx > getWidth() - 16) {
- //resize
- if (mx < minWinWidth)
- mx = minWinWidth;
- if (my < minWinHeight)
- my = minWinHeight;
- if (mx >= maxWinWidth)
- mx = maxWinWidth - 1;
- if (my >= maxWinHeight)
- my = maxWinHeight - 1;
+
+ if (resizeable && mx > getWidth() - 16) {
+ // Resize
+ if (mx < minWinWidth)
+ mx = minWinWidth;
+ if (my < minWinHeight)
+ my = minWinHeight;
+ if (mx >= maxWinWidth)
+ mx = maxWinWidth - 1;
+ if (my >= maxWinHeight)
+ my = maxWinHeight - 1;
setWidth(mx);
- setHeight(my);
- } else {
- //move
+ setHeight(my);
+ } else {
+ // Move
setPosition(x, y);
- }
+ }
}
}