]>
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 /////////////////////////////////////////////////////////////////////////////
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"
22 #include "wx/wizard.h"
24 IMPLEMENT_DYNAMIC_CLASS(wxWizardXmlHandler
, wxXmlResourceHandler
)
26 wxWizardXmlHandler::wxWizardXmlHandler() : wxXmlResourceHandler()
29 m_lastSimplePage
= NULL
;
30 XRC_ADD_STYLE(wxWIZARD_EX_HELPBUTTON
);
34 wxObject
*wxWizardXmlHandler::DoCreateResource()
36 if (m_class
== wxT("wxWizard"))
38 XRC_MAKE_INSTANCE(wiz
, wxWizard
)
40 long style
= GetStyle(wxT("exstyle"), 0);
42 wiz
->SetExtraStyle(style
);
43 wiz
->Create(m_parentAsWindow
,
45 GetText(wxT("title")),
49 wxWizard
*old
= m_wizard
;
51 m_lastSimplePage
= NULL
;
52 CreateChildren(wiz
, true /*this handler only*/);
58 wxWizardPage
*page
= NULL
;
61 if (m_class
== wxT("wxWizardPageSimple"))
63 XRC_MAKE_INSTANCE(p
, wxWizardPageSimple
)
64 p
->Create(m_wizard
, NULL
, NULL
, GetBitmap());
66 wxWizardPageSimple::Chain(m_lastSimplePage
, p
);
70 else /*if (m_class == wxT("wxWizardPage"))*/
72 wxWizardPage
*p
= NULL
;
74 p
= wxStaticCast(m_instance
, wxWizardPage
);
76 wxLogError(wxT("wxWizardPage is abstract class, must be subclassed"));
77 p
->Create(m_wizard
, GetBitmap());
81 page
->SetName(GetName());
90 bool wxWizardXmlHandler::CanHandle(wxXmlNode
*node
)
92 return IsOfClass(node
, wxT("wxWizard")) ||
94 (IsOfClass(node
, wxT("wxWizardPage")) ||
95 IsOfClass(node
, wxT("wxWizardPageSimple")))
99 #endif // wxUSE_XRC && wxUSE_WIZARDDLG