]> git.saurik.com Git - wxWidgets.git/blob - include/wx/cocoa/scrolbar.h
Somehow, setting a tint color makes gauge work :/.
[wxWidgets.git] / include / wx / cocoa / scrolbar.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/cocoa/scrolbar.h
3 // Purpose: wxScrollBar class
4 // Author: David Elliott
5 // Modified by:
6 // Created: 2004/04/25
7 // Copyright: (c) 2004 David Elliott
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
10
11 #ifndef _WX_COCOA_SCROLBAR_H__
12 #define _WX_COCOA_SCROLBAR_H__
13
14 #include "wx/cocoa/NSScroller.h"
15
16 // ========================================================================
17 // wxScrollBar
18 // ========================================================================
19 class WXDLLIMPEXP_CORE wxScrollBar: public wxScrollBarBase, protected wxCocoaNSScroller
20 {
21 DECLARE_DYNAMIC_CLASS(wxScrollBar)
22 DECLARE_EVENT_TABLE()
23 WX_DECLARE_COCOA_OWNER(NSScroller,NSControl,NSView)
24 // ------------------------------------------------------------------------
25 // initialization
26 // ------------------------------------------------------------------------
27 public:
28 wxScrollBar() { }
29 wxScrollBar(wxWindow *parent, wxWindowID winid,
30 const wxPoint& pos = wxDefaultPosition,
31 const wxSize& size = wxDefaultSize,
32 long style = wxSB_HORIZONTAL,
33 const wxValidator& validator = wxDefaultValidator,
34 const wxString& name = wxScrollBarNameStr)
35 {
36 Create(parent, winid, pos, size, style, validator, name);
37 }
38
39 bool Create(wxWindow *parent, wxWindowID winid,
40 const wxPoint& pos = wxDefaultPosition,
41 const wxSize& size = wxDefaultSize,
42 long style = wxSB_HORIZONTAL,
43 const wxValidator& validator = wxDefaultValidator,
44 const wxString& name = wxScrollBarNameStr);
45 virtual ~wxScrollBar();
46
47 // ------------------------------------------------------------------------
48 // Cocoa callbacks
49 // ------------------------------------------------------------------------
50 protected:
51 virtual void Cocoa_wxNSScrollerAction(void);
52 // ------------------------------------------------------------------------
53 // Implementation
54 // ------------------------------------------------------------------------
55 public:
56 // accessors
57 virtual int GetThumbPosition() const;
58 virtual int GetThumbSize() const { return m_thumbSize; }
59 virtual int GetPageSize() const { return m_pageSize; }
60 virtual int GetRange() const { return m_range; }
61
62 // operations
63 virtual void SetThumbPosition(int viewStart);
64 virtual void SetScrollbar(int position, int thumbSize,
65 int range, int pageSize,
66 bool refresh = TRUE);
67 protected:
68 int m_range;
69 int m_thumbSize;
70 int m_pageSize;
71 };
72
73 #endif
74 // _WX_COCOA_SCROLBAR_H__