]> git.saurik.com Git - wxWidgets.git/blame - include/wx/os2/slider.h
wxMGL requires wxUSE_PALETTE
[wxWidgets.git] / include / wx / os2 / slider.h
CommitLineData
0e320a79
DW
1/////////////////////////////////////////////////////////////////////////////
2// Name: slider.h
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
DW
8// Copyright: (c) David Webster
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
210a651b 18class WXDLLEXPORT wxSlider: public wxSliderBase
0e320a79 19{
0e320a79
DW
20public:
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
57c4d796 30#if wxUSE_VALIDATORS
3c299c3a 31 ,const wxValidator& rValidator = wxDefaultValidator
57c4d796 32#endif
3c299c3a
DW
33 ,const wxString& rsName = wxSliderNameStr
34 )
35 {
36 Create( pParent
37 ,vId
38 ,nValue
39 ,nMinValue
40 ,nMaxValue
41 ,rPos
42 ,rSize
43 ,lStyle
57c4d796 44#if wxUSE_VALIDATORS
3c299c3a 45 ,rValidator
57c4d796 46#endif
3c299c3a
DW
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
1cee3f60
DW
69 virtual void DoGetSize( int* pnWidth
70 ,int* pnHeight
71 ) const;
3c299c3a
DW
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;
3a50d19c
DW
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; }
3c299c3a
DW
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
138protected:
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;
3a50d19c 149 int m_nSizeFlags;
3c299c3a
DW
150
151 virtual void DoSetSize( int nX
152 ,int nY
153 ,int nWidth
154 ,int nHeight
155 ,int nSizeFlags = wxSIZE_AUTO
156 );
157private:
158 DECLARE_DYNAMIC_CLASS(wxSlider)
159}; // end of CLASS wxSlider
0e320a79
DW
160
161#endif
162 // _WX_SLIDER_H_