I am using wx Widgets 2.9.2 on MACOS with c++ I was working on some scrolling issue and found one piece of code which I just want to understand .
The path is wxWidgets-2.9\src\osx\carbon\textctrl.cpp we are basically trying to implement scrolling in Text Control :
Code: Select all
if (( frameOptions & (kTXNWantVScrollBarMask | kTXNWantHScrollBarMask)) (frameOptions &kTXNSingleLineOnlyMask))
{
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 );
}
m_textView = NULL ;
HITextViewCreate( NULL , 0, frameOptions , &m_textView ) ;
m_txn = HITextViewGetTXNObject( m_textView ) ;
HIViewSetVisible( m_textView , true ) ;
if ( m_scrollView )
{
HIViewAddSubview( m_scrollView , m_textView ) ;
m_controlRef = m_scrollView ;
InstallEventHandler( (WXWidget) m_textView ) ;
}
else
{
HIViewSetFrame( m_textView, &hr );
m_controlRef = m_textView ;
}
So this thing is working fine but still I want to know that if any body has any other way of implement scrolling in single line text control instead of creating a vertical scroll bar intentionally and hiding it.
Thanks and Regards,
Vivek