]>
git.saurik.com Git - wxWidgets.git/blob - contrib/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 ADD_STYLE( wxSP_HORIZONTAL
);
31 ADD_STYLE( wxSP_VERTICAL
);
32 ADD_STYLE( wxSP_ARROW_KEYS
);
33 ADD_STYLE( wxSP_WRAP
);
37 wxObject
*wxSpinButtonXmlHandler::DoCreateResource()
39 wxSpinButton
*control
= new wxSpinButton(m_parentAsWindow
,
41 GetPosition(), GetSize(),
42 GetStyle( wxT("style"), wxSP_VERTICAL
| wxSP_ARROW_KEYS
),
46 control
->SetValue( GetLong( wxT("value"), wxSP_DEFAULT_VALUE
) );
47 control
->SetRange( GetLong( wxT("min"), wxSP_DEFAULT_MIN
),
48 GetLong( wxT("max"), wxSP_DEFAULT_MAX
) );
56 bool wxSpinButtonXmlHandler::CanHandle(wxXmlNode
*node
)
58 return IsOfClass(node
, wxT("wxSpinButton"));
61 #endif // wxUSE_SPINBTN
65 wxSpinCtrlXmlHandler::wxSpinCtrlXmlHandler()
66 : wxXmlResourceHandler()
68 ADD_STYLE( wxSP_HORIZONTAL
);
69 ADD_STYLE( wxSP_VERTICAL
);
70 ADD_STYLE( wxSP_ARROW_KEYS
);
71 ADD_STYLE( wxSP_WRAP
);
74 wxObject
*wxSpinCtrlXmlHandler::DoCreateResource()
76 wxSpinCtrl
*control
= new wxSpinCtrl(m_parentAsWindow
,
78 GetText(wxT("value")),
79 GetPosition(), GetSize(),
80 GetStyle( wxT("style"), wxSP_ARROW_KEYS
),
81 GetLong( wxT("min"), wxSP_DEFAULT_MIN
),
82 GetLong( wxT("max"), wxSP_DEFAULT_MAX
),
83 GetLong( wxT("value"), wxSP_DEFAULT_VALUE
),
94 bool wxSpinCtrlXmlHandler::CanHandle(wxXmlNode
*node
)
96 return IsOfClass(node
, wxT("wxSpinCtrl"));
99 #endif // wxUSE_SPINCTRL