Commit | Line | Data |
---|---|---|
0e320a79 | 1 | ///////////////////////////////////////////////////////////////////////////// |
80fdcdb9 | 2 | // Name: wx/os2/slider.h |
0e320a79 | 3 | // Purpose: wxSlider class |
409c9842 | 4 | // Author: David Webster |
0e320a79 | 5 | // Modified by: |
409c9842 | 6 | // Created: 10/15/99 |
0e320a79 | 7 | // RCS-ID: $Id$ |
409c9842 | 8 | // Copyright: (c) David Webster |
65571936 | 9 | // Licence: wxWindows licence |
0e320a79 DW |
10 | ///////////////////////////////////////////////////////////////////////////// |
11 | ||
12 | #ifndef _WX_SLIDER_H_ | |
13 | #define _WX_SLIDER_H_ | |
14 | ||
0e320a79 DW |
15 | #include "wx/control.h" |
16 | ||
0e320a79 | 17 | // Slider |
53a2db12 | 18 | class WXDLLIMPEXP_CORE wxSlider: public wxSliderBase |
0e320a79 | 19 | { |
0e320a79 DW |
20 | public: |
21 | wxSlider(); | |
3c299c3a DW |
22 | inline wxSlider( wxWindow* pParent |
23 | ,wxWindowID vId | |
24 | ,int nValue | |
25 | ,int nMinValue | |
26 | ,int nMaxValue | |
27 | ,const wxPoint& rPos = wxDefaultPosition | |
28 | ,const wxSize& rSize = wxDefaultSize | |
29 | ,long lStyle = wxSL_HORIZONTAL | |
3c299c3a | 30 | ,const wxValidator& rValidator = wxDefaultValidator |
3c299c3a DW |
31 | ,const wxString& rsName = wxSliderNameStr |
32 | ) | |
33 | { | |
34 | Create( pParent | |
35 | ,vId | |
36 | ,nValue | |
37 | ,nMinValue | |
38 | ,nMaxValue | |
39 | ,rPos | |
40 | ,rSize | |
41 | ,lStyle | |
3c299c3a | 42 | ,rValidator |
3c299c3a DW |
43 | ,rsName |
44 | ); | |
45 | } | |
d3c7fc99 | 46 | virtual ~wxSlider(); |
3c299c3a DW |
47 | |
48 | bool Create( wxWindow* pParent | |
49 | ,wxWindowID vId | |
50 | ,int nValue | |
51 | ,int nMinValue | |
52 | ,int nMaxValue | |
53 | ,const wxPoint& rPos = wxDefaultPosition | |
54 | ,const wxSize& rSize = wxDefaultSize | |
55 | ,long lStyle = wxSL_HORIZONTAL | |
3c299c3a | 56 | ,const wxValidator& rValidator = wxDefaultValidator |
3c299c3a DW |
57 | ,const wxString& rsName = wxSliderNameStr |
58 | ); | |
59 | ||
60 | virtual int GetValue(void) const ; | |
61 | virtual void SetValue(int); | |
62 | ||
63 | void GetSize( int* pnX | |
64 | ,int* pnY | |
65 | ) const; | |
66 | void GetPosition( int* pnX | |
67 | ,int* pnY | |
68 | ) const ; | |
d697657f | 69 | bool Show(bool bShow = TRUE); |
3c299c3a DW |
70 | void SetRange( int nMinValue |
71 | ,int nMaxValue | |
72 | ); | |
73 | ||
74 | inline int GetMin(void) const { return m_nRangeMin; } | |
75 | inline int GetMax(void) const { return m_nRangeMax; } | |
76 | ||
77 | // | |
78 | // For trackbars only | |
79 | // | |
80 | void ClearSel(void); | |
81 | void ClearTicks(void); | |
82 | ||
83 | int GetLineSize(void) const; | |
84 | int GetPageSize(void) const ; | |
85 | int GetSelEnd(void) const; | |
86 | int GetSelStart(void) const; | |
87 | inline int GetTickFreq(void) const { return m_nTickFreq; } | |
88 | int GetThumbLength(void) const ; | |
89 | ||
90 | void SetLineSize(int nLineSize); | |
91 | void SetPageSize(int nPageSize); | |
92 | void SetSelection( int nMinPos | |
93 | ,int nMaxPos | |
94 | ); | |
95 | void SetThumbLength(int nLen) ; | |
96 | void SetTick(int ntickPos) ; | |
3c299c3a DW |
97 | |
98 | // | |
99 | // IMPLEMENTATION | |
100 | // | |
101 | inline WXHWND GetStaticMin(void) const { return m_hStaticMin; } | |
102 | inline WXHWND GetStaticMax(void) const { return m_hStaticMax; } | |
103 | inline WXHWND GetEditValue(void) const { return m_hStaticValue; } | |
104 | virtual bool ContainsHWND(WXHWND hWnd) const; | |
3a50d19c DW |
105 | void AdjustSubControls( int nX |
106 | ,int nY | |
107 | ,int nWidth | |
108 | ,int nHeight | |
109 | ,int nSizeFlags | |
110 | ); | |
111 | inline int GetSizeFlags(void) { return m_nSizeFlags; } | |
3c299c3a DW |
112 | void Command(wxCommandEvent& rEvent); |
113 | virtual WXHBRUSH OnCtlColor( WXHDC hDC | |
114 | ,WXHWND hWnd | |
115 | ,WXUINT uCtlColor | |
116 | ,WXUINT uMessage | |
117 | ,WXWPARAM wParam | |
118 | ,WXLPARAM lParam | |
119 | ); | |
120 | virtual bool OS2OnScroll( int nOrientation | |
121 | ,WXWORD wParam | |
122 | ,WXWORD wPos | |
123 | ,WXHWND hControl | |
124 | ); | |
125 | ||
126 | protected: | |
127 | WXHWND m_hStaticMin; | |
128 | WXHWND m_hStaticMax; | |
129 | WXHWND m_hStaticValue; | |
130 | int m_nRangeMin; | |
131 | int m_nRangeMax; | |
132 | int m_nPageSize; | |
133 | int m_nLineSize; | |
134 | int m_nTickFreq; | |
135 | double m_dPixelToRange; | |
136 | int m_nThumbLength; | |
3a50d19c | 137 | int m_nSizeFlags; |
3c299c3a | 138 | |
d697657f DW |
139 | virtual void DoGetSize( int* pnWidth |
140 | ,int* pnHeight | |
141 | ) const; | |
3c299c3a DW |
142 | virtual void DoSetSize( int nX |
143 | ,int nY | |
144 | ,int nWidth | |
145 | ,int nHeight | |
146 | ,int nSizeFlags = wxSIZE_AUTO | |
147 | ); | |
0a12e013 VZ |
148 | |
149 | // Platform-specific implementation of SetTickFreq | |
150 | virtual void DoSetTickFreq(int freq); | |
151 | ||
3c299c3a DW |
152 | private: |
153 | DECLARE_DYNAMIC_CLASS(wxSlider) | |
154 | }; // end of CLASS wxSlider | |
0e320a79 DW |
155 | |
156 | #endif | |
157 | // _WX_SLIDER_H_ |