]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/bmpbuttn.cpp
fixed 'Select All' context menu in wxTextCtrl with wxTE_RICH style
[wxWidgets.git] / src / msw / bmpbuttn.cpp
index 83f7efc9d5edfd2c64cbbd278ce0a29274178c14..b05541c6353ff74c29cc62cd93c02be8b753c7f1 100644 (file)
@@ -27,6 +27,7 @@
 #endif
 
 #include "wx/msw/private.h"
+#include "wx/msw/dc.h"          // for wxDCTemp
 
 #include "wx/msw/uxtheme.h"
 
@@ -175,7 +176,7 @@ bool wxBitmapButton::Create(wxWindow *parent, wxWindowID id,
                     msStyle,
                     0, 0, 0, 0,
                     GetWinHwnd(parent),
-                    (HMENU)m_windowId,
+                    (HMENU)wxUIntToPtr(m_windowId.GetValue()),
                     wxGetInstance(),
                     NULL
                    );
@@ -227,7 +228,7 @@ void wxBitmapButton::OnMouseEnterOrLeave(wxMouseEvent& event)
 void wxBitmapButton::SetBitmapLabel(const wxBitmap& bitmap)
 {
 #if wxUSE_IMAGE
-    if ( !HasFlag(wxBU_AUTODRAW) && !m_disabledSetByUser )
+    if ( !HasFlag(wxBU_AUTODRAW) && !m_disabledSetByUser && bitmap.IsOk() )
     {
         m_bmpDisabled = wxBitmap(bitmap.ConvertToImage().ConvertToGreyscale());
     }