1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/osx/cocoa/tglbtn.mm
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 54129 2008-06-11 19:30:52Z SC $
9 // Copyright: (c) Stefan Csomor
10 // License: wxWindows license
11 /////////////////////////////////////////////////////////////////////////////
13 // ============================================================================
15 // ============================================================================
17 // ----------------------------------------------------------------------------
19 // ----------------------------------------------------------------------------
21 #include "wx/wxprec.h"
25 #include "wx/tglbtn.h"
26 #include "wx/osx/private.h"
28 wxWidgetImplType* wxWidgetImpl::CreateToggleButton( wxWindowMac* wxpeer,
31 const wxString& label,
37 NSRect r = wxOSXGetFrameForControl( wxpeer, pos , size ) ;
38 wxNSButton* v = [[wxNSButton alloc] initWithFrame:r];
40 [v setBezelStyle:NSSmallSquareBezelStyle];
41 [v setButtonType:NSOnOffButton];
42 wxWidgetCocoaImpl* c = new wxWidgetCocoaImpl( wxpeer, v );
46 wxWidgetImplType* wxWidgetImpl::CreateBitmapToggleButton( wxWindowMac* wxpeer,
49 const wxBitmap& label,
55 NSRect r = wxOSXGetFrameForControl( wxpeer, pos , size ) ;
56 wxNSButton* v = [[wxNSButton alloc] initWithFrame:r];
58 [v setBezelStyle:NSRegularSquareBezelStyle];
59 [v setButtonType:NSOnOffButton];
60 wxWidgetCocoaImpl* c = new wxWidgetCocoaImpl( wxpeer, v );
64 #endif // wxUSE_TOGGLEBTN