]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/textctrl.cpp
Add chapter on backward compatibility
[wxWidgets.git] / src / mac / carbon / textctrl.cpp
index 9397ea6acde5f8c5f63cb8fb76ce9b7049de3acd..6980cdc9f3aa65a65cd54820c6e4f3347b02a239 100644 (file)
@@ -361,7 +361,6 @@ private :
 
 #define TE_UNLIMITED_LENGTH 0xFFFFFFFFUL
 
-#if !USE_SHARED_LIBRARY
 IMPLEMENT_DYNAMIC_CLASS(wxTextCtrl, wxControl)
 
 BEGIN_EVENT_TABLE(wxTextCtrl, wxControl)
@@ -380,7 +379,6 @@ BEGIN_EVENT_TABLE(wxTextCtrl, wxControl)
     EVT_UPDATE_UI(wxID_UNDO, wxTextCtrl::OnUpdateUndo)
     EVT_UPDATE_UI(wxID_REDO, wxTextCtrl::OnUpdateRedo)
 END_EVENT_TABLE()
-#endif
 
 // Text item
 void wxTextCtrl::Init()
@@ -655,7 +653,7 @@ void wxTextCtrl::WriteText(const wxString& str)
     if ( !wxIsMainThread() )
     {
         // unfortunately CW 8 is not able to correctly deduce the template types, so we have
-        // to instantiate explicitely
+        // to instantiate explicitly
         wxMacMPRemoteGUICall<wxTextCtrl,wxString>( this , &wxTextCtrl::WriteText , str ) ;
         return ;
     }
@@ -1426,7 +1424,7 @@ wxString wxMacMLTEControl::GetStringValue() const
                 SetHandleSize( theText , ( actualSize + 1 ) * sizeof( UniChar ) ) ;
                 HLock( theText ) ;
                 (((UniChar*)*theText)[actualSize]) = 0 ;
-                wxMBConvUTF16BE converter ;
+                wxMBConvUTF16 converter ;
                 size_t noChars = converter.MB2WC( NULL , (const char*)*theText , 0 ) ;
                 ptr = new wxChar[noChars + 1] ;
 
@@ -1488,7 +1486,11 @@ void wxMacMLTEControl::SetStringValue( const wxString &str)
 TXNFrameOptions wxMacMLTEControl::FrameOptionsFromWXStyle( long wxStyle )
 {
     TXNFrameOptions frameOptions =
-        kTXNDontDrawCaretWhenInactiveMask | kTXNDoFontSubstitutionMask ;
+        kTXNDontDrawCaretWhenInactiveMask 
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3
+        | kTXNDoFontSubstitutionMask
+#endif
+        ;
 
     if ( ! ( wxStyle & wxTE_NOHIDESEL ) )
         frameOptions |= kTXNDontDrawSelectionWhenInactiveMask ;
@@ -1894,7 +1896,7 @@ void wxMacMLTEControl::SetTXNData( const wxString& st , TXNOffset start , TXNOff
     TXNSetData( m_txn , kTXNUnicodeTextData,  (void*)st.wc_str(), len * 2,
       start, end);
 #else
-    wxMBConvUTF16BE converter ;
+    wxMBConvUTF16 converter ;
     ByteCount byteBufferLen = converter.WC2MB( NULL , st.wc_str() , 0 ) ;
     UniChar *unibuf = (UniChar*) malloc(byteBufferLen) ;
     converter.WC2MB( (char*) unibuf , st.wc_str() , byteBufferLen ) ;