From ba75e603f659f8f8bad71ba4d35658efe60d5de3 Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Fri, 1 Apr 2005 07:28:31 +0000 Subject: [PATCH] adding correct handling of uncovering or covering controls via tlw-resizes (in which case the txnBounds would not change) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33234 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/mac/carbon/textctrl.cpp | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/mac/carbon/textctrl.cpp b/src/mac/carbon/textctrl.cpp index 2c69426a4c..100f1d6989 100644 --- a/src/mac/carbon/textctrl.cpp +++ b/src/mac/carbon/textctrl.cpp @@ -346,7 +346,7 @@ private : WindowRef m_txnWindow ; // bounds of the control as we last did set the txn frames Rect m_txnControlBounds ; - + Rect m_txnVisBounds ; #ifdef __WXMAC_OSX__ static pascal void TXNScrollInfoProc (SInt32 iValue, SInt32 iMaximumValue, TXNScrollBarOrientation iScrollBarOrientation, SInt32 iRefCon) ; @@ -2141,14 +2141,18 @@ void wxMacMLTEClassicControl::MacUpdatePosition() Rect bounds ; UMAGetControlBoundsInWindowCoords(m_controlRef, &bounds); - if ( !EqualRect( &bounds , &m_txnControlBounds ) ) + wxRect visRect = textctrl->MacGetClippedClientRect() ; + Rect visBounds = { visRect.y , visRect.x , visRect.y + visRect.height , visRect.x + visRect.width } ; + int x , y ; + x = y = 0 ; + textctrl->MacWindowToRootWindow( &x , &y ) ; + OffsetRect( &visBounds , x , y ) ; + + if ( !EqualRect( &bounds , &m_txnControlBounds ) || !EqualRect( &visBounds , &m_txnVisBounds) ) { - // old position - Rect oldBounds = m_txnControlBounds ; m_txnControlBounds = bounds ; + m_txnVisBounds = visBounds ; wxMacWindowClipper cl(textctrl) ; - wxRect visRect = textctrl->MacGetClippedRect() ; - Rect visBounds = { visRect.y , visRect.x , visRect.y + visRect.height , visRect.x + visRect.width } ; #ifdef __WXMAC_OSX__ bool isCompositing = textctrl->MacGetTopLevelWindow()->MacUsesCompositing() ; @@ -2188,10 +2192,6 @@ void wxMacMLTEClassicControl::MacUpdatePosition() SetControlViewSize( m_sbVertical , h ) ; } } - int x , y ; - x = y = 0 ; - textctrl->MacWindowToRootWindow( &x , &y ) ; - OffsetRect( &visBounds , x , y ) ; Rect oldviewRect ; TXNLongRect olddestRect ; @@ -2584,6 +2584,7 @@ OSStatus wxMacMLTEClassicControl::DoCreate() UMAGetControlBoundsInWindowCoords(m_controlRef, &bounds); m_txnControlBounds = bounds ; + m_txnVisBounds = bounds ; CGrafPtr origPort = NULL ; GDHandle origDev = NULL ; -- 2.45.2