]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/textctrl.cpp
Look for and remove any "-NSKey" "value" types of options from argv just like
[wxWidgets.git] / src / mac / carbon / textctrl.cpp
index f4a3f34178b0ebadbd2a63e4abd68502a3468dfb..dd9601d7c025107e4381c2f49d8cefa0477f248b 100644 (file)
@@ -448,7 +448,7 @@ void wxTextCtrl::CreatePeer(
     }
 #endif
 
-    // the horizontal single line scrolling bug that made us keep 
+    // the horizontal single line scrolling bug that made us keep
 #if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5
     if ( !m_peer )
         m_peer = new wxMacMLTEClassicControl( this , str , pos , size , style ) ;
@@ -1374,7 +1374,7 @@ bool wxMacUnicodeTextControl::Create( wxTextCtrl *wxPeer,
     wxMacConvertNewlines10To13( &st ) ;
     wxMacCFStringHolder cf(st , m_font.GetEncoding()) ;
     CFStringRef cfr = cf ;
-    
+
     m_valueTag = kControlEditTextCFStringTag ;
     CreateControl( wxPeer, &bounds, cfr );
 
@@ -1384,7 +1384,7 @@ bool wxMacUnicodeTextControl::Create( wxTextCtrl *wxPeer,
     InstallControlEventHandler( m_controlRef , GetwxMacUnicodeTextControlEventHandlerUPP(),
                                 GetEventTypeCount(unicodeTextControlEventList), unicodeTextControlEventList, this,
                                 &m_focusHandlerRef);
-                                
+
     return true;
 }
 
@@ -1829,7 +1829,7 @@ void wxMacMLTEControl::TXNSetAttribute( const wxTextAttr& style , long from , lo
 
     if ( style.HasFont() )
     {
-        const wxFont &font = style.GetFont() ;
+        wxFont font(style.GetFont()) ;
 
 #if 0 // old version
         Str255 fontName = "\pMonaco" ;
@@ -3027,12 +3027,20 @@ wxMacMLTEHIViewControl::wxMacMLTEHIViewControl( wxTextCtrl *wxPeer,
 
     m_scrollView = NULL ;
     TXNFrameOptions frameOptions = FrameOptionsFromWXStyle( style ) ;
-    if ( frameOptions & (kTXNWantVScrollBarMask | kTXNWantHScrollBarMask) )
+    if (( frameOptions & (kTXNWantVScrollBarMask | kTXNWantHScrollBarMask)) || !(frameOptions &kTXNSingleLineOnlyMask))
     {
-        HIScrollViewCreate(
-            (frameOptions & kTXNWantHScrollBarMask ? kHIScrollViewOptionsHorizScroll : 0)
-            | (frameOptions & kTXNWantVScrollBarMask ? kHIScrollViewOptionsVertScroll : 0) ,
-            &m_scrollView ) ;
+        if ( frameOptions & (kTXNWantVScrollBarMask | kTXNWantHScrollBarMask) )
+        {
+            HIScrollViewCreate(
+                (frameOptions & kTXNWantHScrollBarMask ? kHIScrollViewOptionsHorizScroll : 0)
+                | (frameOptions & kTXNWantVScrollBarMask ? kHIScrollViewOptionsVertScroll : 0) ,
+                &m_scrollView ) ;
+        }
+        else
+        {
+            HIScrollViewCreate(kHIScrollViewOptionsVertScroll,&m_scrollView);
+            HIScrollViewSetScrollBarAutoHide(m_scrollView,true);
+        }
 
         HIViewSetFrame( m_scrollView, &hr );
         HIViewSetVisible( m_scrollView, true );