]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/textctrl.cpp
missing include for memoryDC
[wxWidgets.git] / src / mac / carbon / textctrl.cpp
index 9ebcb555be70b66cfd305da09791e15312e5f19d..b096589a8bedcde1269af150e3aab7336d72bf7a 100644 (file)
@@ -1532,24 +1532,28 @@ void wxMacMLTEControl::AdjustCreationAttributes( const wxColour &background, boo
                                         iControlTags, iControlData )) ;
 
     // setting the default font
+    // under 10.2 this causes a visible caret, therefore we avoid it
 
-    Str255 fontName ;
-    SInt16 fontSize ;
-    Style fontStyle ;
-
-    GetThemeFont(kThemeSystemFont , GetApplicationScript() , fontName , &fontSize , &fontStyle ) ;
-
-    TXNTypeAttributes typeAttr[] =
+    if ( UMAGetSystemVersion() >= 0x1030 )
     {
-        {   kTXNQDFontNameAttribute , kTXNQDFontNameAttributeSize , { (void*) fontName } } ,
-        {   kTXNQDFontSizeAttribute , kTXNFontSizeAttributeSize , { (void*) (fontSize << 16) } } ,
-        {   kTXNQDFontStyleAttribute , kTXNQDFontStyleAttributeSize , {  (void*) normal } } ,
-    } ;
+        Str255 fontName ;
+        SInt16 fontSize ;
+        Style fontStyle ;
+
+        GetThemeFont(kThemeSystemFont , GetApplicationScript() , fontName , &fontSize , &fontStyle ) ;
 
-    verify_noerr( TXNSetTypeAttributes (m_txn, sizeof( typeAttr ) / sizeof(TXNTypeAttributes) , typeAttr,
-          kTXNStartOffset,
-          kTXNEndOffset) );
+        TXNTypeAttributes typeAttr[] =
+        {
+            {   kTXNQDFontNameAttribute , kTXNQDFontNameAttributeSize , { (void*) fontName } } ,
+            {   kTXNQDFontSizeAttribute , kTXNFontSizeAttributeSize , { (void*) (fontSize << 16) } } ,
+            {   kTXNQDFontStyleAttribute , kTXNQDFontStyleAttributeSize , {  (void*) normal } } ,
+        } ;
 
+        verify_noerr( TXNSetTypeAttributes (m_txn, sizeof( typeAttr ) / sizeof(TXNTypeAttributes) , typeAttr,
+              kTXNStartOffset,
+              kTXNEndOffset) );
+    }
+    
     if ( m_windowStyle & wxTE_PASSWORD )
     {
         UniChar c = 0xA5 ;
@@ -2109,24 +2113,16 @@ void wxMacMLTEClassicControl::MacSetObjectVisibility(Boolean vis)
         SetKeyboardFocus( m_txnWindow , m_controlRef , kControlFocusNoPart ) ;
     }
     
-    TXNControlTag iControlTags[] = 
-        { 
-            kTXNVisibilityTag ,
-        };
-    TXNControlData iControlData[] = 
-        { 
-            {(UInt32) false },
-        };
-        
-    int toptag = WXSIZEOF( iControlTags ) ;
+    TXNControlTag iControlTags[1] = { kTXNVisibilityTag };
+    TXNControlData iControlData[1] = { {(UInt32) false } };
 
-    verify_noerr( TXNGetTXNObjectControls( m_txn , toptag,
+    verify_noerr( TXNGetTXNObjectControls( m_txn , 1,
                                         iControlTags, iControlData ) ) ;
                                         
     if ( iControlData[0].uValue != vis )
     {
         iControlData[0].uValue = vis ;
-        verify_noerr( TXNSetTXNObjectControls( m_txn, false , toptag,
+        verify_noerr( TXNSetTXNObjectControls( m_txn, false , 1,
                                         iControlTags, iControlData )) ;
     }
     // we right now are always clipping as partial visibility (overlapped) visibility
@@ -2612,6 +2608,28 @@ OSStatus wxMacMLTEClassicControl::DoCreate()
                               kTXNSystemDefaultEncoding,
                               &m_txn, &m_txnFrameID, NULL ) );
 
+    TXNCarbonEventInfo cInfo ;
+    
+    cInfo.useCarbonEvents = false ;
+    cInfo.filler = 0 ;
+    cInfo.flags = 0 ;
+    cInfo.fDictionary = NULL ;
+
+    TXNControlTag iControlTags[] = 
+        { 
+            kTXNUseCarbonEvents ,
+        };
+    TXNControlData iControlData[] = 
+        { 
+            {(UInt32) &cInfo },
+        };
+        
+    int toptag = WXSIZEOF( iControlTags ) ;
+
+    verify_noerr( TXNSetTXNObjectControls( m_txn, false , toptag,
+                                        iControlTags, iControlData )) ;
+
+
 #ifdef __WXMAC_OSX__
     TXNRegisterScrollInfoProc( m_txn, gTXNScrollInfoProc, (SInt32) this);
 #endif