]> git.saurik.com Git - wxWidgets.git/blobdiff - contrib/src/xml/xh_panel.cpp
Added VC++ project files (seems logical)
[wxWidgets.git] / contrib / src / xml / xh_panel.cpp
index 4e327e7b34ac80ebf3bd51fa959f3ebad5762644..6240cb96b10a1ec13a7b6a026a4095173db76377 100644 (file)
@@ -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"));
 }