]>
git.saurik.com Git - wxWidgets.git/blob - contrib/src/xrc/xh_slidr.cpp
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: XRC resource for wxSlider
4 // Author: Bob Mitchell
7 // Copyright: (c) 2000 Bob Mitchell and Verant Interactive
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
12 #pragma implementation "xh_slidr.h"
15 // For compilers that support precompilation, includes "wx.h".
16 #include "wx/wxprec.h"
22 #include "wx/xrc/xh_slidr.h"
23 #include "wx/slider.h"
27 wxSliderXmlHandler::wxSliderXmlHandler()
28 : wxXmlResourceHandler()
30 XRC_ADD_STYLE(wxSL_HORIZONTAL
);
31 XRC_ADD_STYLE(wxSL_VERTICAL
);
32 XRC_ADD_STYLE(wxSL_AUTOTICKS
);
33 XRC_ADD_STYLE(wxSL_LABELS
);
34 XRC_ADD_STYLE(wxSL_LEFT
);
35 XRC_ADD_STYLE(wxSL_TOP
);
36 XRC_ADD_STYLE(wxSL_RIGHT
);
37 XRC_ADD_STYLE(wxSL_BOTTOM
);
38 XRC_ADD_STYLE(wxSL_BOTH
);
39 XRC_ADD_STYLE(wxSL_SELRANGE
);
43 wxObject
*wxSliderXmlHandler::DoCreateResource()
45 XRC_MAKE_INSTANCE(control
, wxSlider
)
47 control
->Create(m_parentAsWindow
,
49 GetLong(wxT("value"), wxSL_DEFAULT_VALUE
),
50 GetLong(wxT("min"), wxSL_DEFAULT_MIN
),
51 GetLong(wxT("max"), wxSL_DEFAULT_MAX
),
52 GetPosition(), GetSize(),
57 if( HasParam(wxT("tickfreq")))
59 control
->SetTickFreq(GetLong(wxT("tickfreq")), 0);
61 if( HasParam(wxT("pagesize")))
63 control
->SetPageSize(GetLong(wxT("pagesize")));
65 if( HasParam(wxT("linesize")))
67 control
->SetLineSize(GetLong(wxT("linesize")));
69 if( HasParam(wxT("thumb")))
71 control
->SetThumbLength(GetLong(wxT("thumb")));
73 if( HasParam(wxT("tick")))
75 control
->SetTick(GetLong(wxT("tick")));
77 if( HasParam(wxT("selmin")) && HasParam(wxT("selmax")))
79 control
->SetSelection(GetLong(wxT("selmin")), GetLong(wxT("selmax")));
87 bool wxSliderXmlHandler::CanHandle(wxXmlNode
*node
)
89 return IsOfClass(node
, wxT("wxSlider"));