]> git.saurik.com Git - wxWidgets.git/commitdiff
scrollbars added
authorStefan Csomor <csomor@advancedconcepts.ch>
Wed, 31 Mar 2004 16:45:37 +0000 (16:45 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Wed, 31 Mar 2004 16:45:37 +0000 (16:45 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26519 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/mac/carbon/textctrl.cpp

index e99c566bdd7bfc23007513682e591bc0029ef2af..82bf84e6dfab906e34e90432eeb082a248b2d3f1 100644 (file)
@@ -784,10 +784,31 @@ bool wxTextCtrl::Create(wxWindow *parent, wxWindowID id,
     {
 #if wxMAC_USE_MLTE_HIVIEW
         HIRect hr = { bounds.left , bounds.top , bounds.right - bounds.left , bounds.bottom- bounds.top } ;
-        HITextViewCreate( &hr , 0, FrameOptionsFromWXStyle( m_windowStyle ) , (ControlRef*) &m_macControl ) ;
-        m_macTXN = HITextViewGetTXNObject((ControlRef) m_macControl) ;
-        AdjustAttributesFromWXStyle( (TXNObject) m_macTXN , m_windowStyle , true ) ;
-        HIViewSetVisible( (ControlRef) m_macControl , true ) ;
+        HIViewRef scrollView = NULL ;
+        TXNFrameOptions frameOptions = FrameOptionsFromWXStyle( style ) ;
+
+        if ( frameOptions & (kTXNWantVScrollBarMask|kTXNWantHScrollBarMask) )
+        {
+            HIScrollViewCreate(( frameOptions & kTXNWantHScrollBarMask ? kHIScrollViewOptionsHorizScroll : 0) | 
+                ( frameOptions & kTXNWantVScrollBarMask ? kHIScrollViewOptionsVertScroll: 0 ) , &scrollView ) ;
+           
+               HIViewSetFrame( scrollView, &hr );
+               HIViewSetVisible( scrollView, true );
+        }
+        HIViewRef textView ;
+        HITextViewCreate( NULL , 0, frameOptions , (ControlRef*) &textView ) ;
+        m_macTXN = HITextViewGetTXNObject( textView) ;
+        AdjustAttributesFromWXStyle( (TXNObject) m_macTXN , style , true ) ;
+        HIViewSetVisible( (ControlRef) textView , true ) ;
+        if ( scrollView )
+        {
+            HIViewAddSubview( scrollView , textView ) ;
+            m_macControl = scrollView ;
+        }
+        else
+        {
+            m_macControl = textView ;
+        }
 #else
         short featurSet;