]> git.saurik.com Git - wxWidgets.git/blob - include/wx/os2/slider.h
Don't define __STRICT_ANSI__, we should build both with and without it.
[wxWidgets.git] / include / wx / os2 / slider.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/os2/slider.h
3 // Purpose: wxSlider class
4 // Author: David Webster
5 // Modified by:
6 // Created: 10/15/99
7 // Copyright: (c) David Webster
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
10
11 #ifndef _WX_SLIDER_H_
12 #define _WX_SLIDER_H_
13
14 #include "wx/control.h"
15
16 // Slider
17 class WXDLLIMPEXP_CORE wxSlider: public wxSliderBase
18 {
19 public:
20 wxSlider();
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
29 ,const wxValidator& rValidator = wxDefaultValidator
30 ,const wxString& rsName = wxSliderNameStr
31 )
32 {
33 Create( pParent
34 ,vId
35 ,nValue
36 ,nMinValue
37 ,nMaxValue
38 ,rPos
39 ,rSize
40 ,lStyle
41 ,rValidator
42 ,rsName
43 );
44 }
45 virtual ~wxSlider();
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
55 ,const wxValidator& rValidator = wxDefaultValidator
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 ;
68 bool Show(bool bShow = TRUE);
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) ;
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;
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; }
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;
136 int m_nSizeFlags;
137
138 virtual void DoGetSize( int* pnWidth
139 ,int* pnHeight
140 ) const;
141 virtual void DoSetSize( int nX
142 ,int nY
143 ,int nWidth
144 ,int nHeight
145 ,int nSizeFlags = wxSIZE_AUTO
146 );
147
148 // Platform-specific implementation of SetTickFreq
149 virtual void DoSetTickFreq(int freq);
150
151 private:
152 DECLARE_DYNAMIC_CLASS(wxSlider)
153 }; // end of CLASS wxSlider
154
155 #endif
156 // _WX_SLIDER_H_