implement images support for wxButton under XP and later

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61054 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2009-06-15 04:23:54 +00:00
parent 81cb7b5a98
commit 233f10bf15
5 changed files with 359 additions and 16 deletions

View File

@@ -99,7 +99,7 @@ public:
// set the image position relative to the text, i.e. wxLEFT means that the
// image is to the left of the text (this is the default)
virtual void SetBitmapPosition(wxDirection WXUNUSED(dir)) { }
void SetBitmapPosition(wxDirection dir);
// make this button the default button in its top level window
@@ -130,20 +130,26 @@ public:
void SetBitmapSelected(const wxBitmap& bitmap) { SetBitmapPressed(bitmap); }
void SetBitmapHover(const wxBitmap& bitmap) { SetBitmapCurrent(bitmap); }
protected:
// choose the default border for this window
virtual wxBorder GetDefaultBorder() const { return wxBORDER_NONE; }
// this enum is not part of wx public API, it is public because it is used
// in non wxButton-derived classes internally
//
// also notice that MSW code relies on the values of the enum elements, do
// not change them without revising src/msw/button.cpp
enum State
{
State_Normal,
State_Pressed, // a.k.a. "selected" in public API for some reason
State_Current, // a.k.a. hot or "hovering"
State_Pressed, // a.k.a. "selected" in public API for some reason
State_Disabled,
State_Focused,
State_Max
};
protected:
// choose the default border for this window
virtual wxBorder GetDefaultBorder() const { return wxBORDER_NONE; }
virtual wxBitmap DoGetBitmap(State WXUNUSED(which)) const
{ return wxBitmap(); }
virtual void DoSetBitmap(const wxBitmap& WXUNUSED(bitmap),
@@ -151,6 +157,8 @@ protected:
{ }
virtual void DoSetBitmapMargins(wxCoord WXUNUSED(x), wxCoord WXUNUSED(y))
{ }
virtual void DoSetBitmapPosition(wxDirection WXUNUSED(dir))
{ }
wxDECLARE_NO_COPY_CLASS(wxButtonBase);