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 // Copyright: (c) Stefan Csomor
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 // ============================================================================
14 // ============================================================================
16 // ----------------------------------------------------------------------------
18 // ----------------------------------------------------------------------------
20 #include "wx/wxprec.h"
24 #include "wx/tglbtn.h"
25 #include "wx/osx/private.h"
28 wxWidgetImplType
* wxWidgetImpl::CreateToggleButton( wxWindowMac
* wxpeer
,
30 wxWindowID
WXUNUSED(id
),
31 const wxString
& WXUNUSED(label
),
35 long WXUNUSED(extraStyle
))
37 Rect bounds
= wxMacGetBoundsForControl( wxpeer
, pos
, size
) ;
39 wxMacControl
* peer
= new wxMacControl(wxpeer
) ;
40 verify_noerr ( CreateBevelButtonControl( MAC_WXHWND(parent
->MacGetTopLevelWindowRef()) , &bounds
, CFSTR("") ,
41 kControlBevelButtonNormalBevel
, kControlBehaviorToggles
, NULL
, 0 , 0 , 0 , peer
->GetControlRefAddr() ) );
45 wxWidgetImplType
* wxWidgetImpl::CreateBitmapToggleButton( wxWindowMac
* wxpeer
,
47 wxWindowID
WXUNUSED(id
),
48 const wxBitmap
& label
,
52 long WXUNUSED(extraStyle
))
54 Rect bounds
= wxMacGetBoundsForControl( wxpeer
, pos
, size
) ;
55 wxMacControl
* peer
= new wxMacControl(wxpeer
) ;
57 ControlButtonContentInfo info
;
58 wxMacCreateBitmapButton( &info
, label
);
59 verify_noerr ( CreateBevelButtonControl( MAC_WXHWND(parent
->MacGetTopLevelWindowRef()) , &bounds
, CFSTR("") ,
60 kControlBevelButtonNormalBevel
, kControlBehaviorOffsetContents
| kControlBehaviorToggles
, &info
, 0 , 0 , 0 , peer
->GetControlRefAddr() ) );
62 wxMacReleaseBitmapButton( &info
) ;
67 #endif // wxUSE_TOGGLEBTN