]>
git.saurik.com Git - wxWidgets.git/blob - src/xrc/xh_wizrd.cpp
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: XRC resource for wxWizard
4 // Author: Vaclav Slavik
7 // Copyright: (c) 2000 Vaclav Slavik
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
12 #pragma implementation "xh_wizrd.h"
15 // For compilers that support precompilation, includes "wx.h".
16 #include "wx/wxprec.h"
24 #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
);
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")),
52 wxWizard
*old
= m_wizard
;
54 m_lastSimplePage
= NULL
;
55 CreateChildren(wiz
, true /*this handler only*/);
61 wxWizardPage
*page
= NULL
;
62 if (m_class
== wxT("wxWizardPageSimple"))
64 XRC_MAKE_INSTANCE(p
, wxWizardPageSimple
)
65 p
->Create(m_wizard
, NULL
, NULL
, GetBitmap());
67 wxWizardPageSimple::Chain(m_lastSimplePage
, p
);
71 else /*if (m_class == wxT("wxWizardPage"))*/
73 wxWizardPage
*p
= NULL
;
75 p
= wxStaticCast(m_instance
, wxWizardPage
);
77 wxLogError(wxT("wxWizardPage is abstract class, must be subclassed"));
78 p
->Create(m_wizard
, GetBitmap());
82 page
->SetName(GetName());
91 bool wxWizardXmlHandler::CanHandle(wxXmlNode
*node
)
93 return IsOfClass(node
, wxT("wxWizard")) ||
95 (IsOfClass(node
, wxT("wxWizardPage")) ||
96 IsOfClass(node
, wxT("wxWizardPageSimple")))
100 #endif // wxUSE_WIZARDDLG