]>
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"
22 #include "wx/xrc/xh_spin.h"
23 #include "wx/spinctrl.h"
27 IMPLEMENT_DYNAMIC_CLASS(wxSpinButtonXmlHandler
, wxXmlResourceHandler
)
29 wxSpinButtonXmlHandler::wxSpinButtonXmlHandler()
30 : wxXmlResourceHandler()
32 XRC_ADD_STYLE(wxSP_HORIZONTAL
);
33 XRC_ADD_STYLE(wxSP_VERTICAL
);
34 XRC_ADD_STYLE(wxSP_ARROW_KEYS
);
35 XRC_ADD_STYLE(wxSP_WRAP
);
39 wxObject
*wxSpinButtonXmlHandler::DoCreateResource()
41 XRC_MAKE_INSTANCE(control
, wxSpinButton
)
43 control
->Create(m_parentAsWindow
,
45 GetPosition(), GetSize(),
46 GetStyle(wxT("style"), wxSP_VERTICAL
| wxSP_ARROW_KEYS
),
49 control
->SetValue(GetLong( wxT("value"), wxSP_DEFAULT_VALUE
));
50 control
->SetRange(GetLong( wxT("min"), wxSP_DEFAULT_MIN
),
51 GetLong(wxT("max"), wxSP_DEFAULT_MAX
));
57 bool wxSpinButtonXmlHandler::CanHandle(wxXmlNode
*node
)
59 return IsOfClass(node
, wxT("wxSpinButton"));
62 #endif // wxUSE_SPINBTN
66 IMPLEMENT_DYNAMIC_CLASS(wxSpinCtrlXmlHandler
, wxXmlResourceHandler
)
68 wxSpinCtrlXmlHandler::wxSpinCtrlXmlHandler()
69 : wxXmlResourceHandler()
71 XRC_ADD_STYLE(wxSP_HORIZONTAL
);
72 XRC_ADD_STYLE(wxSP_VERTICAL
);
73 XRC_ADD_STYLE(wxSP_ARROW_KEYS
);
74 XRC_ADD_STYLE(wxSP_WRAP
);
77 wxObject
*wxSpinCtrlXmlHandler::DoCreateResource()
79 XRC_MAKE_INSTANCE(control
, wxSpinCtrl
)
81 control
->Create(m_parentAsWindow
,
83 GetText(wxT("value")),
84 GetPosition(), GetSize(),
85 GetStyle(wxT("style"), wxSP_ARROW_KEYS
),
86 GetLong(wxT("min"), wxSP_DEFAULT_MIN
),
87 GetLong(wxT("max"), wxSP_DEFAULT_MAX
),
88 GetLong(wxT("value"), wxSP_DEFAULT_VALUE
),
96 bool wxSpinCtrlXmlHandler::CanHandle(wxXmlNode
*node
)
98 return IsOfClass(node
, wxT("wxSpinCtrl"));
101 #endif // wxUSE_SPINCTRL