]>
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
7 // Copyright: (c) 2000 Vaclav Slavik
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
11 // For compilers that support precompilation, includes "wx.h".
12 #include "wx/wxprec.h"
18 #if wxUSE_XRC && wxUSE_WIZARDDLG
20 #include "wx/xrc/xh_wizrd.h"
26 #include "wx/wizard.h"
28 IMPLEMENT_DYNAMIC_CLASS(wxWizardXmlHandler
, wxXmlResourceHandler
)
30 wxWizardXmlHandler::wxWizardXmlHandler() : wxXmlResourceHandler()
33 m_lastSimplePage
= NULL
;
34 XRC_ADD_STYLE(wxWIZARD_EX_HELPBUTTON
);
38 wxObject
*wxWizardXmlHandler::DoCreateResource()
40 if (m_class
== wxT("wxWizard"))
42 XRC_MAKE_INSTANCE(wiz
, wxWizard
)
44 long style
= GetStyle(wxT("exstyle"), 0);
46 wiz
->SetExtraStyle(style
);
47 wiz
->Create(m_parentAsWindow
,
49 GetText(wxT("title")),
54 wxWizard
*old
= m_wizard
;
56 m_lastSimplePage
= NULL
;
57 CreateChildren(wiz
, true /*this handler only*/);
65 if (m_class
== wxT("wxWizardPageSimple"))
67 XRC_MAKE_INSTANCE(p
, wxWizardPageSimple
)
68 p
->Create(m_wizard
, NULL
, NULL
, GetBitmap());
70 wxWizardPageSimple::Chain(m_lastSimplePage
, p
);
74 else /*if (m_class == wxT("wxWizardPage"))*/
78 ReportError("wxWizardPage is abstract class and must be subclassed");
82 page
= wxStaticCast(m_instance
, wxWizardPage
);
83 page
->Create(m_wizard
, GetBitmap());
86 page
->SetName(GetName());
95 bool wxWizardXmlHandler::CanHandle(wxXmlNode
*node
)
97 return IsOfClass(node
, wxT("wxWizard")) ||
99 (IsOfClass(node
, wxT("wxWizardPage")) ||
100 IsOfClass(node
, wxT("wxWizardPageSimple")))
104 #endif // wxUSE_XRC && wxUSE_WIZARDDLG