override DoSetBitmap() instead of SetBitmapLabel()
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61129 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -9,19 +9,15 @@
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_BMPBUTTN_H_
|
||||
#define _WX_BMPBUTTN_H_
|
||||
#ifndef _WX_OSX_BMPBUTTN_H_
|
||||
#define _WX_OSX_BMPBUTTN_H_
|
||||
|
||||
#include "wx/button.h"
|
||||
|
||||
WXDLLIMPEXP_DATA_CORE(extern const char) wxButtonNameStr[];
|
||||
|
||||
#define wxDEFAULT_BUTTON_MARGIN 4
|
||||
|
||||
class WXDLLIMPEXP_CORE wxBitmapButton: public wxBitmapButtonBase
|
||||
class WXDLLIMPEXP_CORE wxBitmapButton : public wxBitmapButtonBase
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxBitmapButton)
|
||||
|
||||
public:
|
||||
wxBitmapButton()
|
||||
{
|
||||
@@ -43,11 +39,12 @@ public:
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxButtonNameStr);
|
||||
|
||||
virtual void SetBitmapLabel(const wxBitmap& bitmap);
|
||||
|
||||
protected:
|
||||
virtual wxSize DoGetBestSize() const;
|
||||
|
||||
virtual void DoSetBitmap(const wxBitmap& bitmap, State which);
|
||||
|
||||
DECLARE_DYNAMIC_CLASS(wxBitmapButton)
|
||||
};
|
||||
|
||||
#endif
|
||||
// _WX_BMPBUTTN_H_
|
||||
#endif // _WX_OSX_BMPBUTTN_H_
|
||||
|
@@ -61,11 +61,15 @@ bool wxBitmapButton::Create( wxWindow *parent,
|
||||
return true;
|
||||
}
|
||||
|
||||
void wxBitmapButton::SetBitmapLabel( const wxBitmap& bitmap )
|
||||
void wxBitmapButton::DoSetBitmap(const wxBitmap& bitmap, State which)
|
||||
{
|
||||
InvalidateBestSize();
|
||||
wxBitmapButtonBase::DoSetBitmap(bitmap, which);
|
||||
|
||||
m_peer->SetBitmap( bitmap );
|
||||
// we don't support any other states currently
|
||||
if ( which == State_Normal )
|
||||
{
|
||||
m_peer->SetBitmap( bitmap );
|
||||
}
|
||||
}
|
||||
|
||||
wxSize wxBitmapButton::DoGetBestSize() const
|
||||
|
Reference in New Issue
Block a user