]> git.saurik.com Git - wxWidgets.git/blobdiff - src/xrc/xh_wizrd.cpp
Test using wxString::ToCDouble() in wxAny.
[wxWidgets.git] / src / xrc / xh_wizrd.cpp
index 958845ba649550aa4e0dea7ada47d0b0ce213e1f..97dc42b94dd1b58728677b63c2f6009f5b69babb 100644 (file)
@@ -1,5 +1,5 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        xh_wizrd.cpp
+// Name:        src/xrc/xh_wizrd.cpp
 // Purpose:     XRC resource for wxWizard
 // Author:      Vaclav Slavik
 // Created:     2003/03/01
@@ -7,10 +7,6 @@
 // Copyright:   (c) 2000 Vaclav Slavik
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
-#ifdef __GNUG__
-#pragma implementation "xh_wizrd.h"
-#endif
 
 // For compilers that support precompilation, includes "wx.h".
 #include "wx/wxprec.h"
     #pragma hdrstop
 #endif
 
-#if wxUSE_WIZARDDLG
+#if wxUSE_XRC && wxUSE_WIZARDDLG
 
 #include "wx/xrc/xh_wizrd.h"
-#include "wx/log.h"
+
+#ifndef WX_PRECOMP
+    #include "wx/log.h"
+#endif
+
 #include "wx/wizard.h"
 
+IMPLEMENT_DYNAMIC_CLASS(wxWizardXmlHandler, wxXmlResourceHandler)
 
 wxWizardXmlHandler::wxWizardXmlHandler() : wxXmlResourceHandler()
 {
     m_wizard = NULL;
     m_lastSimplePage = NULL;
     XRC_ADD_STYLE(wxWIZARD_EX_HELPBUTTON);
+    AddWindowStyles();
 }
 
 wxObject *wxWizardXmlHandler::DoCreateResource()
-{ 
+{
     if (m_class == wxT("wxWizard"))
     {
         XRC_MAKE_INSTANCE(wiz, wxWizard)
@@ -47,6 +49,7 @@ wxObject *wxWizardXmlHandler::DoCreateResource()
                     GetText(wxT("title")),
                     GetBitmap(),
                     GetPosition());
+        SetupWindow(wiz);
 
         wxWizard *old = m_wizard;
         m_wizard = wiz;
@@ -57,7 +60,8 @@ wxObject *wxWizardXmlHandler::DoCreateResource()
     }
     else
     {
-        wxWizardPage *page = NULL;
+        wxWizardPage *page;
+
         if (m_class == wxT("wxWizardPageSimple"))
         {
             XRC_MAKE_INSTANCE(p, wxWizardPageSimple)
@@ -69,13 +73,14 @@ wxObject *wxWizardXmlHandler::DoCreateResource()
         }
         else /*if (m_class == wxT("wxWizardPage"))*/
         {
-            wxWizardPage *p = NULL;
-            if (m_instance)
-                p = wxStaticCast(m_instance, wxWizardPage);
-            else
-                wxLogError(wxT("wxWizardPage is abstract class, must be subclassed"));
-            p->Create(m_wizard, GetBitmap());
-            page = p;
+            if ( !m_instance )
+            {
+                ReportError("wxWizardPage is abstract class and must be subclassed");
+                return NULL;
+            }
+
+            page = wxStaticCast(m_instance, wxWizardPage);
+            page->Create(m_wizard, GetBitmap());
         }
 
         page->SetName(GetName());
@@ -89,11 +94,11 @@ wxObject *wxWizardXmlHandler::DoCreateResource()
 
 bool wxWizardXmlHandler::CanHandle(wxXmlNode *node)
 {
-    return IsOfClass(node, wxT("wxWizard")) || 
+    return IsOfClass(node, wxT("wxWizard")) ||
            (m_wizard != NULL &&
                 (IsOfClass(node, wxT("wxWizardPage")) ||
                  IsOfClass(node, wxT("wxWizardPageSimple")))
            );
 }
 
-#endif // wxUSE_WIZARDDLG
+#endif // wxUSE_XRC && wxUSE_WIZARDDLG