]> git.saurik.com Git - wxWidgets.git/blob - include/wx/cocoa/slider.h
cleanup
[wxWidgets.git] / include / wx / cocoa / slider.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/cocoa/slider.h
3 // Purpose: wxSlider class
4 // Author: David Elliott
5 // Mark Oxenham
6 // Modified by:
7 // Created: 2003/06/19
8 // RCS-ID: $Id$
9 // Copyright: (c) 2003 David Elliott
10 // (c) 2007 Software 2000 Ltd.
11 // Licence: wxWindows licence
12 /////////////////////////////////////////////////////////////////////////////
13
14 #ifndef __WX_COCOA_SLIDER_H__
15 #define __WX_COCOA_SLIDER_H__
16
17 #include "wx/cocoa/NSSlider.h"
18
19 // ========================================================================
20 // wxSlider
21 // ========================================================================
22 class WXDLLEXPORT wxSlider: public wxSliderBase, protected wxCocoaNSSlider
23 {
24 DECLARE_DYNAMIC_CLASS(wxSlider)
25 DECLARE_EVENT_TABLE()
26 WX_DECLARE_COCOA_OWNER(NSSlider,NSControl,NSView)
27 // ------------------------------------------------------------------------
28 // initialization
29 // ------------------------------------------------------------------------
30 public:
31 wxSlider() { }
32 wxSlider(wxWindow *parent, wxWindowID winid,
33 int value, int minValue, int maxValue,
34 const wxPoint& pos = wxDefaultPosition,
35 const wxSize& size = wxDefaultSize,
36 long style = wxSL_HORIZONTAL,
37 const wxValidator& validator = wxDefaultValidator,
38 const wxString& name = wxSliderNameStr)
39 {
40 Create(parent, winid, value, minValue, maxValue,
41 pos, size, style, validator, name);
42 }
43
44 bool Create(wxWindow *parent, wxWindowID winid,
45 int value, int minValue, int maxValue,
46 const wxPoint& pos = wxDefaultPosition,
47 const wxSize& size = wxDefaultSize,
48 long style = wxSL_HORIZONTAL,
49 const wxValidator& validator = wxDefaultValidator,
50 const wxString& name = wxSliderNameStr);
51 virtual ~wxSlider();
52
53 // ------------------------------------------------------------------------
54 // Cocoa callbacks
55 // ------------------------------------------------------------------------
56 protected:
57 // Override this so we can use wxCocoaNSControl's target
58 void AssociateNSSlider(WX_NSSlider theSlider);
59
60 // Helper method to do the real work
61 virtual void ProcessEventType(wxEventType commandType);
62
63 // from wxCocoaNSControl:
64 virtual void CocoaTarget_action();
65
66 // from wxCocoaNSSlider:
67 virtual void CocoaNotification_startTracking(WX_NSNotification notification);
68 virtual void CocoaNotification_continueTracking(WX_NSNotification notification);
69 virtual void CocoaNotification_stopTracking(WX_NSNotification notification);
70
71 // ------------------------------------------------------------------------
72 // Implementation
73 // ------------------------------------------------------------------------
74 public:
75 // Pure Virtuals
76 virtual int GetValue() const;
77 virtual void SetValue(int value);
78
79 // retrieve/change the range
80 virtual void SetRange(int minValue, int maxValue);
81 virtual int GetMin() const;
82 virtual int GetMax() const;
83
84 // the line/page size is the increment by which the slider moves when
85 // cursor arrow key/page up or down are pressed (clicking the mouse is like
86 // pressing PageUp/Down) and are by default set to 1 and 1/10 of the range
87 virtual void SetLineSize(int lineSize);
88 virtual void SetPageSize(int pageSize);
89 virtual int GetLineSize() const;
90 virtual int GetPageSize() const;
91
92 // these methods get/set the length of the slider pointer in pixels
93 virtual void SetThumbLength(int lenPixels);
94 virtual int GetThumbLength() const;
95
96 // copied from (wxSliderCocoa.h)
97 virtual void SetTickFreq(int n, int pos);
98 virtual int GetTickFreq() const;
99 virtual void ClearTicks() { SetTickFreq(0, 0); }
100
101 virtual void SetTickPos(int pos);
102
103 };
104
105 #endif
106 // __WX_COCOA_SLIDER_H__