+ // wxUniv-compatible and deprecated equivalents to SetBitmapXXX()
+#if WXWIN_COMPATIBILITY_2_8
+ void SetImageLabel(const wxBitmap& bitmap) { SetBitmap(bitmap); }
+ void SetImageMargins(wxCoord x, wxCoord y) { SetBitmapMargins(x, y); }
+#endif // WXWIN_COMPATIBILITY_2_8
+
+ // backwards compatible names for pressed/current bitmaps: they're not
+ // deprecated as there is nothing really wrong with using them and no real
+ // advantage to using the new names but the new names are still preferred
+ wxBitmap GetBitmapSelected() const { return GetBitmapPressed(); }
+ wxBitmap GetBitmapHover() const { return GetBitmapCurrent(); }
+
+ void SetBitmapSelected(const wxBitmap& bitmap) { SetBitmapPressed(bitmap); }
+ void SetBitmapHover(const wxBitmap& bitmap) { SetBitmapCurrent(bitmap); }
+
+
+ // 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_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
+ };
+
+ // return true if this button shouldn't show the text label, either because
+ // it doesn't have it or because it was explicitly disabled with wxBU_NOTEXT
+ bool DontShowLabel() const
+ {
+ return HasFlag(wxBU_NOTEXT) || GetLabel().empty();
+ }
+
+ // return true if we do show the label
+ bool ShowsLabel() const
+ {
+ return !DontShowLabel();
+ }
+
+protected:
+ // choose the default border for this window
+ virtual wxBorder GetDefaultBorder() const { return wxBORDER_NONE; }
+
+ virtual bool DoGetAuthNeeded() const { return false; }
+ virtual void DoSetAuthNeeded(bool WXUNUSED(show)) { }
+
+ virtual wxBitmap DoGetBitmap(State WXUNUSED(which)) const
+ { return wxBitmap(); }
+ virtual void DoSetBitmap(const wxBitmap& WXUNUSED(bitmap),
+ State WXUNUSED(which))
+ { }
+
+ virtual wxSize DoGetBitmapMargins() const
+ { return wxSize(0, 0); }
+
+ virtual void DoSetBitmapMargins(wxCoord WXUNUSED(x), wxCoord WXUNUSED(y))
+ { }
+
+ virtual void DoSetBitmapPosition(wxDirection WXUNUSED(dir))
+ { }
+
+
+ wxDECLARE_NO_COPY_CLASS(wxButtonBase);