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