X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/55d0b180270fcaa3e3be77110f2857bbab008fdd..694f70fa9c0cc8889c208020bf75b2e3861f6818:/src/mac/carbon/textctrl.cpp diff --git a/src/mac/carbon/textctrl.cpp b/src/mac/carbon/textctrl.cpp index c80ba8ff6f..2c69426a4c 100644 --- a/src/mac/carbon/textctrl.cpp +++ b/src/mac/carbon/textctrl.cpp @@ -2113,24 +2113,16 @@ void wxMacMLTEClassicControl::MacSetObjectVisibility(Boolean vis) SetKeyboardFocus( m_txnWindow , m_controlRef , kControlFocusNoPart ) ; } - TXNControlTag iControlTags[] = - { - kTXNVisibilityTag , - }; - TXNControlData iControlData[] = - { - {(UInt32) false }, - }; - - int toptag = WXSIZEOF( iControlTags ) ; + TXNControlTag iControlTags[1] = { kTXNVisibilityTag }; + TXNControlData iControlData[1] = { {(UInt32) false } }; - verify_noerr( TXNGetTXNObjectControls( m_txn , toptag, + verify_noerr( TXNGetTXNObjectControls( m_txn , 1, iControlTags, iControlData ) ) ; if ( iControlData[0].uValue != vis ) { iControlData[0].uValue = vis ; - verify_noerr( TXNSetTXNObjectControls( m_txn, false , toptag, + verify_noerr( TXNSetTXNObjectControls( m_txn, false , 1, iControlTags, iControlData )) ; } // we right now are always clipping as partial visibility (overlapped) visibility @@ -2155,6 +2147,8 @@ void wxMacMLTEClassicControl::MacUpdatePosition() Rect oldBounds = m_txnControlBounds ; m_txnControlBounds = bounds ; 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() ; @@ -2194,8 +2188,32 @@ 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 ; + TXNGetRectBounds( m_txn , &oldviewRect , &olddestRect , NULL ) ; + + Rect viewRect = { m_txnControlBounds.top, m_txnControlBounds.left, + m_txnControlBounds.bottom - ( m_sbHorizontal ? 14 : 0 ) , m_txnControlBounds.right - ( m_sbVertical ? 14 : 0 ) } ; + TXNLongRect destRect = { m_txnControlBounds.top, m_txnControlBounds.left, + m_txnControlBounds.bottom - ( m_sbHorizontal ? 14 : 0 ) , m_txnControlBounds.right - ( m_sbVertical ? 14 : 0 ) } ; + + if ( olddestRect.right >= 10000 ) + destRect.right = destRect.left + 32000 ; + + if ( olddestRect.bottom >= 0x20000000 ) + destRect.bottom = destRect.top + 0x40000000 ; + + SectRect( &viewRect , &visBounds , &viewRect ) ; + TXNSetRectBounds( m_txn , &viewRect , &destRect , false ) ; +/* TXNSetFrameBounds( m_txn, m_txnControlBounds.top, m_txnControlBounds.left, m_txnControlBounds.bottom - ( m_sbHorizontal ? 14 : 0 ) , m_txnControlBounds.right - ( m_sbVertical ? 14 : 0 ), m_txnFrameID); +*/ #else TXNSetFrameBounds( m_txn, m_txnControlBounds.top, m_txnControlBounds.left, @@ -2615,7 +2633,7 @@ OSStatus wxMacMLTEClassicControl::DoCreate() kTXNTextensionFile, kTXNSystemDefaultEncoding, &m_txn, &m_txnFrameID, NULL ) ); - +/* TXNCarbonEventInfo cInfo ; cInfo.useCarbonEvents = false ; @@ -2637,7 +2655,7 @@ OSStatus wxMacMLTEClassicControl::DoCreate() verify_noerr( TXNSetTXNObjectControls( m_txn, false , toptag, iControlTags, iControlData )) ; - +*/ #ifdef __WXMAC_OSX__ TXNRegisterScrollInfoProc( m_txn, gTXNScrollInfoProc, (SInt32) this); #endif