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