summaryrefslogtreecommitdiff
path: root/src/gui/window.cpp
diff options
context:
space:
mode:
authorAaron Marks <nymacro@gmail.com>2005-04-09 13:33:35 +0000
committerAaron Marks <nymacro@gmail.com>2005-04-09 13:33:35 +0000
commit744cc5f0f3d07b86fd781e2e813201d6c33b154d (patch)
tree09df6c63913c6a1ec3f423414cc6923ea86e6484 /src/gui/window.cpp
parentb81c5e80634736b0069eedfa56604c141e7c9bbf (diff)
downloadmana-744cc5f0f3d07b86fd781e2e813201d6c33b154d.tar.gz
mana-744cc5f0f3d07b86fd781e2e813201d6c33b154d.tar.bz2
mana-744cc5f0f3d07b86fd781e2e813201d6c33b154d.tar.xz
mana-744cc5f0f3d07b86fd781e2e813201d6c33b154d.zip
Fixed up problem with inventory display.
Added maximum width/height of window (for resizing).
Diffstat (limited to 'src/gui/window.cpp')
-rw-r--r--src/gui/window.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/gui/window.cpp b/src/gui/window.cpp
index ee2474ba..c9c51032 100644
--- a/src/gui/window.cpp
+++ b/src/gui/window.cpp
@@ -35,6 +35,8 @@ Window::Window(const std::string& caption, bool modal, Window *parent):
modal(modal),
minWinWidth(256),
minWinHeight(128),
+ maxWinWidth(512),
+ maxWinHeight(512),
isWinResizeable(false)
{
logger.log("Window::Window(\"%s\")", caption.c_str());
@@ -169,6 +171,16 @@ void Window::setMinHeight(unsigned int height)
minWinHeight = height;
}
+void Window::setMaxWidth(unsigned int width)
+{
+ maxWinWidth = width;
+}
+
+void Window::setMaxHeight(unsigned int height)
+{
+ maxWinHeight = height;
+}
+
void Window::setResizeable(bool r)
{
isWinResizeable = r;
@@ -224,6 +236,11 @@ void Window::mouseMotion(int mx, int my)
mx = minWinWidth;
if (my < minWinHeight)
my = minWinHeight;
+ if (mx >= maxWinWidth)
+ mx = maxWinWidth - 1;
+ if (my >= maxWinHeight)
+ my = maxWinHeight - 1;
+
setWidth(mx);
setHeight(my);
} else {