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
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#ifndef _WX_BMPBUTTN_H_
|
#ifndef _WX_OSX_BMPBUTTN_H_
|
||||||
#define _WX_BMPBUTTN_H_
|
#define _WX_OSX_BMPBUTTN_H_
|
||||||
|
|
||||||
#include "wx/button.h"
|
#include "wx/button.h"
|
||||||
|
|
||||||
WXDLLIMPEXP_DATA_CORE(extern const char) wxButtonNameStr[];
|
|
||||||
|
|
||||||
#define wxDEFAULT_BUTTON_MARGIN 4
|
#define wxDEFAULT_BUTTON_MARGIN 4
|
||||||
|
|
||||||
class WXDLLIMPEXP_CORE wxBitmapButton : public wxBitmapButtonBase
|
class WXDLLIMPEXP_CORE wxBitmapButton : public wxBitmapButtonBase
|
||||||
{
|
{
|
||||||
DECLARE_DYNAMIC_CLASS(wxBitmapButton)
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
wxBitmapButton()
|
wxBitmapButton()
|
||||||
{
|
{
|
||||||
@@ -43,11 +39,12 @@ public:
|
|||||||
const wxValidator& validator = wxDefaultValidator,
|
const wxValidator& validator = wxDefaultValidator,
|
||||||
const wxString& name = wxButtonNameStr);
|
const wxString& name = wxButtonNameStr);
|
||||||
|
|
||||||
virtual void SetBitmapLabel(const wxBitmap& bitmap);
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual wxSize DoGetBestSize() const;
|
virtual wxSize DoGetBestSize() const;
|
||||||
|
|
||||||
|
virtual void DoSetBitmap(const wxBitmap& bitmap, State which);
|
||||||
|
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxBitmapButton)
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif // _WX_OSX_BMPBUTTN_H_
|
||||||
// _WX_BMPBUTTN_H_
|
|
||||||
|
@@ -61,12 +61,16 @@ bool wxBitmapButton::Create( wxWindow *parent,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxBitmapButton::SetBitmapLabel( const wxBitmap& bitmap )
|
void wxBitmapButton::DoSetBitmap(const wxBitmap& bitmap, State which)
|
||||||
{
|
{
|
||||||
InvalidateBestSize();
|
wxBitmapButtonBase::DoSetBitmap(bitmap, which);
|
||||||
|
|
||||||
|
// we don't support any other states currently
|
||||||
|
if ( which == State_Normal )
|
||||||
|
{
|
||||||
m_peer->SetBitmap( bitmap );
|
m_peer->SetBitmap( bitmap );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
wxSize wxBitmapButton::DoGetBestSize() const
|
wxSize wxBitmapButton::DoGetBestSize() const
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user