From a14865055cf544436282438afd7626cf06926dc1 Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Fri, 20 Sep 2002 19:15:16 +0000 Subject: [PATCH] changed resize code to reflect minimum and maximum sizes already when dragging the size rectangle git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@17301 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/mac/app.cpp | 37 +++++++++++++++++++++---------------- src/mac/carbon/app.cpp | 37 +++++++++++++++++++++---------------- 2 files changed, 42 insertions(+), 32 deletions(-) diff --git a/src/mac/app.cpp b/src/mac/app.cpp index 587cdeb344..cffec9e76e 100644 --- a/src/mac/app.cpp +++ b/src/mac/app.cpp @@ -1628,23 +1628,28 @@ void wxApp::MacHandleMouseDownEvent( WXEVENTREF evr ) break; case inGrow: { - int growResult = GrowWindow(window , ev->where, &screenBits.bounds); - if (growResult != 0) + Rect newContentRect ; + Rect constraintRect ; + constraintRect.top = win->GetMinHeight() ; + if ( constraintRect.top == -1 ) + constraintRect.top == 0 ; + constraintRect.left = win->GetMinWidth() ; + if ( constraintRect.left == -1 ) + constraintRect.left == 0 ; + constraintRect.right = win->GetMaxWidth() ; + if ( constraintRect.right == -1 ) + constraintRect.right == 32768 ; + constraintRect.bottom = win->GetMaxWidth() ; + if ( constraintRect.bottom == -1 ) + constraintRect.bottom == 32768 ; + + Boolean growResult = ResizeWindow( window , ev->where , + &constraintRect , &newContentRect ) ; + if ( growResult ) { - int newWidth = LoWord(growResult); - int newHeight = HiWord(growResult); - int oldWidth, oldHeight; - - - if (win) - { - win->GetSize(&oldWidth, &oldHeight); - if (newWidth == 0) - newWidth = oldWidth; - if (newHeight == 0) - newHeight = oldHeight; - win->SetSize( -1, -1 , newWidth, newHeight, wxSIZE_USE_EXISTING); - } + win->SetSize( newContentRect.left , newContentRect.top , + newContentRect.right - newContentRect.left , + newContentRect.bottom - newContentRect.top, wxSIZE_USE_EXISTING); } s_lastMouseDown = 0; } diff --git a/src/mac/carbon/app.cpp b/src/mac/carbon/app.cpp index 587cdeb344..cffec9e76e 100644 --- a/src/mac/carbon/app.cpp +++ b/src/mac/carbon/app.cpp @@ -1628,23 +1628,28 @@ void wxApp::MacHandleMouseDownEvent( WXEVENTREF evr ) break; case inGrow: { - int growResult = GrowWindow(window , ev->where, &screenBits.bounds); - if (growResult != 0) + Rect newContentRect ; + Rect constraintRect ; + constraintRect.top = win->GetMinHeight() ; + if ( constraintRect.top == -1 ) + constraintRect.top == 0 ; + constraintRect.left = win->GetMinWidth() ; + if ( constraintRect.left == -1 ) + constraintRect.left == 0 ; + constraintRect.right = win->GetMaxWidth() ; + if ( constraintRect.right == -1 ) + constraintRect.right == 32768 ; + constraintRect.bottom = win->GetMaxWidth() ; + if ( constraintRect.bottom == -1 ) + constraintRect.bottom == 32768 ; + + Boolean growResult = ResizeWindow( window , ev->where , + &constraintRect , &newContentRect ) ; + if ( growResult ) { - int newWidth = LoWord(growResult); - int newHeight = HiWord(growResult); - int oldWidth, oldHeight; - - - if (win) - { - win->GetSize(&oldWidth, &oldHeight); - if (newWidth == 0) - newWidth = oldWidth; - if (newHeight == 0) - newHeight = oldHeight; - win->SetSize( -1, -1 , newWidth, newHeight, wxSIZE_USE_EXISTING); - } + win->SetSize( newContentRect.left , newContentRect.top , + newContentRect.right - newContentRect.left , + newContentRect.bottom - newContentRect.top, wxSIZE_USE_EXISTING); } s_lastMouseDown = 0; }