]> git.saurik.com Git - wxWidgets.git/blobdiff - src/cocoa/checkbox.mm
Fix compilation with MinGW -std=c++11 option.
[wxWidgets.git] / src / cocoa / checkbox.mm
index 0e73912c1fae485500dc57068b379fdc1edcd0db..373a1c4b338b2378072558ae9bbb7a41b3a9c62e 100644 (file)
@@ -6,7 +6,7 @@
 // Created:     2003/03/16
 // RCS-ID:      $Id$
 // Copyright:   (c) 2003 David Elliott
-// Licence:     wxWidgets licence
+// Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
 #include "wx/wxprec.h"
@@ -26,7 +26,6 @@
 #import <AppKit/NSButton.h>
 #import <Foundation/NSString.h>
 
-IMPLEMENT_DYNAMIC_CLASS(wxCheckBox, wxControl)
 BEGIN_EVENT_TABLE(wxCheckBox, wxCheckBoxBase)
 END_EVENT_TABLE()
 WX_IMPLEMENT_COCOA_OWNER(wxCheckBox,NSButton,NSControl,NSView)
@@ -47,7 +46,7 @@ bool wxCheckBox::Create(wxWindow *parent, wxWindowID winid,
     [m_cocoaNSView release];
     [GetNSButton() setButtonType: NSSwitchButton];
     [GetNSButton() setAllowsMixedState: Is3State()];
-    [GetNSButton() setTitle:wxNSStringWithWxString(GetLabelText(label))];
+    CocoaSetLabelForObject(label, GetNSButton());
     [GetNSControl() sizeToFit];
 
     if(m_parent)
@@ -140,6 +139,14 @@ void wxCheckBox::Cocoa_wxNSButtonAction(void)
 void wxCheckBox::SetLabel(const wxString& s)
 {
     wxAutoNSAutoreleasePool pool;
-    [GetNSButton() setTitle:wxNSStringWithWxString(s)];
+    CocoaSetLabelForObject(s, GetNSButton());
 }
-#endif
+
+wxString wxCheckBox::GetLabel() const
+{
+    wxAutoNSAutoreleasePool pool;
+    return wxStringWithNSString([GetNSButton() title]);
+
+}
+
+#endif // wxUSE_CHECKBOX