X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/56d2f75071fc2a29ec10abe97c5a908bb35f30f4..b9c601284491aa806e8cc4d82ab60a0a394343c1:/contrib/src/xml/xh_panel.cpp diff --git a/contrib/src/xml/xh_panel.cpp b/contrib/src/xml/xh_panel.cpp index 5ed9c2a9f4..6240cb96b1 100644 --- a/contrib/src/xml/xh_panel.cpp +++ b/contrib/src/xml/xh_panel.cpp @@ -28,13 +28,24 @@ wxPanelXmlHandler::wxPanelXmlHandler() : wxXmlResourceHandler() ADD_STYLE(wxNO_3D); ADD_STYLE(wxTAB_TRAVERSAL); ADD_STYLE(wxWS_EX_VALIDATE_RECURSIVELY); + ADD_STYLE(wxCLIP_CHILDREN); + AddWindowStyles(); } 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), @@ -48,5 +59,5 @@ wxObject *wxPanelXmlHandler::DoCreateResource() bool wxPanelXmlHandler::CanHandle(wxXmlNode *node) { - return node->GetName() == _T("panel"); + return IsOfClass(node, _T("wxPanel")); }