]> git.saurik.com Git - wxWidgets.git/blob - src/osx/carbon/scrolbar.cpp
avoid setting initial position if it was not specified, broken in r70734
[wxWidgets.git] / src / osx / carbon / scrolbar.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/osx/carbon/scrolbar.cpp
3 // Purpose: wxScrollBar
4 // Author: Stefan Csomor
5 // Modified by:
6 // Created: 1998-01-01
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
21 #include "wx/osx/private.h"
22
23 class wxOSXScrollBarCarbonImpl : public wxMacControl
24 {
25 public :
26 wxOSXScrollBarCarbonImpl( wxWindowMac* peer) : wxMacControl( peer )
27 {
28 }
29
30 void SetScrollThumb( wxInt32 value, wxInt32 thumbSize )
31 {
32 SetValue( value );
33 SetControlViewSize(m_controlRef , thumbSize );
34 }
35 protected:
36 };
37
38 wxWidgetImplType* wxWidgetImpl::CreateScrollBar( wxWindowMac* wxpeer,
39 wxWindowMac* parent,
40 wxWindowID WXUNUSED(id),
41 const wxPoint& pos,
42 const wxSize& size,
43 long WXUNUSED(style),
44 long WXUNUSED(extraStyle))
45 {
46 Rect bounds = wxMacGetBoundsForControl( wxpeer, pos, size );
47
48 wxMacControl* peer = new wxOSXScrollBarCarbonImpl( wxpeer );
49 OSStatus err = CreateScrollBarControl(
50 MAC_WXHWND(parent->MacGetTopLevelWindowRef()), &bounds,
51 0, 0, 100, 1, true /* liveTracking */,
52 GetwxMacLiveScrollbarActionProc(),
53 peer->GetControlRefAddr() );
54 verify_noerr( err );
55 return peer;
56 }