]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/iphone/checkbox.mm
Use shared pointers throughout when managing history with the ie backend, simplifying...
[wxWidgets.git] / src / osx / iphone / checkbox.mm
index 2fd405258e97cb37161818d4b689859212de9bd7..8fffa13206b717381239481a9aa2cfa9c02de3ef 100644 (file)
@@ -4,7 +4,7 @@
 // Author:      Stefan Csomor
 // Modified by:
 // Created:     2008-08-20
 // Author:      Stefan Csomor
 // Modified by:
 // Created:     2008-08-20
-// RCS-ID:      $Id: checkbox.mm 54129 2008-06-11 19:30:52Z SC $
+// RCS-ID:      $Id$
 // Copyright:   (c) Stefan Csomor
 // Licence:       wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 // Copyright:   (c) Stefan Csomor
 // Licence:       wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
     }
 }
 
     }
 }
 
-- (int) intValue
-{
-    return [self isOn] ? 1 : 0;
-}
+@end
 
 
-- (void) setIntValue: (int) v
+class wxCheckBoxIPhoneImpl : public wxWidgetIPhoneImpl
 {
 {
-    [self setOn:v != 0 animated:NO];
-}
-
-@end
+public:
+    wxCheckBoxIPhoneImpl(wxWindowMac *wxpeer, UISwitch *v)
+    : wxWidgetIPhoneImpl(wxpeer, v)
+    {
+        m_control = v;
+    }
+    
+    wxInt32  GetValue() const
+    {
+        return [m_control isOn] ? 1 : 0;
+    }
+    
+    void SetValue( wxInt32 v ) 
+    {
+        [m_control setOn:v != 0 animated:NO];
+    }
+private:
+    UISwitch* m_control;
+};
 
 wxWidgetImplType* wxWidgetImpl::CreateCheckBox( wxWindowMac* wxpeer,
                                     wxWindowMac* WXUNUSED(parent),
 
 wxWidgetImplType* wxWidgetImpl::CreateCheckBox( wxWindowMac* wxpeer,
                                     wxWindowMac* WXUNUSED(parent),
@@ -61,7 +73,7 @@ wxWidgetImplType* wxWidgetImpl::CreateCheckBox( wxWindowMac* wxpeer,
 //    if (style & wxCHK_3STATE)
 //        [v setAllowsMixedState:YES];
 
 //    if (style & wxCHK_3STATE)
 //        [v setAllowsMixedState:YES];
 
-    wxWidgetIPhoneImpl* c = new wxWidgetIPhoneImpl( wxpeer, v );
+    wxCheckBoxIPhoneImpl* c = new wxCheckBoxIPhoneImpl( wxpeer, v );
     return c;
 }
 
     return c;
 }