]> git.saurik.com Git - wxWidgets.git/commitdiff
moving value setting conformance to impl
authorStefan Csomor <csomor@advancedconcepts.ch>
Fri, 30 Apr 2010 16:40:44 +0000 (16:40 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Fri, 30 Apr 2010 16:40:44 +0000 (16:40 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64181 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/osx/iphone/checkbox.mm

index 2fd405258e97cb37161818d4b689859212de9bd7..b7efa89667d66ca5cb0e422d02cb4441afde382f 100644 (file)
     }
 }
 
-- (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),
@@ -61,7 +73,7 @@ wxWidgetImplType* wxWidgetImpl::CreateCheckBox( wxWindowMac* wxpeer,
 //    if (style & wxCHK_3STATE)
 //        [v setAllowsMixedState:YES];
 
-    wxWidgetIPhoneImpl* c = new wxWidgetIPhoneImpl( wxpeer, v );
+    wxCheckBoxIPhoneImpl* c = new wxCheckBoxIPhoneImpl( wxpeer, v );
     return c;
 }