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 class wxCheckBoxIPhoneImpl : public wxWidgetIPhoneImpl
42 wxCheckBoxIPhoneImpl(wxWindowMac *wxpeer, UISwitch *v)
43 : wxWidgetIPhoneImpl(wxpeer, v)
48 wxInt32 GetValue() const
50 return [m_control isOn] ? 1 : 0;
53 void SetValue( wxInt32 v )
55 [m_control setOn:v != 0 animated:NO];
61 wxWidgetImplType* wxWidgetImpl::CreateCheckBox( wxWindowMac* wxpeer,
62 wxWindowMac* WXUNUSED(parent),
63 wxWindowID WXUNUSED(id),
64 const wxString& WXUNUSED(label),
68 long WXUNUSED(extraStyle))
70 CGRect r = wxOSXGetFrameForControl( wxpeer, pos , size ) ;
71 wxUISwitch* v = [[wxUISwitch alloc] initWithFrame:r];
73 // if (style & wxCHK_3STATE)
74 // [v setAllowsMixedState:YES];
76 wxCheckBoxIPhoneImpl* c = new wxCheckBoxIPhoneImpl( wxpeer, v );