]> git.saurik.com Git - wxWidgets.git/blobdiff - contrib/src/xrc/xh_cald.cpp
Changes to the XRC library:
[wxWidgets.git] / contrib / src / xrc / xh_cald.cpp
index 1367c5e8f7cdf4bbc0034882e8fd4082e31055f3..4fba39eb75b8e5c2bd4dd282860cbcef87f5e1e0 100644 (file)
@@ -38,13 +38,18 @@ wxCalendarCtrlXmlHandler::wxCalendarCtrlXmlHandler()
 
 wxObject *wxCalendarCtrlXmlHandler::DoCreateResource()
 { 
-    wxCalendarCtrl *calendar = new wxCalendarCtrl(m_parentAsWindow,
-                                    GetID(),
-                                    wxDefaultDateTime,
-                                    /*TODO: take it from resource*/
-                                    GetPosition(), GetSize(),
-                                    GetStyle(),
-                                    GetName());
+    wxCalendarCtrl *calendar = wxStaticCast(m_instance, wxCalendarCtrl);
+
+    if (!calendar)
+       calendar = new wxCalendarCtrl;
+
+    calendar->Create(m_parentAsWindow,
+                     GetID(),
+                     wxDefaultDateTime,
+                     /*TODO: take it from resource*/
+                     GetPosition(), GetSize(),
+                     GetStyle(),
+                     GetName());
     
     SetupWindow(calendar);