]> git.saurik.com Git - wxWidgets.git/blob - include/wx/os2/slider.h
more tweaks for release
[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 wxControl
21 {
22 DECLARE_DYNAMIC_CLASS(wxSlider)
23
24 public:
25 wxSlider();
26
27 inline wxSlider(wxWindow *parent, wxWindowID id,
28 int value, int minValue, int maxValue,
29 const wxPoint& pos = wxDefaultPosition,
30 const wxSize& size = wxDefaultSize,
31 long style = wxSL_HORIZONTAL,
32 #if wxUSE_VALIDATORS
33 # if defined(__VISAGECPP__)
34 const wxValidator* validator = wxDefaultValidator,
35 # else
36 const wxValidator& validator = wxDefaultValidator,
37 # endif
38 #endif
39 const wxString& name = wxSliderNameStr)
40 {
41 Create(parent, id, value, minValue, maxValue, pos, size, style, validator, name);
42 }
43
44 ~wxSlider();
45
46 bool Create(wxWindow *parent, wxWindowID id,
47 int value, int minValue, int maxValue,
48 const wxPoint& pos = wxDefaultPosition,
49 const wxSize& size = wxDefaultSize,
50 long style = wxSL_HORIZONTAL,
51 #if wxUSE_VALIDATORS
52 # if defined(__VISAGECPP__)
53 const wxValidator* validator = wxDefaultValidator,
54 # else
55 const wxValidator& validator = wxDefaultValidator,
56 # endif
57 #endif
58 const wxString& name = wxSliderNameStr);
59
60 virtual int GetValue() const ;
61 virtual void SetValue(int);
62
63 void GetSize(int *x, int *y) const ;
64 void GetPosition(int *x, int *y) const ;
65
66 bool Show(bool show);
67
68 void SetRange(int minValue, int maxValue);
69
70 inline int GetMin() const { return m_rangeMin; }
71 inline int GetMax() const { return m_rangeMax; }
72
73 void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
74
75
76
77 // For trackbars only
78 void SetTickFreq(int n, int pos);
79 inline int GetTickFreq() const { return m_tickFreq; }
80 void SetPageSize(int pageSize);
81 int GetPageSize() const ;
82 void ClearSel() ;
83 void ClearTicks() ;
84 void SetLineSize(int lineSize);
85 int GetLineSize() const ;
86 int GetSelEnd() const ;
87 int GetSelStart() const ;
88 void SetSelection(int minPos, int maxPos);
89 void SetThumbLength(int len) ;
90 int GetThumbLength() const ;
91 void SetTick(int tickPos) ;
92
93 // IMPLEMENTATION
94 WXHWND GetStaticMin() const { return m_staticMin; }
95 WXHWND GetStaticMax() const { return m_staticMax; }
96 WXHWND GetEditValue() const { return m_staticValue; }
97 virtual bool ContainsHWND(WXHWND hWnd) const;
98
99 void Command(wxCommandEvent& event);
100 virtual WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
101 WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
102 virtual bool OS2OnScroll(int orientation, WXWORD wParam,
103 WXWORD pos, WXHWND control);
104
105 protected:
106 WXHWND m_staticMin;
107 WXHWND m_staticMax;
108 WXHWND m_staticValue;
109 int m_rangeMin;
110 int m_rangeMax;
111 int m_pageSize;
112 int m_lineSize;
113 int m_tickFreq;
114
115 virtual void DoSetSize(int x, int y,
116 int width, int height,
117 int sizeFlags = wxSIZE_AUTO);
118 };
119
120 #endif
121 // _WX_SLIDER_H_