]>
git.saurik.com Git - wxWidgets.git/blob - src/mac/carbon/slider.cpp
1 /////////////////////////////////////////////////////////////////////////////
8 // Copyright: (c) AUTHOR
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
13 #pragma implementation "slider.h"
16 #include "wx/slider.h"
18 #if !USE_SHARED_LIBRARY
19 IMPLEMENT_DYNAMIC_CLASS(wxSlider
, wxControl
)
21 BEGIN_EVENT_TABLE(wxSlider
, wxControl
)
37 bool wxSlider::Create(wxWindow
*parent
, wxWindowID id
,
38 int value
, int minValue
, int maxValue
,
40 const wxSize
& size
, long style
,
41 const wxValidator
& validator
,
45 SetValidator(validator
);
47 if (parent
) parent
->AddChild(this);
50 m_windowStyle
= style
;
54 m_windowId
= (int)NewControlId();
58 m_rangeMax
= maxValue
;
59 m_rangeMin
= minValue
;
61 m_pageSize
= (int)((maxValue
-minValue
)/10);
72 int wxSlider::GetValue() const
78 void wxSlider::SetValue(int value
)
83 void wxSlider::GetSize(int *width
, int *height
) const
88 void wxSlider::GetPosition(int *x
, int *y
) const
93 void wxSlider::SetSize(int x
, int y
, int width
, int height
, int sizeFlags
)
98 void wxSlider::SetRange(int minValue
, int maxValue
)
100 m_rangeMin
= minValue
;
101 m_rangeMax
= maxValue
;
106 // For trackbars only
107 void wxSlider::SetTickFreq(int n
, int pos
)
113 void wxSlider::SetPageSize(int pageSize
)
116 m_pageSize
= pageSize
;
119 int wxSlider::GetPageSize() const
124 void wxSlider::ClearSel()
129 void wxSlider::ClearTicks()
134 void wxSlider::SetLineSize(int lineSize
)
136 m_lineSize
= lineSize
;
140 int wxSlider::GetLineSize() const
146 int wxSlider::GetSelEnd() const
152 int wxSlider::GetSelStart() const
158 void wxSlider::SetSelection(int minPos
, int maxPos
)
163 void wxSlider::SetThumbLength(int len
)
168 int wxSlider::GetThumbLength() const
174 void wxSlider::SetTick(int tickPos
)
179 void wxSlider::Command (wxCommandEvent
& event
)
181 SetValue (event
.GetInt());
182 ProcessCommand (event
);
185 bool wxSlider::Show(bool show
)