From: Václav Slavík Date: Sun, 10 Feb 2002 19:08:07 +0000 (+0000) Subject: honour min/max size in wxMGL's wxWindow::DoSetSize X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/6feddea302d401adad1a97796675f8737d3b9d23?ds=sidebyside;hp=d65552318cf0df401bb97a5ee9cde741c450fc59 honour min/max size in wxMGL's wxWindow::DoSetSize git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14112 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/mgl/window.cpp b/src/mgl/window.cpp index 12fd871b8d..5c1cab3bf1 100644 --- a/src/mgl/window.cpp +++ b/src/mgl/window.cpp @@ -960,7 +960,7 @@ void wxWindowMGL::DoSetSize(int x, int y, int width, int height, int sizeFlags) width = currentW; } } - + if ( height == -1 ) { if ( sizeFlags & wxSIZE_AUTO_HEIGHT ) @@ -979,6 +979,16 @@ void wxWindowMGL::DoSetSize(int x, int y, int width, int height, int sizeFlags) height = currentH; } } + + int maxWidth = GetMaxWidth(), + minWidth = GetMinWidth(), + maxHeight = GetMaxHeight(), + minHeight = GetMinHeight(); + + if ( minWidth != -1 && width < minWidth ) width = minWidth; + if ( maxWidth != -1 && width > maxWidth ) width = maxWidth; + if ( minHeight != -1 && height < minHeight ) height = minHeight; + if ( maxHeight != -1 && height > maxHeight ) height = maxHeight; if ( m_wnd->x != x || m_wnd->y != y || (int)m_wnd->width != width || (int)m_wnd->height != height )