]>
git.saurik.com Git - wxWidgets.git/blob - src/xrc/xh_wizrd.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/xrc/xh_wizrd.cpp
3 // Purpose: XRC resource for wxWizard
4 // Author: Vaclav Slavik
6 // Copyright: (c) 2000 Vaclav Slavik
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
10 // For compilers that support precompilation, includes "wx.h".
11 #include "wx/wxprec.h"
17 #if wxUSE_XRC && wxUSE_WIZARDDLG
19 #include "wx/xrc/xh_wizrd.h"
25 #include "wx/wizard.h"
27 IMPLEMENT_DYNAMIC_CLASS(wxWizardXmlHandler
, wxXmlResourceHandler
)
29 wxWizardXmlHandler::wxWizardXmlHandler() : wxXmlResourceHandler()
32 m_lastSimplePage
= NULL
;
33 XRC_ADD_STYLE(wxWIZARD_EX_HELPBUTTON
);
37 wxObject
*wxWizardXmlHandler::DoCreateResource()
39 if (m_class
== wxT("wxWizard"))
41 XRC_MAKE_INSTANCE(wiz
, wxWizard
)
43 long style
= GetStyle(wxT("exstyle"), 0);
45 wiz
->SetExtraStyle(style
);
46 wiz
->Create(m_parentAsWindow
,
48 GetText(wxT("title")),
53 wxWizard
*old
= m_wizard
;
55 m_lastSimplePage
= NULL
;
56 CreateChildren(wiz
, true /*this handler only*/);
64 if (m_class
== wxT("wxWizardPageSimple"))
66 XRC_MAKE_INSTANCE(p
, wxWizardPageSimple
)
67 p
->Create(m_wizard
, NULL
, NULL
, GetBitmap());
69 wxWizardPageSimple::Chain(m_lastSimplePage
, p
);
73 else /*if (m_class == wxT("wxWizardPage"))*/
77 ReportError("wxWizardPage is abstract class and must be subclassed");
81 page
= wxStaticCast(m_instance
, wxWizardPage
);
82 page
->Create(m_wizard
, GetBitmap());
85 page
->SetName(GetName());
94 bool wxWizardXmlHandler::CanHandle(wxXmlNode
*node
)
96 return IsOfClass(node
, wxT("wxWizard")) ||
98 (IsOfClass(node
, wxT("wxWizardPage")) ||
99 IsOfClass(node
, wxT("wxWizardPageSimple")))
103 #endif // wxUSE_XRC && wxUSE_WIZARDDLG