]>
git.saurik.com Git - wxWidgets.git/blob - contrib/src/xml/xh_slidr.cpp
fa53fe9cc4350882ca12bde15c918f9252ebf8b2
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: XML 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/xml/xh_slidr.h"
23 #include "wx/slider.h"
27 wxSliderXmlHandler::wxSliderXmlHandler()
28 : wxXmlResourceHandler()
30 ADD_STYLE( wxSL_HORIZONTAL
);
31 ADD_STYLE( wxSL_VERTICAL
);
32 ADD_STYLE( wxSL_AUTOTICKS
);
33 ADD_STYLE( wxSL_LABELS
);
34 ADD_STYLE( wxSL_LEFT
);
35 ADD_STYLE( wxSL_TOP
);
36 ADD_STYLE( wxSL_RIGHT
);
37 ADD_STYLE( wxSL_BOTTOM
);
38 ADD_STYLE( wxSL_BOTH
);
39 ADD_STYLE( wxSL_SELRANGE
);
43 wxObject
*wxSliderXmlHandler::DoCreateResource()
45 wxSlider
*control
= new wxSlider(m_parentAsWindow
,
47 GetLong( wxT("value"), wxSL_DEFAULT_VALUE
),
48 GetLong( wxT("min"), wxSL_DEFAULT_MIN
),
49 GetLong( wxT("max"), wxSL_DEFAULT_MAX
),
50 GetPosition(), GetSize(),
56 if( HasParam( wxT("tickfreq") ))
58 control
->SetTickFreq( GetLong( wxT("tickfreq") ), 0 );
60 if( HasParam( wxT("pagesize") ))
62 control
->SetPageSize( GetLong( wxT("pagesize") ) );
64 if( HasParam( wxT("linesize") ))
66 control
->SetLineSize( GetLong( wxT("linesize") ));
68 if( HasParam( wxT("thumb") ))
70 control
->SetThumbLength( GetLong( wxT("thumb") ));
72 if( HasParam( wxT("tick") ))
74 control
->SetTick( GetLong( wxT("tick") ));
76 if( HasParam( wxT("selmin") ) && HasParam( wxT("selmax")) )
78 control
->SetSelection( GetLong( wxT("selmin") ), GetLong( wxT("selmax")) );
88 bool wxSliderXmlHandler::CanHandle(wxXmlNode
*node
)
90 return IsOfClass(node
, wxT("wxSlider"));