#include "wx/mac/uma.h"
-
-// if this is set to 1 then under OSX 10.2 the 'classic' MLTE implementation will be used
-// if set to 0 then the unicode textctrl will be used
-#ifndef wxMAC_AWAYS_USE_MLTE
-#define wxMAC_AWAYS_USE_MLTE 1
-#endif
-
#ifndef __WXMAC_OSX__
enum
{
forceMLTE = true ;
}
#endif
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
+ forceMLTE = false;
+#endif
#ifdef __WXMAC_OSX__
#if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_2
if ( !m_peer )
{
+#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5
if ( !(m_windowStyle & wxTE_MULTILINE) && !forceMLTE )
+#endif
+ {
m_peer = new wxMacUnicodeTextControl( this , str , pos , size , style ) ;
+ }
}
#endif
+ // the horizontal single line scrolling bug that made us keep
+#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5
if ( !m_peer )
m_peer = new wxMacMLTEClassicControl( this , str , pos , size , style ) ;
+#endif
MacPostControlCreate(pos, size) ;
wxMacConvertNewlines10To13( &st );
{
- wxMacWindowClipper c( m_peer );
+#ifndef __LP64__
+ wxMacWindowClipper c( m_peer ) ;
+#endif
{
wxMacEditHelper help( m_txn );
#else
typeAttr[attrCount].tag = kTXNATSUIStyle ;
typeAttr[attrCount].size = kTXNATSUIStyleSize ;
- typeAttr[attrCount].data.dataValue = (UInt32)font.MacGetATSUStyle() ;
+ typeAttr[attrCount].data.dataPtr = font.MacGetATSUStyle() ;
attrCount++ ;
#endif
}
wxMacConvertNewlines10To13( &value ) ;
wxMacEditHelper help( m_txn ) ;
+#ifndef __LP64__
wxMacWindowClipper c( m_peer ) ;
+#endif
TXNSetSelection( m_txn, from, to ) ;
TXNClear( m_txn ) ;
void wxMacMLTEControl::Remove( long from , long to )
{
+#ifndef __LP64__
wxMacWindowClipper c( m_peer ) ;
+#endif
wxMacEditHelper help( m_txn ) ;
TXNSetSelection( m_txn , from , to ) ;
TXNClear( m_txn ) ;
void wxMacMLTEControl::SetSelection( long from , long to )
{
+#ifndef __LP64__
wxMacWindowClipper c( m_peer ) ;
+#endif
// change the selection
if ((from == -1) && (to == -1))
long start , end , dummy ;
GetSelection( &start , &dummy ) ;
+#ifndef __LP64__
wxMacWindowClipper c( m_peer ) ;
+#endif
{
wxMacEditHelper helper( m_txn ) ;
void wxMacMLTEControl::Clear()
{
+#ifndef __LP64__
wxMacWindowClipper c( m_peer ) ;
+#endif
wxMacEditHelper st( m_txn ) ;
TXNSetSelection( m_txn , kTXNStartOffset , kTXNEndOffset ) ;
TXNClear( m_txn ) ;
void wxMacMLTEControl::ShowPosition( long pos )
{
-#if TARGET_RT_MAC_MACHO && defined(AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER)
- {
- Point current, desired ;
- TXNOffset selstart, selend;
+ Point current, desired ;
+ TXNOffset selstart, selend;
- TXNGetSelection( m_txn, &selstart, &selend );
- TXNOffsetToPoint( m_txn, selstart, ¤t );
- TXNOffsetToPoint( m_txn, pos, &desired );
+ TXNGetSelection( m_txn, &selstart, &selend );
+ TXNOffsetToPoint( m_txn, selstart, ¤t );
+ TXNOffsetToPoint( m_txn, pos, &desired );
- // TODO: use HIPoints for 10.3 and above
- if ( (UInt32)TXNScroll != (UInt32)kUnresolvedCFragSymbolAddress )
- {
- OSErr theErr = noErr;
- SInt32 dv = desired.v - current.v;
- SInt32 dh = desired.h - current.h;
- TXNShowSelection( m_txn, kTXNShowStart ) ; // NB: should this be kTXNShowStart or kTXNShowEnd ??
- theErr = TXNScroll( m_txn, kTXNScrollUnitsInPixels, kTXNScrollUnitsInPixels, &dv, &dh );
-
- // there will be an error returned for classic MLTE implementation when the control is
- // invisible, but HITextView works correctly, so we don't assert that one
- // wxASSERT_MSG( theErr == noErr, _T("TXNScroll returned an error!") );
- }
- }
-#endif
+ // TODO: use HIPoints for 10.3 and above
+
+ OSErr theErr = noErr;
+ long dv = desired.v - current.v;
+ long dh = desired.h - current.h;
+ TXNShowSelection( m_txn, kTXNShowStart ) ; // NB: should this be kTXNShowStart or kTXNShowEnd ??
+ theErr = TXNScroll( m_txn, kTXNScrollUnitsInPixels, kTXNScrollUnitsInPixels, &dv, &dh );
+
+ // there will be an error returned for classic MLTE implementation when the control is
+ // invisible, but HITextView works correctly, so we don't assert that one
+ // wxASSERT_MSG( theErr == noErr, _T("TXNScroll returned an error!") );
}
void wxMacMLTEControl::SetTXNData( const wxString& st, TXNOffset start, TXNOffset end )
return theLength ;
}
+#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5
+
// ----------------------------------------------------------------------------
// MLTE control implementation (classic part)
// ----------------------------------------------------------------------------
return err;
}
+#endif
// ----------------------------------------------------------------------------
// MLTE control implementation (OSX part)
}
AdjustCreationAttributes( *wxWHITE , true ) ;
-
+#ifndef __LP64__
wxMacWindowClipper c( m_peer ) ;
+#endif
SetTXNData( st , kTXNStartOffset, kTXNEndOffset ) ;
TXNSetSelection( m_txn, 0, 0 );