]> git.saurik.com Git - wxWidgets.git/blobdiff - src/xrc/xh_sizer.cpp
Use NSColor from wxColour and wxBrush
[wxWidgets.git] / src / xrc / xh_sizer.cpp
index fa5cbdccfb2eaffd24a0c7b4bbd6510d2a5e867a..f26bac9e7ad3004e6575bbe348c9b533a4253b74 100644 (file)
 #include "wx/log.h"
 #include "wx/statbox.h"
 #include "wx/notebook.h"
+#include "wx/panel.h"
 #include "wx/tokenzr.h"
 
+IMPLEMENT_DYNAMIC_CLASS(wxSizerXmlHandler, wxXmlResourceHandler)
+
 bool wxSizerXmlHandler::IsSizerNode(wxXmlNode *node)
 {
     return (IsOfClass(node, wxT("wxBoxSizer"))) ||
@@ -138,10 +141,11 @@ wxObject *wxSizerXmlHandler::DoCreateResource()
         wxXmlNode *parentNode = m_node->GetParent();
 
         wxCHECK_MSG(m_parentSizer != NULL ||
-                ((IsOfClass(parentNode, wxT("wxPanel")) ||
-                  IsOfClass(parentNode, wxT("wxFrame")) ||
-                  IsOfClass(parentNode, wxT("wxDialog"))) &&
-                 parentNode->GetType() == wxXML_ELEMENT_NODE), NULL,
+                (parentNode->GetType() == wxXML_ELEMENT_NODE &&
+                    (m_parentAsWindow->IsKindOf(CLASSINFO(wxPanel)) ||
+                     m_parentAsWindow->IsKindOf(CLASSINFO(wxFrame)) ||
+                     m_parentAsWindow->IsKindOf(CLASSINFO(wxDialog)))
+                ), NULL,
                 wxT("Incorrect use of sizer: parent is not 'wxDialog', 'wxFrame' or 'wxPanel'."));
 
         if (m_class == wxT("wxBoxSizer"))