X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/411a1c35ff2e9be0bef6e2997f00dded357f2906..8a31648287be0ef976f133de2786b137f1e98340:/src/osx/bmpbuttn_osx.cpp?ds=sidebyside diff --git a/src/osx/bmpbuttn_osx.cpp b/src/osx/bmpbuttn_osx.cpp index 6264a9baa8..a2c2eadfee 100644 --- a/src/osx/bmpbuttn_osx.cpp +++ b/src/osx/bmpbuttn_osx.cpp @@ -4,7 +4,7 @@ // Author: Stefan Csomor // Modified by: // Created: 1998-01-01 -// RCS-ID: $Id: bmpbuttn.cpp 54820 2008-07-29 20:04:11Z SC $ +// RCS-ID: $Id$ // Copyright: (c) Stefan Csomor // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -20,13 +20,6 @@ #include "wx/dcmemory.h" #endif -IMPLEMENT_DYNAMIC_CLASS(wxBitmapButton, wxButton) - -BEGIN_EVENT_TABLE(wxBitmapButton, wxButton) - EVT_ENTER_WINDOW(wxBitmapButton::OnEnterWindow) - EVT_LEAVE_WINDOW(wxBitmapButton::OnLeaveWindow) -END_EVENT_TABLE() - #include "wx/osx/private.h" //--------------------------------------------------------------------------- @@ -40,8 +33,8 @@ bool wxBitmapButton::Create( wxWindow *parent, const wxValidator& validator, const wxString& name ) { - m_macIsUserPane = false; - + DontCreatePeer(); + if ( !wxBitmapButtonBase::Create(parent, id, pos, size, style, validator, name) ) return false; @@ -59,30 +52,13 @@ bool wxBitmapButton::Create( wxWindow *parent, m_bitmaps[State_Normal] = bitmap; - m_peer = wxWidgetImpl::CreateBitmapButton( this, parent, id, bitmap, pos, size, style, GetExtraStyle() ); + SetPeer(wxWidgetImpl::CreateBitmapButton( this, parent, id, bitmap, pos, size, style, GetExtraStyle() )); MacPostControlCreate( pos, size ); return true; } -void wxBitmapButton::DoSetBitmap(const wxBitmap& bitmap, State which) -{ - wxBitmapButtonBase::DoSetBitmap(bitmap, which); - - // we don't support any other states currently - if ( which == State_Normal ) - { - m_peer->SetBitmap( bitmap ); - } - else if ( which == State_Pressed ) - { - wxBitmapButtonImpl* bi = dynamic_cast (m_peer); - if ( bi ) - bi->SetPressedBitmap(bitmap); - } -} - wxSize wxBitmapButton::DoGetBestSize() const { wxSize best(m_marginX, m_marginY); @@ -97,16 +73,4 @@ wxSize wxBitmapButton::DoGetBestSize() const return best; } -void wxBitmapButton::OnEnterWindow( wxMouseEvent& WXUNUSED(event)) -{ - if ( DoGetBitmap( State_Current ).IsOk() ) - m_peer->SetBitmap( DoGetBitmap( State_Current ) ); -} - -void wxBitmapButton::OnLeaveWindow( wxMouseEvent& WXUNUSED(event)) -{ - if ( DoGetBitmap( State_Current ).IsOk() ) - m_peer->SetBitmap( DoGetBitmap( State_Normal ) ); -} - #endif // wxUSE_BMPBUTTON