From 744cc5f0f3d07b86fd781e2e813201d6c33b154d Mon Sep 17 00:00:00 2001 From: Aaron Marks Date: Sat, 9 Apr 2005 13:33:35 +0000 Subject: Fixed up problem with inventory display. Added maximum width/height of window (for resizing). --- src/gui/window.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/gui/window.cpp') 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 { -- cgit v1.2.3-70-g09d2