]> git.saurik.com Git - wxWidgets.git/commitdiff
added "bool checked" parameter to SetBitmap() too, for consisttency with GetBitmap()
authorVadim Zeitlin <vadim@wxwidgets.org>
Mon, 23 Mar 2009 12:07:42 +0000 (12:07 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Mon, 23 Mar 2009 12:07:42 +0000 (12:07 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59763 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/ownerdrw.h
interface/wx/menuitem.h

index be2ae25d581d836e50a9a3e3967fa014ef66c8bc..50e85b4a6451cffb295361d37507c7027d32664e 100644 (file)
@@ -61,9 +61,14 @@ public:
         m_bmpUnchecked = bmpUnchecked;
         m_bOwnerDrawn = true; }
 
-  void SetBitmap(const wxBitmap& bmpChecked)
-      { m_bmpChecked = bmpChecked;
-        m_bOwnerDrawn = true; }
+  void SetBitmap(const wxBitmap& bmp, bool bChecked = true)
+  {
+      if ( bChecked )
+          m_bmpChecked = bmp;
+      else
+          m_bmpUnchecked = bmp;
+      m_bOwnerDrawn = true;
+  }
 
   void SetDisabledBitmap( const wxBitmap& bmpDisabled )
       { m_bmpDisabled = bmpDisabled;
index 8566896a96af76d2f4bf90dab96788889da28658..324dbdc0d246eda6552f3b270f0e7a9d2218e783 100644 (file)
@@ -274,11 +274,14 @@ public:
 
     /**
         Sets the bitmap for the menu item.
-        It is equivalent to wxMenuItem::SetBitmaps(bmp, wxNullBitmap).
+
+        It is equivalent to wxMenuItem::SetBitmaps(bmp, wxNullBitmap) if @a
+        checked is @true (default value) or SetBitmaps(wxNullBitmap, bmp)
+        otherwise.
 
         @onlyfor{wxmsw,wxosx,wxgtk}
     */
-    virtual void SetBitmap(const wxBitmap& bmp);
+    virtual void SetBitmap(const wxBitmap& bmp, bool checked = true);
 
     /**
         Sets the checked/unchecked bitmaps for the menu item.