]> git.saurik.com Git - wxWidgets.git/blame - src/osx/carbon/scrolbar.cpp
clang compat.
[wxWidgets.git] / src / osx / carbon / scrolbar.cpp
CommitLineData
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 24class wxOSXScrollBarCarbonImpl : public wxMacControl
489468fe 25{
524c47aa
SC
26public :
27 wxOSXScrollBarCarbonImpl( wxWindowMac* peer) : wxMacControl( peer )
28 {
29 }
03647350
VZ
30
31 void SetScrollThumb( wxInt32 value, wxInt32 thumbSize )
524c47aa
SC
32 {
33 SetValue( value );
34 SetControlViewSize(m_controlRef , thumbSize );
35 }
36protected:
37};
38
03647350
VZ
39wxWidgetImplType* wxWidgetImpl::CreateScrollBar( wxWindowMac* wxpeer,
40 wxWindowMac* parent,
41 wxWindowID WXUNUSED(id),
42 const wxPoint& pos,
524c47aa 43 const wxSize& size,
03647350 44 long WXUNUSED(style),
a4fec5b4 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}