git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28204
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
#ifndef __DARWIN__
#include <Scrap.h>
#endif
#ifndef __DARWIN__
#include <Scrap.h>
#endif
+
+#ifndef wxMAC_AWAYS_USE_MLTE
+#define wxMAC_AWAYS_USE_MLTE 1
+#endif
+
#include <MacTextEditor.h>
#include <ATSUnicode.h>
#include <TextCommon.h>
#include <MacTextEditor.h>
#include <ATSUnicode.h>
#include <TextCommon.h>
// implementation available under classic
// implementation available under classic
STPTextPaneVars* m_macTXNvars ;
} ;
STPTextPaneVars* m_macTXNvars ;
} ;
-#endif
-// built-in TextCtrl
-
-
#define TE_UNLIMITED_LENGTH 0xFFFFFFFFUL
#if !USE_SHARED_LIBRARY
#define TE_UNLIMITED_LENGTH 0xFFFFFFFFUL
#if !USE_SHARED_LIBRARY
m_windowStyle |= wxTE_PROCESS_ENTER;
style |= wxTE_PROCESS_ENTER ;
}
m_windowStyle |= wxTE_PROCESS_ENTER;
style |= wxTE_PROCESS_ENTER ;
}
#if TARGET_API_MAC_OSX
#if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_2
if ( UMAGetSystemVersion() >= 0x1030 )
{
m_peer = new wxMacMLTEHIViewControl( this , str , pos , size , style ) ;
}
#if TARGET_API_MAC_OSX
#if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_2
if ( UMAGetSystemVersion() >= 0x1030 )
{
m_peer = new wxMacMLTEHIViewControl( this , str , pos , size , style ) ;
}
+#if !wxMAC_AWAYS_USE_MLTE
+ if ( !m_peer )
{
m_peer = new wxMacUnicodeTextControl( this , str , pos , size , style ) ;
}
{
m_peer = new wxMacUnicodeTextControl( this , str , pos , size , style ) ;
}
-#else
- m_peer = new wxMacMLTEClassicControl( this , str , pos , size , style ) ;
+#endif
+ if ( !m_peer )
+ {
+ // this control draws the border itself
+ if ( !HasFlag(wxNO_BORDER) )
+ m_windowStyle &= ~wxSUNKEN_BORDER ;
+ m_peer = new wxMacMLTEClassicControl( this , str , pos , size , style ) ;
+ }
MacPostControlCreate(pos,size) ;
MacPostControlCreate(pos,size) ;
// MLTE control implementation (classic part)
// ----------------------------------------------------------------------------
// MLTE control implementation (classic part)
// ----------------------------------------------------------------------------
-#if !TARGET_API_MAC_OSX
-
// CS:TODO we still have a problem getting properly at the text events of a control because under Carbon
// the MLTE engine registers itself for the key events thus the normal flow never occurs, the only measure for the
// moment is to avoid setting the true focus on the control, the proper solution at the end would be to have
// CS:TODO we still have a problem getting properly at the text events of a control because under Carbon
// the MLTE engine registers itself for the key events thus the normal flow never occurs, the only measure for the
// moment is to avoid setting the true focus on the control, the proper solution at the end would be to have
if (PtInRect(where, &varsp->fRBounds))
result = kmUPTextPart;
else
if (PtInRect(where, &varsp->fRBounds))
result = kmUPTextPart;
else
+ {
+ // sometimes we get the coords also in control local coordinates, therefore test again
+ if ( textctrl->MacGetTopLevelWindow()->MacUsesCompositing() )
+ {
+ int x = 0 , y = 0 ;
+ textctrl->MacClientToRootWindow( &x , &y ) ;
+ where.h += x ;
+ where.v += y ;
+ }
+ if (PtInRect(where, &varsp->fRBounds))
+ result = kmUPTextPart;
+ else
+ result = 0;
+ }
// ----------------------------------------------------------------------------
// MLTE control implementation (OSX part)
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
// MLTE control implementation (OSX part)
// ----------------------------------------------------------------------------