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:NSRoundedBezelStyle];
41 [v setButtonType:NSOnOffButton];
42 wxWidgetCocoaImpl* c = new wxWidgetCocoaImpl( wxpeer, v );
43 [v setImplementation:c];
47 wxWidgetImplType* wxWidgetImpl::CreateBitmapToggleButton( wxWindowMac* wxpeer,
50 const wxBitmap& label,
56 NSRect r = wxOSXGetFrameForControl( wxpeer, pos , size ) ;
57 wxNSButton* v = [[wxNSButton alloc] initWithFrame:r];
59 [v setBezelStyle:NSRegularSquareBezelStyle];
60 [v setButtonType:NSOnOffButton];
61 wxWidgetCocoaImpl* c = new wxWidgetCocoaImpl( wxpeer, v );
62 [v setImplementation:c];
66 #endif // wxUSE_TOGGLEBTN