]> git.saurik.com Git - wxWidgets.git/blame - include/wx/cocoa/scrolbar.h
wxMessageBox off the main thread lost result code.
[wxWidgets.git] / include / wx / cocoa / scrolbar.h
CommitLineData
5369a054
DE
1/////////////////////////////////////////////////////////////////////////////
2// Name: wx/cocoa/scrolbar.h
3// Purpose: wxScrollBar class
4// Author: David Elliott
5// Modified by:
6// Created: 2004/04/25
5369a054 7// Copyright: (c) 2004 David Elliott
1b88201f 8// Licence: wxWindows licence
5369a054
DE
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// ========================================================================
53a2db12 19class WXDLLIMPEXP_CORE wxScrollBar: public wxScrollBarBase, protected wxCocoaNSScroller
5369a054
DE
20{
21 DECLARE_DYNAMIC_CLASS(wxScrollBar)
22 DECLARE_EVENT_TABLE()
23 WX_DECLARE_COCOA_OWNER(NSScroller,NSControl,NSView)
24// ------------------------------------------------------------------------
25// initialization
26// ------------------------------------------------------------------------
27public:
28 wxScrollBar() { }
29 wxScrollBar(wxWindow *parent, wxWindowID winid,
30 const wxPoint& pos = wxDefaultPosition,
31 const wxSize& size = wxDefaultSize,
1d39019c 32 long style = wxSB_HORIZONTAL,
5369a054
DE
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,
1d39019c 42 long style = wxSB_HORIZONTAL,
5369a054
DE
43 const wxValidator& validator = wxDefaultValidator,
44 const wxString& name = wxScrollBarNameStr);
45 virtual ~wxScrollBar();
46
47// ------------------------------------------------------------------------
48// Cocoa callbacks
49// ------------------------------------------------------------------------
50protected:
51 virtual void Cocoa_wxNSScrollerAction(void);
52// ------------------------------------------------------------------------
53// Implementation
54// ------------------------------------------------------------------------
55public:
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);
67protected:
68 int m_range;
69 int m_thumbSize;
70 int m_pageSize;
71};
72
1b88201f
WS
73#endif
74 // _WX_COCOA_SCROLBAR_H__