]>
git.saurik.com Git - wxWidgets.git/blob - src/qt/slider.cpp
1 /////////////////////////////////////////////////////////////////////////////
8 // Copyright: (c) AUTHOR
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
13 #pragma implementation "slider.h"
16 #include "wx/msw/slider.h"
18 #if !USE_SHARED_LIBRARY
19 IMPLEMENT_DYNAMIC_CLASS(wxSlider
, wxControl
)
32 bool wxSlider::Create(wxWindow
*parent
, wxWindowID id
,
33 int value
, int minValue
, int maxValue
,
35 const wxSize
& size
, long style
,
36 const wxValidator
& validator
,
40 SetValidator(validator
);
42 if (parent
) parent
->AddChild(this);
45 m_windowStyle
= style
;
49 m_windowId
= (int)NewControlId();
53 m_rangeMax
= maxValue
;
54 m_rangeMin
= minValue
;
56 m_pageSize
= (int)((maxValue
-minValue
)/10);
67 int wxSlider::GetValue() const
73 void wxSlider::SetValue(int value
)
78 void wxSlider::GetSize(int *width
, int *height
) const
83 void wxSlider::GetPosition(int *x
, int *y
) const
88 void wxSlider::SetSize(int x
, int y
, int width
, int height
, int sizeFlags
)
93 void wxSlider::SetRange(int minValue
, int maxValue
)
95 m_rangeMin
= minValue
;
96 m_rangeMax
= maxValue
;
101 // For trackbars only
102 void wxSlider::SetTickFreq(int n
, int pos
)
108 void wxSlider::SetPageSize(int pageSize
)
111 m_pageSize
= pageSize
;
114 int wxSlider::GetPageSize() const
119 void wxSlider::ClearSel()
124 void wxSlider::ClearTicks()
129 void wxSlider::SetLineSize(int lineSize
)
131 m_lineSize
= lineSize
;
135 int wxSlider::GetLineSize() const
141 int wxSlider::GetSelEnd() const
147 int wxSlider::GetSelStart() const
153 void wxSlider::SetSelection(int minPos
, int maxPos
)
158 void wxSlider::SetThumbLength(int len
)
163 int wxSlider::GetThumbLength() const
169 void wxSlider::SetTick(int tickPos
)
174 void wxSlider::Command (wxCommandEvent
& event
)
176 SetValue (event
.GetInt());
177 ProcessCommand (event
);
180 bool wxSlider::Show(bool show
)