#include "wx/settings.h"
#include "wx/filefn.h"
#include "wx/utils.h"
+#include "wx/sysopt.h"
#if defined(__BORLANDC__) && !defined(__WIN32__)
#include <alloc.h>
style |= wxTE_PROCESS_ENTER ;
}
+ bool forceMLTE = false ;
+#if wxUSE_SYSTEM_OPTIONS
+ if ( (wxSystemOptions::HasOption(wxMAC_TEXTCONTROL_USE_MLTE) ) && ( wxSystemOptions::GetOptionInt( wxMAC_TEXTCONTROL_USE_MLTE ) == 1) )
+ {
+ forceMLTE = true ;
+ }
+#endif
+
#ifdef __WXMAC_OSX__
#if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_2
- if ( UMAGetSystemVersion() >= 0x1050 )
+ if ( UMAGetSystemVersion() >= 0x1030 && forceMLTE == false )
{
- m_peer = new wxMacMLTEHIViewControl( this , str , pos , size , style ) ;
+ if ( m_windowStyle & wxTE_MULTILINE )
+ m_peer = new wxMacMLTEHIViewControl( this , str , pos , size , style ) ;
}
#endif
-#if !wxMAC_AWAYS_USE_MLTE
if ( !m_peer )
{
- m_peer = new wxMacUnicodeTextControl( this , str , pos , size , style ) ;
+ if ( !(m_windowStyle & wxTE_MULTILINE) && forceMLTE == false )
+ m_peer = new wxMacUnicodeTextControl( this , str , pos , size , style ) ;
}
-#endif
#endif
if ( !m_peer )
{
MacPostControlCreate(pos,size) ;
+ // only now the embedding is correct and we can do a positioning update
+
+ MacSuperChangedPosition() ;
+
if ( m_windowStyle & wxTE_READONLY)
{
SetEditable( false ) ;
TXNFrameOptions wxMacMLTEControl::FrameOptionsFromWXStyle( long wxStyle )
{
TXNFrameOptions frameOptions =
- kTXNDontDrawCaretWhenInactiveMask ;
-
+ kTXNDontDrawCaretWhenInactiveMask
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3
+ | kTXNDoFontSubstitutionMask
+#endif
+ ;
+
if ( ! ( wxStyle & wxTE_NOHIDESEL ) )
frameOptions |= kTXNDontDrawSelectionWhenInactiveMask ;
};
TXNControlData iControlData[] =
{
- {false},
+ {true},
{kTXNNoAutoWrap},
};
SInt32 dh = desired.h - current.h ;
TXNShowSelection( m_txn , true ) ;
theErr = TXNScroll( m_txn, kTXNScrollUnitsInPixels , kTXNScrollUnitsInPixels , &dv , &dh );
- wxASSERT_MSG( theErr == noErr, _T("TXNScroll returned an error!") );
+ // 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
destRect.bottom = destRect.top + 0x40000000 ;
SectRect( &viewRect , &visBounds , &viewRect ) ;
- TXNSetRectBounds( m_txn , &viewRect , &destRect , false ) ;
+ TXNSetRectBounds( m_txn , &viewRect , &destRect , true ) ;
/*
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);