]> git.saurik.com Git - wxWidgets.git/blob - include/wx/gtk/slider.h
0476b55aaee1269d050f654b7f04e232550f0e85
[wxWidgets.git] / include / wx / gtk / slider.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/gtk/slider.h
3 // Purpose:
4 // Author: Robert Roebling
5 // Id: $Id$
6 // Copyright: (c) 1998 Robert Roebling
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
9
10 #ifndef _WX_GTK_SLIDER_H_
11 #define _WX_GTK_SLIDER_H_
12
13 // ----------------------------------------------------------------------------
14 // wxSlider
15 // ----------------------------------------------------------------------------
16
17 class WXDLLIMPEXP_CORE wxSlider : public wxSliderBase
18 {
19 public:
20 wxSlider();
21 wxSlider(wxWindow *parent,
22 wxWindowID id,
23 int value, int minValue, int maxValue,
24 const wxPoint& pos = wxDefaultPosition,
25 const wxSize& size = wxDefaultSize,
26 long style = wxSL_HORIZONTAL,
27 const wxValidator& validator = wxDefaultValidator,
28 const wxString& name = wxSliderNameStr)
29 {
30 Create( parent, id, value, minValue, maxValue,
31 pos, size, style, validator, name );
32 }
33 ~wxSlider();
34
35 bool Create(wxWindow *parent,
36 wxWindowID id,
37 int value, int minValue, int maxValue,
38 const wxPoint& pos = wxDefaultPosition,
39 const wxSize& size = wxDefaultSize,
40 long style = wxSL_HORIZONTAL,
41 const wxValidator& validator = wxDefaultValidator,
42 const wxString& name = wxSliderNameStr);
43
44 // implement the base class pure virtuals
45 virtual int GetValue() const;
46 virtual void SetValue(int value);
47
48 virtual void SetRange(int minValue, int maxValue);
49 virtual int GetMin() const;
50 virtual int GetMax() const;
51
52 virtual void SetLineSize(int lineSize);
53 virtual void SetPageSize(int pageSize);
54 virtual int GetLineSize() const;
55 virtual int GetPageSize() const;
56
57 virtual void SetThumbLength(int lenPixels);
58 virtual int GetThumbLength() const;
59
60 static wxVisualAttributes
61 GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
62
63 // implementation
64 void GTKDisableEvents();
65 void GTKEnableEvents();
66 bool GTKEventsDisabled() const;
67
68 double m_pos;
69 int m_scrollEventType;
70 bool m_needThumbRelease;
71 GtkWidget *m_scale;
72
73 protected:
74 GtkWidget *m_minLabel,*m_maxLabel;
75 bool m_blockScrollEvent;
76
77 virtual GdkWindow *GTKGetWindow(wxArrayGdkWindows& windows) const;
78
79 // set the slider value unconditionally
80 void GTKSetValue(int value);
81
82 DECLARE_DYNAMIC_CLASS(wxSlider)
83 };
84
85 #endif // _WX_GTK_SLIDER_H_