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