]>
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 wxSpinButtonXmlHandler::wxSpinButtonXmlHandler()
28 : wxXmlResourceHandler()
30 XRC_ADD_STYLE(wxSP_HORIZONTAL
);
31 XRC_ADD_STYLE(wxSP_VERTICAL
);
32 XRC_ADD_STYLE(wxSP_ARROW_KEYS
);
33 XRC_ADD_STYLE(wxSP_WRAP
);
37 wxObject
*wxSpinButtonXmlHandler::DoCreateResource()
39 XRC_MAKE_INSTANCE(control
, wxSpinButton
)
41 control
->Create(m_parentAsWindow
,
43 GetPosition(), GetSize(),
44 GetStyle(wxT("style"), wxSP_VERTICAL
| wxSP_ARROW_KEYS
),
47 control
->SetValue(GetLong( wxT("value"), wxSP_DEFAULT_VALUE
));
48 control
->SetRange(GetLong( wxT("min"), wxSP_DEFAULT_MIN
),
49 GetLong(wxT("max"), wxSP_DEFAULT_MAX
));
55 bool wxSpinButtonXmlHandler::CanHandle(wxXmlNode
*node
)
57 return IsOfClass(node
, wxT("wxSpinButton"));
60 #endif // wxUSE_SPINBTN
64 wxSpinCtrlXmlHandler::wxSpinCtrlXmlHandler()
65 : wxXmlResourceHandler()
67 XRC_ADD_STYLE(wxSP_HORIZONTAL
);
68 XRC_ADD_STYLE(wxSP_VERTICAL
);
69 XRC_ADD_STYLE(wxSP_ARROW_KEYS
);
70 XRC_ADD_STYLE(wxSP_WRAP
);
73 wxObject
*wxSpinCtrlXmlHandler::DoCreateResource()
75 XRC_MAKE_INSTANCE(control
, wxSpinCtrl
)
77 control
->Create(m_parentAsWindow
,
79 GetText(wxT("value")),
80 GetPosition(), GetSize(),
81 GetStyle(wxT("style"), wxSP_ARROW_KEYS
),
82 GetLong(wxT("min"), wxSP_DEFAULT_MIN
),
83 GetLong(wxT("max"), wxSP_DEFAULT_MAX
),
84 GetLong(wxT("value"), wxSP_DEFAULT_VALUE
),
92 bool wxSpinCtrlXmlHandler::CanHandle(wxXmlNode
*node
)
94 return IsOfClass(node
, wxT("wxSpinCtrl"));
97 #endif // wxUSE_SPINCTRL