]>
Commit | Line | Data |
---|---|---|
489468fe | 1 | ///////////////////////////////////////////////////////////////////////////// |
524c47aa | 2 | // Name: src/osx/carbon/scrolbar.cpp |
489468fe SC |
3 | // Purpose: wxScrollBar |
4 | // Author: Stefan Csomor | |
5 | // Modified by: | |
6 | // Created: 1998-01-01 | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) Stefan Csomor | |
9 | // Licence: wxWindows licence | |
10 | ///////////////////////////////////////////////////////////////////////////// | |
11 | ||
12 | #include "wx/wxprec.h" | |
13 | ||
14 | #include "wx/scrolbar.h" | |
15 | ||
16 | #ifndef WX_PRECOMP | |
17 | #include "wx/intl.h" | |
18 | #include "wx/log.h" | |
19 | #include "wx/settings.h" | |
20 | #endif | |
21 | ||
524c47aa | 22 | #include "wx/osx/private.h" |
489468fe | 23 | |
524c47aa | 24 | class wxOSXScrollBarCarbonImpl : public wxMacControl |
489468fe | 25 | { |
524c47aa SC |
26 | public : |
27 | wxOSXScrollBarCarbonImpl( wxWindowMac* peer) : wxMacControl( peer ) | |
28 | { | |
29 | } | |
30 | ||
31 | void SetScrollThumb( wxInt32 value, wxInt32 thumbSize ) | |
32 | { | |
33 | SetValue( value ); | |
34 | SetControlViewSize(m_controlRef , thumbSize ); | |
35 | } | |
36 | protected: | |
37 | }; | |
38 | ||
39 | wxWidgetImplType* wxWidgetImpl::CreateScrollBar( wxWindowMac* wxpeer, | |
40 | wxWindowMac* parent, | |
a4fec5b4 | 41 | wxWindowID WXUNUSED(id), |
524c47aa SC |
42 | const wxPoint& pos, |
43 | const wxSize& size, | |
a4fec5b4 SC |
44 | long WXUNUSED(style), |
45 | long WXUNUSED(extraStyle)) | |
524c47aa SC |
46 | { |
47 | Rect bounds = wxMacGetBoundsForControl( wxpeer, pos, size ); | |
489468fe | 48 | |
524c47aa | 49 | wxMacControl* peer = new wxOSXScrollBarCarbonImpl( wxpeer ); |
489468fe SC |
50 | OSStatus err = CreateScrollBarControl( |
51 | MAC_WXHWND(parent->MacGetTopLevelWindowRef()), &bounds, | |
52 | 0, 0, 100, 1, true /* liveTracking */, | |
53 | GetwxMacLiveScrollbarActionProc(), | |
524c47aa | 54 | peer->GetControlRefAddr() ); |
489468fe | 55 | verify_noerr( err ); |
524c47aa | 56 | return peer; |
489468fe | 57 | } |