1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/osx/iphone/checkbox.mm
4 // Author: Stefan Csomor
7 // Copyright: (c) Stefan Csomor
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
11 #include "wx/wxprec.h"
15 #include "wx/checkbox.h"
16 #include "wx/osx/private.h"
18 @interface wxUISwitch : UISwitch
24 @implementation wxUISwitch
28 static BOOL initialized = NO;
32 wxOSXIPhoneClassAddWXMethods( self );
38 class wxCheckBoxIPhoneImpl : public wxWidgetIPhoneImpl
41 wxCheckBoxIPhoneImpl(wxWindowMac *wxpeer, UISwitch *v)
42 : wxWidgetIPhoneImpl(wxpeer, v)
47 wxInt32 GetValue() const
49 return [m_control isOn] ? 1 : 0;
52 void SetValue( wxInt32 v )
54 [m_control setOn:v != 0 animated:NO];
60 wxWidgetImplType* wxWidgetImpl::CreateCheckBox( wxWindowMac* wxpeer,
61 wxWindowMac* WXUNUSED(parent),
62 wxWindowID WXUNUSED(id),
63 const wxString& WXUNUSED(label),
67 long WXUNUSED(extraStyle))
69 CGRect r = wxOSXGetFrameForControl( wxpeer, pos , size ) ;
70 wxUISwitch* v = [[wxUISwitch alloc] initWithFrame:r];
72 // if (style & wxCHK_3STATE)
73 // [v setAllowsMixedState:YES];
75 wxCheckBoxIPhoneImpl* c = new wxCheckBoxIPhoneImpl( wxpeer, v );