backported better classinfo test

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@23483 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
2003-09-10 19:20:03 +00:00
parent 259da6c52a
commit 31aa986e27
2 changed files with 14 additions and 12 deletions

View File

@@ -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"))

View File

@@ -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"))