#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>
OSType m_valueTag ;
} ;
-#else
+#endif
// implementation available under classic
STPTextPaneVars* m_macTXNvars ;
} ;
-#endif
-// built-in TextCtrl
-
-
#define TE_UNLIMITED_LENGTH 0xFFFFFFFFUL
#if !USE_SHARED_LIBRARY
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 ) ;
}
- else
#endif
+#if !wxMAC_AWAYS_USE_MLTE
+ if ( !m_peer )
{
m_peer = new wxMacUnicodeTextControl( this , str , pos , size , style ) ;
}
-#else
- m_peer = new wxMacMLTEClassicControl( this , str , pos , size , style ) ;
#endif
+#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) ;
// 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
if (PtInRect(where, &varsp->fRBounds))
result = kmUPTextPart;
else
- result = 0;
+ {
+ // 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;
+ }
}
return result;
}
return err;
}
-
-#endif
-
// ----------------------------------------------------------------------------
// MLTE control implementation (OSX part)
// ----------------------------------------------------------------------------