X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/09dc1241b72e4c03d2ebd757bb063296aef7a18e..504d911e5a101759669b3ab3487a2f1e28989d7b:/contrib/src/xml/xh_panel.cpp diff --git a/contrib/src/xml/xh_panel.cpp b/contrib/src/xml/xh_panel.cpp index 4e327e7b34..6240cb96b1 100644 --- a/contrib/src/xml/xh_panel.cpp +++ b/contrib/src/xml/xh_panel.cpp @@ -36,7 +36,16 @@ wxPanelXmlHandler::wxPanelXmlHandler() : wxXmlResourceHandler() wxObject *wxPanelXmlHandler::DoCreateResource() { - wxPanel *panel = new wxPanel(m_ParentAsWindow, + wxPanel *panel = wxDynamicCast(m_Instance, wxPanel); + + if (panel == NULL) + panel = new wxPanel(m_ParentAsWindow, + GetID(), + GetPosition(), GetSize(), + GetStyle(_T("style"), 0), + GetName()); + else + panel->Create(m_ParentAsWindow, GetID(), GetPosition(), GetSize(), GetStyle(_T("style"), 0), @@ -50,5 +59,5 @@ wxObject *wxPanelXmlHandler::DoCreateResource() bool wxPanelXmlHandler::CanHandle(wxXmlNode *node) { - return node->GetName() == _T("panel"); + return IsOfClass(node, _T("wxPanel")); }