From: Stefan Csomor Date: Fri, 23 Nov 2001 22:25:03 +0000 (+0000) Subject: added virtual DoSetSize method in order to allow for MacOSX Listbox bug workaround X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/8614041baa77bdd4d733d7aaf1e1b0890f9beb18?ds=inline added virtual DoSetSize method in order to allow for MacOSX Listbox bug workaround git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12637 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/mac/carbon/listbox.cpp b/src/mac/carbon/listbox.cpp index 7dfe8b1f32..cb6e1e96ba 100644 --- a/src/mac/carbon/listbox.cpp +++ b/src/mac/carbon/listbox.cpp @@ -81,9 +81,9 @@ static pascal void wxMacListDefinition( short message, Boolean isSelected, Rect savedClipRegion = NewRgn(); GetClip( savedClipRegion ); + ClipRect( drawRect ); EraseRect( drawRect ); - MoveTo(drawRect->left + 4 , drawRect->top + 10 ); ::TextFont( kFontIDMonaco ) ; @@ -265,6 +265,27 @@ void wxListBox::Free() } } +void wxListBox::DoSetSize(int x, int y, + int width, int height, + int sizeFlags ) +{ + wxControl::DoSetSize( x , y , width , height , sizeFlags ) ; +#if TARGET_CARBON + Rect bounds ; + GetControlBounds( m_macControl , &bounds ) ; + ControlRef control = GetListVerticalScrollBar( m_macList ) ; + if ( control ) + { + Rect scrollbounds ; + GetControlBounds( control , &scrollbounds ) ; + if( scrollbounds.right != bounds.right + 1 ) + { + UMAMoveControl( control , bounds.right - (scrollbounds.right - scrollbounds.left) + 1 , + scrollbounds.top ) ; + } + } +#endif +} void wxListBox::DoSetFirstItem(int N) { MacScrollTo( N ) ; diff --git a/src/mac/listbox.cpp b/src/mac/listbox.cpp index 7dfe8b1f32..cb6e1e96ba 100644 --- a/src/mac/listbox.cpp +++ b/src/mac/listbox.cpp @@ -81,9 +81,9 @@ static pascal void wxMacListDefinition( short message, Boolean isSelected, Rect savedClipRegion = NewRgn(); GetClip( savedClipRegion ); + ClipRect( drawRect ); EraseRect( drawRect ); - MoveTo(drawRect->left + 4 , drawRect->top + 10 ); ::TextFont( kFontIDMonaco ) ; @@ -265,6 +265,27 @@ void wxListBox::Free() } } +void wxListBox::DoSetSize(int x, int y, + int width, int height, + int sizeFlags ) +{ + wxControl::DoSetSize( x , y , width , height , sizeFlags ) ; +#if TARGET_CARBON + Rect bounds ; + GetControlBounds( m_macControl , &bounds ) ; + ControlRef control = GetListVerticalScrollBar( m_macList ) ; + if ( control ) + { + Rect scrollbounds ; + GetControlBounds( control , &scrollbounds ) ; + if( scrollbounds.right != bounds.right + 1 ) + { + UMAMoveControl( control , bounds.right - (scrollbounds.right - scrollbounds.left) + 1 , + scrollbounds.top ) ; + } + } +#endif +} void wxListBox::DoSetFirstItem(int N) { MacScrollTo( N ) ;