X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e77d4369ded5ca19a60b729fda90beb4d404c61a..7a23b2e6970523ea6d4eb836a58e34387ef99d37:/contrib/src/xrc/xh_sizer.cpp diff --git a/contrib/src/xrc/xh_sizer.cpp b/contrib/src/xrc/xh_sizer.cpp index fa5cbdccfb..f26bac9e7a 100644 --- a/contrib/src/xrc/xh_sizer.cpp +++ b/contrib/src/xrc/xh_sizer.cpp @@ -24,8 +24,11 @@ #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"))