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