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