]> git.saurik.com Git - wxWidgets.git/blame - src/xrc/xh_slidr.cpp
Update copyright year in ctrl+alt+mclick dialog
[wxWidgets.git] / src / xrc / xh_slidr.cpp
CommitLineData
78d14f80
VS
1/////////////////////////////////////////////////////////////////////////////
2// Name: xh_slidr.cpp
b5d6954b 3// Purpose: XRC resource for wxSlider
78d14f80
VS
4// Author: Bob Mitchell
5// Created: 2000/03/21
6// RCS-ID: $Id$
7// Copyright: (c) 2000 Bob Mitchell and Verant Interactive
8// Licence: wxWindows licence
9/////////////////////////////////////////////////////////////////////////////
f80ea77b 10
78d14f80
VS
11// For compilers that support precompilation, includes "wx.h".
12#include "wx/wxprec.h"
13
14#ifdef __BORLANDC__
15 #pragma hdrstop
16#endif
17
621be1ec 18#if wxUSE_XRC && wxUSE_SLIDER
a1e4ec87 19
78d14f80
VS
20#include "wx/xrc/xh_slidr.h"
21#include "wx/slider.h"
22
854e189f
VS
23IMPLEMENT_DYNAMIC_CLASS(wxSliderXmlHandler, wxXmlResourceHandler)
24
f80ea77b
WS
25wxSliderXmlHandler::wxSliderXmlHandler()
26: wxXmlResourceHandler()
78d14f80 27{
544fee32
VS
28 XRC_ADD_STYLE(wxSL_HORIZONTAL);
29 XRC_ADD_STYLE(wxSL_VERTICAL);
30 XRC_ADD_STYLE(wxSL_AUTOTICKS);
31 XRC_ADD_STYLE(wxSL_LABELS);
32 XRC_ADD_STYLE(wxSL_LEFT);
33 XRC_ADD_STYLE(wxSL_TOP);
34 XRC_ADD_STYLE(wxSL_RIGHT);
35 XRC_ADD_STYLE(wxSL_BOTTOM);
36 XRC_ADD_STYLE(wxSL_BOTH);
37 XRC_ADD_STYLE(wxSL_SELRANGE);
12d85b0e 38 XRC_ADD_STYLE(wxSL_INVERSE);
78d14f80
VS
39 AddWindowStyles();
40}
41
42wxObject *wxSliderXmlHandler::DoCreateResource()
f80ea77b 43{
544fee32 44 XRC_MAKE_INSTANCE(control, wxSlider)
f2588180
VS
45
46 control->Create(m_parentAsWindow,
47 GetID(),
f80ea77b 48 GetLong(wxT("value"), wxSL_DEFAULT_VALUE),
f2588180
VS
49 GetLong(wxT("min"), wxSL_DEFAULT_MIN),
50 GetLong(wxT("max"), wxSL_DEFAULT_MAX),
51 GetPosition(), GetSize(),
52 GetStyle(),
53 wxDefaultValidator,
54 GetName());
78d14f80 55
544fee32 56 if( HasParam(wxT("tickfreq")))
78d14f80 57 {
544fee32 58 control->SetTickFreq(GetLong(wxT("tickfreq")), 0);
78d14f80 59 }
544fee32 60 if( HasParam(wxT("pagesize")))
78d14f80 61 {
544fee32 62 control->SetPageSize(GetLong(wxT("pagesize")));
78d14f80 63 }
544fee32 64 if( HasParam(wxT("linesize")))
78d14f80 65 {
544fee32 66 control->SetLineSize(GetLong(wxT("linesize")));
78d14f80 67 }
544fee32 68 if( HasParam(wxT("thumb")))
78d14f80 69 {
544fee32 70 control->SetThumbLength(GetLong(wxT("thumb")));
78d14f80 71 }
544fee32 72 if( HasParam(wxT("tick")))
78d14f80 73 {
544fee32 74 control->SetTick(GetLong(wxT("tick")));
78d14f80 75 }
544fee32 76 if( HasParam(wxT("selmin")) && HasParam(wxT("selmax")))
78d14f80 77 {
544fee32 78 control->SetSelection(GetLong(wxT("selmin")), GetLong(wxT("selmax")));
78d14f80
VS
79 }
80
81 SetupWindow(control);
f80ea77b 82
78d14f80
VS
83 return control;
84}
85
78d14f80
VS
86bool wxSliderXmlHandler::CanHandle(wxXmlNode *node)
87{
88 return IsOfClass(node, wxT("wxSlider"));
89}
90
621be1ec 91#endif // wxUSE_XRC && wxUSE_SLIDER