]> git.saurik.com Git - wxWidgets.git/commitdiff
modification to wxSizer handler needed for wxWizard
authorVáclav Slavík <vslavik@fastmail.fm>
Tue, 22 Apr 2003 20:26:06 +0000 (20:26 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Tue, 22 Apr 2003 20:26:06 +0000 (20:26 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@20312 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

contrib/src/xrc/xh_sizer.cpp
src/xrc/xh_sizer.cpp

index fa5cbdccfb2eaffd24a0c7b4bbd6510d2a5e867a..2a1bbf8eb95d10465a2029cefb4ad5181905270f 100644 (file)
@@ -24,6 +24,7 @@
 #include "wx/log.h"
 #include "wx/statbox.h"
 #include "wx/notebook.h"
+#include "wx/panel.h"
 #include "wx/tokenzr.h"
 
 bool wxSizerXmlHandler::IsSizerNode(wxXmlNode *node)
@@ -138,10 +139,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"))
index fa5cbdccfb2eaffd24a0c7b4bbd6510d2a5e867a..2a1bbf8eb95d10465a2029cefb4ad5181905270f 100644 (file)
@@ -24,6 +24,7 @@
 #include "wx/log.h"
 #include "wx/statbox.h"
 #include "wx/notebook.h"
+#include "wx/panel.h"
 #include "wx/tokenzr.h"
 
 bool wxSizerXmlHandler::IsSizerNode(wxXmlNode *node)
@@ -138,10 +139,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"))