diff --git a/contrib/src/xrc/xh_sizer.cpp b/contrib/src/xrc/xh_sizer.cpp index 7cf5e4fec0..a068dba250 100644 --- a/contrib/src/xrc/xh_sizer.cpp +++ b/contrib/src/xrc/xh_sizer.cpp @@ -21,6 +21,7 @@ #include "wx/xrc/xh_sizer.h" #include "wx/sizer.h" +#include "wx/panel.h" #include "wx/log.h" #include "wx/statbox.h" #include "wx/notebook.h" @@ -138,12 +139,12 @@ wxObject *wxSizerXmlHandler::DoCreateResource() wxXmlNode *parentNode = m_node->GetParent(); wxCHECK_MSG(m_parentSizer != NULL || - ((IsOfClass(parentNode, wxT("wxPanel")) || - IsOfClass(parentNode, wxT("wxWizardPage")) || - IsOfClass(parentNode, wxT("wxWizardPageSimple")) || - IsOfClass(parentNode, wxT("wxFrame")) || - IsOfClass(parentNode, wxT("wxDialog"))) && - parentNode->GetType() == wxXML_ELEMENT_NODE), NULL, + (parentNode->GetType() == wxXML_ELEMENT_NODE && + m_parentAsWindow != NULL && + (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")) diff --git a/src/xrc/xh_sizer.cpp b/src/xrc/xh_sizer.cpp index 7cf5e4fec0..a068dba250 100644 --- a/src/xrc/xh_sizer.cpp +++ b/src/xrc/xh_sizer.cpp @@ -21,6 +21,7 @@ #include "wx/xrc/xh_sizer.h" #include "wx/sizer.h" +#include "wx/panel.h" #include "wx/log.h" #include "wx/statbox.h" #include "wx/notebook.h" @@ -138,12 +139,12 @@ wxObject *wxSizerXmlHandler::DoCreateResource() wxXmlNode *parentNode = m_node->GetParent(); wxCHECK_MSG(m_parentSizer != NULL || - ((IsOfClass(parentNode, wxT("wxPanel")) || - IsOfClass(parentNode, wxT("wxWizardPage")) || - IsOfClass(parentNode, wxT("wxWizardPageSimple")) || - IsOfClass(parentNode, wxT("wxFrame")) || - IsOfClass(parentNode, wxT("wxDialog"))) && - parentNode->GetType() == wxXML_ELEMENT_NODE), NULL, + (parentNode->GetType() == wxXML_ELEMENT_NODE && + m_parentAsWindow != NULL && + (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"))