]>
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 /////////////////////////////////////////////////////////////////////////////
11 // For compilers that support precompilation, includes "wx.h".
12 #include "wx/wxprec.h"
20 #include "wx/xrc/xh_spin.h"
24 #include "wx/spinbutt.h"
26 IMPLEMENT_DYNAMIC_CLASS(wxSpinButtonXmlHandler
, wxXmlResourceHandler
)
28 wxSpinButtonXmlHandler::wxSpinButtonXmlHandler()
29 : wxXmlResourceHandler()
31 XRC_ADD_STYLE(wxSP_HORIZONTAL
);
32 XRC_ADD_STYLE(wxSP_VERTICAL
);
33 XRC_ADD_STYLE(wxSP_ARROW_KEYS
);
34 XRC_ADD_STYLE(wxSP_WRAP
);
38 wxObject
*wxSpinButtonXmlHandler::DoCreateResource()
40 XRC_MAKE_INSTANCE(control
, wxSpinButton
)
42 control
->Create(m_parentAsWindow
,
44 GetPosition(), GetSize(),
45 GetStyle(wxT("style"), wxSP_VERTICAL
| wxSP_ARROW_KEYS
),
48 control
->SetValue(GetLong( wxT("value"), wxSP_DEFAULT_VALUE
));
49 control
->SetRange(GetLong( wxT("min"), wxSP_DEFAULT_MIN
),
50 GetLong(wxT("max"), wxSP_DEFAULT_MAX
));
56 bool wxSpinButtonXmlHandler::CanHandle(wxXmlNode
*node
)
58 return IsOfClass(node
, wxT("wxSpinButton"));
61 #endif // wxUSE_SPINBTN
65 #include "wx/spinctrl.h"
67 IMPLEMENT_DYNAMIC_CLASS(wxSpinCtrlXmlHandler
, wxXmlResourceHandler
)
69 wxSpinCtrlXmlHandler::wxSpinCtrlXmlHandler()
70 : wxXmlResourceHandler()
72 XRC_ADD_STYLE(wxSP_HORIZONTAL
);
73 XRC_ADD_STYLE(wxSP_VERTICAL
);
74 XRC_ADD_STYLE(wxSP_ARROW_KEYS
);
75 XRC_ADD_STYLE(wxSP_WRAP
);
78 wxObject
*wxSpinCtrlXmlHandler::DoCreateResource()
80 XRC_MAKE_INSTANCE(control
, wxSpinCtrl
)
82 control
->Create(m_parentAsWindow
,
84 GetText(wxT("value")),
85 GetPosition(), GetSize(),
86 GetStyle(wxT("style"), wxSP_ARROW_KEYS
),
87 GetLong(wxT("min"), wxSP_DEFAULT_MIN
),
88 GetLong(wxT("max"), wxSP_DEFAULT_MAX
),
89 GetLong(wxT("value"), wxSP_DEFAULT_VALUE
),
97 bool wxSpinCtrlXmlHandler::CanHandle(wxXmlNode
*node
)
99 return IsOfClass(node
, wxT("wxSpinCtrl"));
102 #endif // wxUSE_SPINCTRL