1
/////////////////////////////////////////////////////////////////////////////
2
// Name: src/osx/carbon/tglbtn.cpp
3
// Purpose: Definition of the wxToggleButton class, which implements a
4
// toggle button under wxMac.
5
// Author: Stefan Csomor
8
// RCS-ID: $Id: tglbtn.cpp 64940 2010-07-13 13:29:13Z VZ $
9
// Copyright: (c) Stefan Csomor
10
// Licence: wxWindows licence
11
/////////////////////////////////////////////////////////////////////////////
13
// ============================================================================
15
// ============================================================================
17
// ----------------------------------------------------------------------------
19
// ----------------------------------------------------------------------------
21
#include "wx/wxprec.h"
25
#include "wx/tglbtn.h"
26
#include "wx/osx/private.h"
29
wxWidgetImplType* wxWidgetImpl::CreateToggleButton( wxWindowMac* wxpeer,
31
wxWindowID WXUNUSED(id),
32
const wxString& WXUNUSED(label),
36
long WXUNUSED(extraStyle))
38
Rect bounds = wxMacGetBoundsForControl( wxpeer , pos , size ) ;
40
wxMacControl* peer = new wxMacControl(wxpeer) ;
41
verify_noerr ( CreateBevelButtonControl( MAC_WXHWND(parent->MacGetTopLevelWindowRef()) , &bounds , CFSTR("") ,
42
kControlBevelButtonNormalBevel , kControlBehaviorToggles , NULL , 0 , 0 , 0 , peer->GetControlRefAddr() ) );
46
wxWidgetImplType* wxWidgetImpl::CreateBitmapToggleButton( wxWindowMac* wxpeer,
48
wxWindowID WXUNUSED(id),
49
const wxBitmap& label,
53
long WXUNUSED(extraStyle))
55
Rect bounds = wxMacGetBoundsForControl( wxpeer , pos , size ) ;
56
wxMacControl* peer = new wxMacControl(wxpeer) ;
58
ControlButtonContentInfo info;
59
wxMacCreateBitmapButton( &info, label );
60
verify_noerr ( CreateBevelButtonControl( MAC_WXHWND(parent->MacGetTopLevelWindowRef()) , &bounds , CFSTR("") ,
61
kControlBevelButtonNormalBevel , kControlBehaviorOffsetContents | kControlBehaviorToggles , &info , 0 , 0 , 0 , peer->GetControlRefAddr() ) );
63
wxMacReleaseBitmapButton( &info ) ;
68
#endif // wxUSE_TOGGLEBTN