]> git.saurik.com Git - wxWidgets.git/blob - include/wx/osx/slider.h
Don't make buttons with images too wide in wxMSW.
[wxWidgets.git] / include / wx / osx / slider.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: slider.h
3 // Purpose: wxSlider class
4 // Author: Stefan Csomor
5 // Modified by:
6 // Created: 1998-01-01
7 // RCS-ID: $Id$
8 // Copyright: (c) Stefan Csomor
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_SLIDER_H_
13 #define _WX_SLIDER_H_
14
15 #include "wx/control.h"
16 #include "wx/slider.h"
17 #include "wx/stattext.h"
18
19 WXDLLIMPEXP_DATA_CORE(extern const char) wxSliderNameStr[];
20
21 // Slider
22 class WXDLLIMPEXP_CORE wxSlider: public wxSliderBase
23 {
24 DECLARE_DYNAMIC_CLASS(wxSlider)
25
26 public:
27 wxSlider();
28
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)
36 {
37 Create(parent, id, value, minValue, maxValue, pos, size, style, validator, name);
38 }
39
40 virtual ~wxSlider();
41
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);
49
50 virtual int GetValue() const ;
51 virtual void SetValue(int);
52
53 void SetRange(int minValue, int maxValue);
54
55 inline int GetMin() const { return m_rangeMin; }
56 inline int GetMax() const { return m_rangeMax; }
57
58 void SetMin(int minValue) { SetRange(minValue, m_rangeMax); }
59 void SetMax(int maxValue) { SetRange(m_rangeMin, maxValue); }
60
61 // For trackbars only
62 inline int GetTickFreq() const { return m_tickFreq; }
63 void SetPageSize(int pageSize);
64 int GetPageSize() const ;
65 void ClearSel() ;
66 void ClearTicks() ;
67 void SetLineSize(int lineSize);
68 int GetLineSize() const ;
69 int GetSelEnd() const ;
70 int GetSelStart() const ;
71 void SetSelection(int minPos, int maxPos);
72 void SetThumbLength(int len) ;
73 int GetThumbLength() const ;
74 void SetTick(int tickPos) ;
75
76 void Command(wxCommandEvent& event);
77 // osx specific event handling common for all osx-ports
78
79 virtual bool OSXHandleClicked( double timestampsec );
80 virtual void TriggerScrollEvent( wxEventType scrollEvent ) ;
81
82 protected:
83 // Platform-specific implementation of SetTickFreq
84 virtual void DoSetTickFreq(int freq);
85
86 virtual wxSize DoGetBestSize() const;
87 virtual void DoSetSize(int x, int y, int w, int h, int sizeFlags);
88 virtual void DoMoveWindow(int x, int y, int w, int h);
89
90 // set min/max size of the slider
91 virtual void DoSetSizeHints( int minW, int minH,
92 int maxW, int maxH,
93 int incW, int incH);
94
95 // Common processing to invert slider values based on wxSL_INVERSE
96 virtual int ValueInvertOrNot(int value) const;
97
98 wxStaticText* m_macMinimumStatic ;
99 wxStaticText* m_macMaximumStatic ;
100 wxStaticText* m_macValueStatic ;
101
102 int m_rangeMin;
103 int m_rangeMax;
104 int m_pageSize;
105 int m_lineSize;
106 int m_tickFreq;
107 private :
108 DECLARE_EVENT_TABLE()
109 };
110
111 #endif
112 // _WX_SLIDER_H_