X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b5b208a1796ecf1b9ab267d200705b4f3b4d10e3..60372b0d54379701d62edf5595a7dc25c48330e1:/src/osx/scrolbar_osx.cpp?ds=sidebyside diff --git a/src/osx/scrolbar_osx.cpp b/src/osx/scrolbar_osx.cpp index cbe8cdfe87..9b71f0e436 100644 --- a/src/osx/scrolbar_osx.cpp +++ b/src/osx/scrolbar_osx.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: src/osx/carbon/scrolbar.cpp +// Name: src/osx/scrolbar_osx.cpp // Purpose: wxScrollBar // Author: Stefan Csomor // Modified by: @@ -23,8 +23,6 @@ #if wxUSE_SCROLLBAR -IMPLEMENT_DYNAMIC_CLASS(wxScrollBar, wxControl) - BEGIN_EVENT_TABLE(wxScrollBar, wxControl) END_EVENT_TABLE() @@ -36,13 +34,13 @@ bool wxScrollBar::Create( wxWindow *parent, long style, const wxValidator& validator, const wxString& name ) -{ - m_macIsUserPane = false; - +{ + DontCreatePeer(); + if ( !wxControl::Create( parent, id, pos, size, style, validator, name ) ) return false; - m_peer = wxWidgetImpl::CreateScrollBar( this, parent, id, pos, size, style, GetExtraStyle() ); + SetPeer(wxWidgetImpl::CreateScrollBar( this, parent, id, pos, size, style, GetExtraStyle() )); MacPostControlCreate( pos, size ); @@ -55,12 +53,12 @@ wxScrollBar::~wxScrollBar() void wxScrollBar::SetThumbPosition( int viewStart ) { - m_peer->SetScrollThumb( viewStart, m_viewSize ); + GetPeer()->SetScrollThumb( viewStart, m_viewSize ); } int wxScrollBar::GetThumbPosition() const { - return m_peer->GetValue(); + return GetPeer()->GetValue(); } void wxScrollBar::SetScrollbar( int position, @@ -75,8 +73,8 @@ void wxScrollBar::SetScrollbar( int position, int range1 = wxMax( (m_objectSize - m_viewSize), 0 ); - m_peer->SetMaximum( range1 ); - m_peer->SetScrollThumb( position, m_viewSize ); + GetPeer()->SetMaximum( range1 ); + GetPeer()->SetScrollThumb( position, m_viewSize ); } void wxScrollBar::Command( wxCommandEvent& event ) @@ -87,7 +85,7 @@ void wxScrollBar::Command( wxCommandEvent& event ) bool wxScrollBar::OSXHandleClicked( double WXUNUSED(timestampsec) ) { - int new_pos = m_peer->GetValue(); + int new_pos = GetPeer()->GetValue(); wxScrollEvent event( wxEVT_SCROLL_THUMBRELEASE, m_windowId ); if ( m_windowStyle & wxHORIZONTAL ) @@ -129,9 +127,9 @@ wxSize wxScrollBar::DoGetBestSize() const void wxScrollBar::TriggerScrollEvent( wxEventType scrollEvent ) { - int position = m_peer->GetValue(); + int position = GetPeer()->GetValue(); int minPos = 0 ; - int maxPos = m_peer->GetMaximum(); + int maxPos = GetPeer()->GetMaximum(); int nScrollInc = 0; if ( scrollEvent == wxEVT_SCROLL_LINEUP ) @@ -178,4 +176,4 @@ void wxScrollBar::TriggerScrollEvent( wxEventType scrollEvent ) HandleWindowEvent( event ); } -#endif \ No newline at end of file +#endif