added SetHoverBitmap() and implemented it under wxMSW; extended the docs
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36069 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -44,16 +44,20 @@ public:
|
||||
{ m_bmpFocus = focus; OnSetBitmap(); };
|
||||
void SetBitmapDisabled(const wxBitmap& disabled)
|
||||
{ m_bmpDisabled = disabled; OnSetBitmap(); };
|
||||
void SetBitmapHover(const wxBitmap& hover)
|
||||
{ m_bmpHover = hover; OnSetBitmap(); }
|
||||
|
||||
// retrieve the bitmaps
|
||||
const wxBitmap& GetBitmapLabel() const { return m_bmpNormal; }
|
||||
const wxBitmap& GetBitmapSelected() const { return m_bmpSelected; }
|
||||
const wxBitmap& GetBitmapFocus() const { return m_bmpFocus; }
|
||||
const wxBitmap& GetBitmapDisabled() const { return m_bmpDisabled; }
|
||||
const wxBitmap& GetBitmapHover() const { return m_bmpHover; }
|
||||
wxBitmap& GetBitmapLabel() { return m_bmpNormal; }
|
||||
wxBitmap& GetBitmapSelected() { return m_bmpSelected; }
|
||||
wxBitmap& GetBitmapFocus() { return m_bmpFocus; }
|
||||
wxBitmap& GetBitmapDisabled() { return m_bmpDisabled; }
|
||||
wxBitmap& GetBitmapHover() { return m_bmpHover; }
|
||||
|
||||
// set/get the margins around the button
|
||||
virtual void SetMargins(int x, int y) { m_marginX = x; m_marginY = y; }
|
||||
@@ -78,7 +82,8 @@ protected:
|
||||
wxBitmap m_bmpNormal,
|
||||
m_bmpSelected,
|
||||
m_bmpFocus,
|
||||
m_bmpDisabled;
|
||||
m_bmpDisabled,
|
||||
m_bmpHover;
|
||||
|
||||
// the margins around the bitmap
|
||||
int m_marginX,
|
||||
|
@@ -16,9 +16,7 @@
|
||||
#include "wx/bitmap.h"
|
||||
#include "wx/brush.h"
|
||||
|
||||
#define wxDEFAULT_BUTTON_MARGIN 4
|
||||
|
||||
class WXDLLEXPORT wxBitmapButton: public wxBitmapButtonBase
|
||||
class WXDLLEXPORT wxBitmapButton : public wxBitmapButtonBase
|
||||
{
|
||||
public:
|
||||
wxBitmapButton() { }
|
||||
@@ -58,6 +56,9 @@ protected:
|
||||
// invalidate m_brushDisabled when system colours change
|
||||
void OnSysColourChanged(wxSysColourChangedEvent& event);
|
||||
|
||||
// change the currently bitmap if we have a hover one
|
||||
void OnMouseEnterOrLeave(wxMouseEvent& event);
|
||||
|
||||
|
||||
// the brush we use to draw disabled buttons
|
||||
wxBrush m_brushDisabled;
|
||||
@@ -67,5 +68,4 @@ protected:
|
||||
DECLARE_DYNAMIC_CLASS_NO_COPY(wxBitmapButton)
|
||||
};
|
||||
|
||||
#endif
|
||||
// _WX_BMPBUTTN_H_
|
||||
#endif // _WX_BMPBUTTN_H_
|
||||
|
Reference in New Issue
Block a user