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
This commit is contained in:
Stefan Csomor
2002-09-20 19:15:16 +00:00
parent 63684edb71
commit a14865055c
2 changed files with 42 additions and 32 deletions

View File

@@ -1628,23 +1628,28 @@ void wxApp::MacHandleMouseDownEvent( WXEVENTREF evr )
break; break;
case inGrow: case inGrow:
{ {
int growResult = GrowWindow(window , ev->where, &screenBits.bounds); Rect newContentRect ;
if (growResult != 0) 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); win->SetSize( newContentRect.left , newContentRect.top ,
int newHeight = HiWord(growResult); newContentRect.right - newContentRect.left ,
int oldWidth, oldHeight; newContentRect.bottom - newContentRect.top, wxSIZE_USE_EXISTING);
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);
}
} }
s_lastMouseDown = 0; s_lastMouseDown = 0;
} }

View File

@@ -1628,23 +1628,28 @@ void wxApp::MacHandleMouseDownEvent( WXEVENTREF evr )
break; break;
case inGrow: case inGrow:
{ {
int growResult = GrowWindow(window , ev->where, &screenBits.bounds); Rect newContentRect ;
if (growResult != 0) 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); win->SetSize( newContentRect.left , newContentRect.top ,
int newHeight = HiWord(growResult); newContentRect.right - newContentRect.left ,
int oldWidth, oldHeight; newContentRect.bottom - newContentRect.top, wxSIZE_USE_EXISTING);
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);
}
} }
s_lastMouseDown = 0; s_lastMouseDown = 0;
} }