~brian-sidebotham/wxwidgets-cmake/wxpython-2.9.4

« back to all changes in this revision

Viewing changes to src/osx/carbon/scrolbar.cpp

  • Committer: Brian Sidebotham
  • Date: 2013-08-03 14:30:08 UTC
  • Revision ID: brian.sidebotham@gmail.com-20130803143008-c7806tkych1tp6fc
Initial import into Bazaar

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/////////////////////////////////////////////////////////////////////////////
 
2
// Name:        src/osx/carbon/scrolbar.cpp
 
3
// Purpose:     wxScrollBar
 
4
// Author:      Stefan Csomor
 
5
// Modified by:
 
6
// Created:     1998-01-01
 
7
// RCS-ID:      $Id: scrolbar.cpp 61724 2009-08-21 10:41:26Z VZ $
 
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
 
 
22
#include "wx/osx/private.h"
 
23
 
 
24
class wxOSXScrollBarCarbonImpl : public wxMacControl
 
25
{
 
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,
 
41
                                    wxWindowID WXUNUSED(id),
 
42
                                    const wxPoint& pos,
 
43
                                    const wxSize& size,
 
44
                                    long WXUNUSED(style),
 
45
                                    long WXUNUSED(extraStyle))
 
46
{
 
47
    Rect bounds = wxMacGetBoundsForControl( wxpeer, pos, size );
 
48
 
 
49
    wxMacControl* peer = new wxOSXScrollBarCarbonImpl( wxpeer );
 
50
    OSStatus err = CreateScrollBarControl(
 
51
        MAC_WXHWND(parent->MacGetTopLevelWindowRef()), &bounds,
 
52
        0, 0, 100, 1, true /* liveTracking */,
 
53
        GetwxMacLiveScrollbarActionProc(),
 
54
        peer->GetControlRefAddr() );
 
55
    verify_noerr( err );
 
56
    return peer;
 
57
}