]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/mac/classic/slider.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxSlider class
4 // Author: Stefan Csomor
8 // Copyright: (c) Stefan Csomor
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
15 #include "wx/control.h"
16 #include "wx/slider.h"
17 #include "wx/stattext.h"
19 WXDLLEXPORT_DATA(extern const wxChar
*) wxSliderNameStr
;
22 class WXDLLEXPORT wxSlider
: public wxControl
24 DECLARE_DYNAMIC_CLASS(wxSlider
)
29 inline wxSlider(wxWindow
*parent
, wxWindowID id
,
30 int value
, int minValue
, int maxValue
,
31 const wxPoint
& pos
= wxDefaultPosition
,
32 const wxSize
& size
= wxDefaultSize
,
33 long style
= wxSL_HORIZONTAL
,
34 const wxValidator
& validator
= wxDefaultValidator
,
35 const wxString
& name
= wxSliderNameStr
)
37 Create(parent
, id
, value
, minValue
, maxValue
, pos
, size
, style
, validator
, name
);
42 bool Create(wxWindow
*parent
, wxWindowID id
,
43 int value
, int minValue
, int maxValue
,
44 const wxPoint
& pos
= wxDefaultPosition
,
45 const wxSize
& size
= wxDefaultSize
,
46 long style
= wxSL_HORIZONTAL
,
47 const wxValidator
& validator
= wxDefaultValidator
,
48 const wxString
& name
= wxSliderNameStr
);
50 virtual int GetValue() const ;
51 virtual void SetValue(int);
53 void SetRange(int minValue
, int maxValue
);
55 inline int GetMin() const { return m_rangeMin
; }
56 inline int GetMax() const { return m_rangeMax
; }
58 void SetMin(int minValue
) { SetRange(minValue
, m_rangeMax
); }
59 void SetMax(int maxValue
) { SetRange(m_rangeMin
, maxValue
); }
62 void SetTickFreq(int n
, int pos
);
63 inline int GetTickFreq() const { return m_tickFreq
; }
64 void SetPageSize(int pageSize
);
65 int GetPageSize() const ;
68 void SetLineSize(int lineSize
);
69 int GetLineSize() const ;
70 int GetSelEnd() const ;
71 int GetSelStart() const ;
72 void SetSelection(int minPos
, int maxPos
);
73 void SetThumbLength(int len
) ;
74 int GetThumbLength() const ;
75 void SetTick(int tickPos
) ;
78 // set min/max size of the slider
79 virtual void DoSetSizeHints( int minW
, int minH
,
80 int maxW
= -1, int maxH
= -1,
81 int incW
= -1, int incH
= -1 );
84 virtual wxSize
DoGetBestSize() const;
85 virtual void DoSetSize(int x
, int y
, int w
, int h
, int sizeFlags
);
86 virtual void DoMoveWindow(int x
, int y
, int w
, int h
);
88 void Command(wxCommandEvent
& event
);
89 void MacHandleControlClick( WXWidget control
, wxInt16 controlpart
, bool mouseStillDown
) ;
90 virtual void MacUpdateDimensions() ;
92 wxStaticText
* m_macMinimumStatic
;
93 wxStaticText
* m_macMaximumStatic
;
94 wxStaticText
* m_macValueStatic
;
102 DECLARE_EVENT_TABLE()