]> git.saurik.com Git - wxWidgets.git/blobdiff - src/xrc/xh_bmpcbox.cpp
Ensure there is valid context for DrawRectangle
[wxWidgets.git] / src / xrc / xh_bmpcbox.cpp
index 9c6e5ff894596a76e8c1ddf616b2330a2dfa1cd7..f88dc7bc3fb3c0e58eac0288f2675797ebb593cf 100644 (file)
@@ -3,7 +3,7 @@
 // Purpose:     XRC resource for wxBitmapComboBox
 // Author:      Jaakko Salli
 // Created:     Sep-10-2006
 // Purpose:     XRC resource for wxBitmapComboBox
 // Author:      Jaakko Salli
 // Created:     Sep-10-2006
-// RCS-ID:      $Id:
+// RCS-ID:      $Id$
 // Copyright:   (c) 2006 Jaakko Salli
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 // Copyright:   (c) 2006 Jaakko Salli
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
 #ifndef WX_PRECOMP
     #include "wx/intl.h"
 
 #ifndef WX_PRECOMP
     #include "wx/intl.h"
+    #include "wx/log.h"
 #endif
 
 #include "wx/bmpcbox.h"
 
 #endif
 
 #include "wx/bmpcbox.h"
 
+#include "wx/xml/xml.h"
+
 IMPLEMENT_DYNAMIC_CLASS(wxBitmapComboBoxXmlHandler, wxXmlResourceHandler)
 
 wxBitmapComboBoxXmlHandler::wxBitmapComboBoxXmlHandler()
 IMPLEMENT_DYNAMIC_CLASS(wxBitmapComboBoxXmlHandler, wxXmlResourceHandler)
 
 wxBitmapComboBoxXmlHandler::wxBitmapComboBoxXmlHandler()
@@ -41,9 +44,14 @@ wxObject *wxBitmapComboBoxXmlHandler::DoCreateResource()
 {
     if (m_class == wxT("ownerdrawnitem"))
     {
 {
     if (m_class == wxT("ownerdrawnitem"))
     {
-        wxCHECK_MSG(m_combobox, NULL, wxT("Incorrect syntax of XRC resource: ownerdrawnitem not within a bitmapcombobox!"));
+        if ( !m_combobox )
+        {
+            ReportError("ownerdrawnitem only allowed within a wxBitmapComboBox");
+            return NULL;
+        }
 
 
-        m_combobox->Append(GetText(wxT("text")), GetBitmap(wxT("bitmap"), wxART_MISSING_IMAGE));
+        m_combobox->Append(GetText(wxT("text")),
+                           GetBitmap(wxT("bitmap")));
 
         return m_combobox;
     }
 
         return m_combobox;
     }