]>
git.saurik.com Git - wxWidgets.git/blob - src/xrc/xh_spin.cpp
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: XRC resource for wxSpinButton
4 // Author: Bob Mitchell
7 // Copyright: (c) 2000 Bob Mitchell and Verant Interactive
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
12 #pragma implementation "xh_spin.h"
15 // For compilers that support precompilation, includes "wx.h".
16 #include "wx/wxprec.h"
24 #include "wx/xrc/xh_spin.h"
28 #include "wx/spinbutt.h"
30 IMPLEMENT_DYNAMIC_CLASS(wxSpinButtonXmlHandler
, wxXmlResourceHandler
)
32 wxSpinButtonXmlHandler::wxSpinButtonXmlHandler()
33 : wxXmlResourceHandler()
35 XRC_ADD_STYLE(wxSP_HORIZONTAL
);
36 XRC_ADD_STYLE(wxSP_VERTICAL
);
37 XRC_ADD_STYLE(wxSP_ARROW_KEYS
);
38 XRC_ADD_STYLE(wxSP_WRAP
);
42 wxObject
*wxSpinButtonXmlHandler::DoCreateResource()
44 XRC_MAKE_INSTANCE(control
, wxSpinButton
)
46 control
->Create(m_parentAsWindow
,
48 GetPosition(), GetSize(),
49 GetStyle(wxT("style"), wxSP_VERTICAL
| wxSP_ARROW_KEYS
),
52 control
->SetValue(GetLong( wxT("value"), wxSP_DEFAULT_VALUE
));
53 control
->SetRange(GetLong( wxT("min"), wxSP_DEFAULT_MIN
),
54 GetLong(wxT("max"), wxSP_DEFAULT_MAX
));
60 bool wxSpinButtonXmlHandler::CanHandle(wxXmlNode
*node
)
62 return IsOfClass(node
, wxT("wxSpinButton"));
65 #endif // wxUSE_SPINBTN
69 #include "wx/spinctrl.h"
71 IMPLEMENT_DYNAMIC_CLASS(wxSpinCtrlXmlHandler
, wxXmlResourceHandler
)
73 wxSpinCtrlXmlHandler::wxSpinCtrlXmlHandler()
74 : wxXmlResourceHandler()
76 XRC_ADD_STYLE(wxSP_HORIZONTAL
);
77 XRC_ADD_STYLE(wxSP_VERTICAL
);
78 XRC_ADD_STYLE(wxSP_ARROW_KEYS
);
79 XRC_ADD_STYLE(wxSP_WRAP
);
82 wxObject
*wxSpinCtrlXmlHandler::DoCreateResource()
84 XRC_MAKE_INSTANCE(control
, wxSpinCtrl
)
86 control
->Create(m_parentAsWindow
,
88 GetText(wxT("value")),
89 GetPosition(), GetSize(),
90 GetStyle(wxT("style"), wxSP_ARROW_KEYS
),
91 GetLong(wxT("min"), wxSP_DEFAULT_MIN
),
92 GetLong(wxT("max"), wxSP_DEFAULT_MAX
),
93 GetLong(wxT("value"), wxSP_DEFAULT_VALUE
),
101 bool wxSpinCtrlXmlHandler::CanHandle(wxXmlNode
*node
)
103 return IsOfClass(node
, wxT("wxSpinCtrl"));
106 #endif // wxUSE_SPINCTRL