]> git.saurik.com Git - wxWidgets.git/blobdiff - contrib/src/xml/xh_panel.cpp
fixed typo
[wxWidgets.git] / contrib / src / xml / xh_panel.cpp
index 5ed9c2a9f4c503b042541711b12dd585bb244e46..2c870618e5e0d43ee13a147109442e169fc65fe6 100644 (file)
@@ -28,16 +28,27 @@ 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(wxT("style"), 0),
+                                 GetName());
+    else
+        panel->Create(m_parentAsWindow,
                                  GetID(),
                                  GetPosition(), GetSize(),
-                                 GetStyle(_T("style"), 0),
+                                 GetStyle(wxT("style"), 0),
                                  GetName());
     SetupWindow(panel);
     CreateChildren(panel);
@@ -48,5 +59,5 @@ wxObject *wxPanelXmlHandler::DoCreateResource()
 
 bool wxPanelXmlHandler::CanHandle(wxXmlNode *node)
 {
-    return node->GetName() == _T("panel");
+    return IsOfClass(node, wxT("wxPanel"));
 }