diff --git a/docs/doxygen/overviews/xrc_format.h b/docs/doxygen/overviews/xrc_format.h
index fa222b0f34..9d9b9fdb16 100644
--- a/docs/doxygen/overviews/xrc_format.h
+++ b/docs/doxygen/overviews/xrc_format.h
@@ -832,14 +832,18 @@ Refer to the section @ref xrc_wxtoolbar for more details.
3.1.5.}
@row3col{bitmap, @ref overview_xrcformat_type_bitmap,
Bitmap to show on the button (default: none).}
-@row3col{selected, @ref overview_xrcformat_type_bitmap,
- Bitmap to show when the button is selected (default: none, same as @c bitmap).}
+@row3col{pressed, @ref overview_xrcformat_type_bitmap,
+ Bitmap to show when the button is pressed (default: none, same as @c bitmap).
+ This property exists since wxWidgets 3.1.6, but the equivalent (and still
+ supported) "selected" property can be used in the older versions.}
@row3col{focus, @ref overview_xrcformat_type_bitmap,
Bitmap to show when the button has focus (default: none, same as @c bitmap).}
@row3col{disabled, @ref overview_xrcformat_type_bitmap,
Bitmap to show when the button is disabled (default: none, same as @c bitmap).}
-@row3col{hover, @ref overview_xrcformat_type_bitmap,
- Bitmap to show when mouse cursor hovers above the bitmap (default: none, same as @c bitmap).}
+@row3col{current, @ref overview_xrcformat_type_bitmap,
+ Bitmap to show when mouse cursor hovers above the bitmap (default: none, same as @c bitmap).
+ This property exists since wxWidgets 3.1.6, but the equivalent (and still
+ supported) "hover" property can be used in the older versions.}
@endTable
diff --git a/include/wx/motif/menuitem.h b/include/wx/motif/menuitem.h
index 456358a2de..3e539a44d7 100644
--- a/include/wx/motif/menuitem.h
+++ b/include/wx/motif/menuitem.h
@@ -39,8 +39,8 @@ public:
// I'm not sure if this works but it silences the linker in the
// menu sample.
// JJ
- virtual void SetBitmap(const wxBitmap& bitmap) { m_bitmap = bitmap; }
- virtual const wxBitmap& GetBitmap() const { return m_bitmap; }
+ virtual void SetBitmap(const wxBitmapBundle& bitmap) { m_bitmap = bitmap; }
+ virtual wxBitmap GetBitmap() const { return GetBitmapFromBundle(m_bitmap); }
// implementation from now on
void CreateItem (WXWidget menu, wxMenuBar * menuBar, wxMenu * topMenu,
@@ -59,7 +59,7 @@ private:
WXWidget m_buttonWidget;
wxMenuBar* m_menuBar;
wxMenu* m_topMenu; // Top-level menu e.g. popup-menu
- wxBitmap m_bitmap; // Bitmap for menuitem, if any
+ wxBitmapBundle m_bitmap; // Bitmap for menuitem, if any
wxDECLARE_DYNAMIC_CLASS(wxMenuItem);
};
diff --git a/include/wx/qt/menuitem.h b/include/wx/qt/menuitem.h
index f5219cd1a9..63d59ffce9 100644
--- a/include/wx/qt/menuitem.h
+++ b/include/wx/qt/menuitem.h
@@ -35,8 +35,8 @@ public:
virtual void Check(bool check = true) wxOVERRIDE;
virtual bool IsChecked() const wxOVERRIDE;
- virtual void SetBitmap(const wxBitmap& bitmap);
- virtual const wxBitmap& GetBitmap() const { return m_bitmap; }
+ virtual void SetBitmap(const wxBitmapBundle& bitmap);
+ virtual wxBitmap GetBitmap() const { return GetBitmapFromBundle(m_bitmap); }
virtual QAction *GetHandle() const;
@@ -44,7 +44,7 @@ public:
private:
// Qt is using an action instead of a menu item.
wxQtAction *m_qtAction;
- wxBitmap m_bitmap;
+ wxBitmapBundle m_bitmap;
wxDECLARE_DYNAMIC_CLASS( wxMenuItem );
};
diff --git a/include/wx/univ/menuitem.h b/include/wx/univ/menuitem.h
index 281c919cc7..d2b3717cd4 100644
--- a/include/wx/univ/menuitem.h
+++ b/include/wx/univ/menuitem.h
@@ -37,16 +37,16 @@ public:
// we add some extra functions which are also available under MSW from
// wxOwnerDrawn class - they will be moved to wxMenuItemBase later
// hopefully
- void SetBitmaps(const wxBitmap& bmpChecked,
- const wxBitmap& bmpUnchecked = wxNullBitmap);
- void SetBitmap(const wxBitmap& bmp) { SetBitmaps(bmp); }
- const wxBitmap& GetBitmap(bool checked = true) const
- { return checked ? m_bmpChecked : m_bmpUnchecked; }
+ void SetBitmaps(const wxBitmapBundle& bmpChecked,
+ const wxBitmapBundle& bmpUnchecked = wxBitmapBundle());
+ void SetBitmap(const wxBitmapBundle& bmp) { SetBitmaps(bmp); }
+ wxBitmap GetBitmap(bool checked = true) const
+ { return GetBitmapFromBundle(checked ? m_bmpChecked : m_bmpUnchecked); }
- void SetDisabledBitmap( const wxBitmap& bmpDisabled )
+ void SetDisabledBitmap( const wxBitmapBundle& bmpDisabled )
{ m_bmpDisabled = bmpDisabled; }
- const wxBitmap& GetDisabledBitmap() const
- { return m_bmpDisabled; }
+ wxBitmap GetDisabledBitmap() const
+ { return GetBitmapFromBundle(m_bmpDisabled); }
// mark item as belonging to the given radio group
void SetAsRadioGroupStart();
@@ -93,9 +93,9 @@ protected:
void UpdateAccelInfo();
// the bitmaps (may be invalid, then they're not used)
- wxBitmap m_bmpChecked,
- m_bmpUnchecked,
- m_bmpDisabled;
+ wxBitmapBundle m_bmpChecked,
+ m_bmpUnchecked,
+ m_bmpDisabled;
// the positions of the first and last items of the radio group this item
// belongs to or -1: start is the radio group start and is valid for all
diff --git a/include/wx/xrc/xh_bmpbt.h b/include/wx/xrc/xh_bmpbt.h
index 4e016a1ed5..f3e10b5b2d 100644
--- a/include/wx/xrc/xh_bmpbt.h
+++ b/include/wx/xrc/xh_bmpbt.h
@@ -14,6 +14,8 @@
#if wxUSE_XRC && wxUSE_BMPBUTTON
+#include "wx/bmpbuttn.h"
+
class WXDLLIMPEXP_XRC wxBitmapButtonXmlHandler : public wxXmlResourceHandler
{
wxDECLARE_DYNAMIC_CLASS(wxBitmapButtonXmlHandler);
@@ -22,6 +24,14 @@ public:
wxBitmapButtonXmlHandler();
virtual wxObject *DoCreateResource() wxOVERRIDE;
virtual bool CanHandle(wxXmlNode *node) wxOVERRIDE;
+
+private:
+ typedef void (wxBitmapButton::*BitmapSetter)(const wxBitmapBundle&);
+
+ void SetBitmapIfSpecified(wxBitmapButton* button,
+ BitmapSetter setter,
+ const char* paramName,
+ const char* paramNameAlt = NULL);
};
#endif // wxUSE_XRC && wxUSE_BMPBUTTON
diff --git a/include/wx/xrc/xmlres.h b/include/wx/xrc/xmlres.h
index 85be98a649..ab7004e67e 100644
--- a/include/wx/xrc/xmlres.h
+++ b/include/wx/xrc/xmlres.h
@@ -588,6 +588,11 @@ public:
const wxArtClient& defaultArtClient = wxASCII_STR(wxART_OTHER),
wxSize size = wxDefaultSize) wxOVERRIDE;
+ // Gets a bitmap bundle from the provided node.
+ wxBitmapBundle GetBitmapBundle(const wxXmlNode* node,
+ const wxArtClient& defaultArtClient = wxASCII_STR(wxART_OTHER),
+ wxSize size = wxDefaultSize) wxOVERRIDE;
+
// Gets an icon.
wxIcon GetIcon(const wxString& param = wxT("icon"),
const wxArtClient& defaultArtClient = wxASCII_STR(wxART_OTHER),
diff --git a/include/wx/xrc/xmlreshandler.h b/include/wx/xrc/xmlreshandler.h
index 531630dd7b..606eedaa09 100644
--- a/include/wx/xrc/xmlreshandler.h
+++ b/include/wx/xrc/xmlreshandler.h
@@ -93,6 +93,9 @@ public:
virtual wxBitmapBundle GetBitmapBundle(const wxString& param = wxT("bitmap"),
const wxArtClient& defaultArtClient = wxASCII_STR(wxART_OTHER),
wxSize size = wxDefaultSize) = 0;
+ virtual wxBitmapBundle GetBitmapBundle(const wxXmlNode* node,
+ const wxArtClient& defaultArtClient = wxASCII_STR(wxART_OTHER),
+ wxSize size = wxDefaultSize) = 0;
virtual wxIcon GetIcon(const wxString& param = wxT("icon"),
const wxArtClient& defaultArtClient = wxASCII_STR(wxART_OTHER),
wxSize size = wxDefaultSize) = 0;
@@ -341,6 +344,12 @@ protected:
{
return GetImpl()->GetBitmapBundle(param, defaultArtClient, size);
}
+ wxBitmapBundle GetBitmapBundle(const wxXmlNode* node,
+ const wxArtClient& defaultArtClient = wxASCII_STR(wxART_OTHER),
+ wxSize size = wxDefaultSize)
+ {
+ return GetImpl()->GetBitmapBundle(node, defaultArtClient, size);
+ }
wxIcon GetIcon(const wxString& param = wxT("icon"),
const wxArtClient& defaultArtClient = wxASCII_STR(wxART_OTHER),
wxSize size = wxDefaultSize)
diff --git a/interface/wx/xrc/xmlres.h b/interface/wx/xrc/xmlres.h
index 9a87d7db3c..18741f29ad 100644
--- a/interface/wx/xrc/xmlres.h
+++ b/interface/wx/xrc/xmlres.h
@@ -613,6 +613,23 @@ protected:
const wxArtClient& defaultArtClient = wxART_OTHER,
wxSize size = wxDefaultSize);
+ /**
+ Gets a bitmap bundle.
+
+ @since 3.1.6
+ */
+ wxBitmapBundle GetBitmapBundle(const wxString& param = "bitmap",
+ const wxArtClient& defaultArtClient = wxART_OTHER,
+ wxSize size = wxDefaultSize);
+ /**
+ Gets a bitmap bundle from the provided node.
+
+ @since 3.1.6
+ */
+ wxBitmapBundle GetBitmapBundle(const wxXmlNode* node,
+ const wxArtClient& defaultArtClient = wxART_OTHER,
+ wxSize size = wxDefaultSize);
+
/**
Gets a bool flag (1, t, yes, on, true are @true, everything else is @false).
*/
diff --git a/samples/xrc/rc/controls.xrc b/samples/xrc/rc/controls.xrc
index 78c96300d5..638f91a167 100644
--- a/samples/xrc/rc/controls.xrc
+++ b/samples/xrc/rc/controls.xrc
@@ -219,6 +219,7 @@
5