1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/osx/iphone/checkbox.mm
4 // Author: Stefan Csomor
7 // RCS-ID: $Id: checkbox.mm 54129 2008-06-11 19:30:52Z SC $
8 // Copyright: (c) Stefan Csomor
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #include "wx/wxprec.h"
16 #include "wx/checkbox.h"
17 #include "wx/osx/private.h"
19 @interface wxUISwitch : UISwitch
25 @implementation wxUISwitch
29 static BOOL initialized = NO;
33 wxOSXIPhoneClassAddWXMethods( self );
39 return [self isOn] ? 1 : 0;
42 - (void) setIntValue: (int) v
44 [self setOn:v != 0 animated:NO];
49 wxWidgetImplType* wxWidgetImpl::CreateCheckBox( wxWindowMac* wxpeer,
50 wxWindowMac* WXUNUSED(parent),
51 wxWindowID WXUNUSED(id),
52 const wxString& WXUNUSED(label),
56 long WXUNUSED(extraStyle))
58 CGRect r = wxOSXGetFrameForControl( wxpeer, pos , size ) ;
59 wxUISwitch* v = [[wxUISwitch alloc] initWithFrame:r];
61 // if (style & wxCHK_3STATE)
62 // [v setAllowsMixedState:YES];
64 wxWidgetIPhoneImpl* c = new wxWidgetIPhoneImpl( wxpeer, v );