From 6cfe484434ddd9e130a0e6e2d5868fd67f189b92 Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Fri, 5 Jan 2007 16:28:03 +0000 Subject: [PATCH] allowing vertical scrolling even if wxTE_NO_VSCROLL is given, displaying a scrollbar only when needed. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@44098 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/mac/carbon/textctrl.cpp | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/mac/carbon/textctrl.cpp b/src/mac/carbon/textctrl.cpp index f4a3f34178..fd154aae35 100644 --- a/src/mac/carbon/textctrl.cpp +++ b/src/mac/carbon/textctrl.cpp @@ -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 ); -- 2.45.2