]> git.saurik.com Git - wxWidgets.git/blobdiff - src/cocoa/checkbox.mm
Add wxActivateEvent::GetActivationReason().
[wxWidgets.git] / src / cocoa / checkbox.mm
index c17d1152fcde79448f2a5d0e2d8b03effda96dff..603d7362d1e7bb25ee6654367112aabd9df20d1f 100644 (file)
@@ -4,9 +4,8 @@
 // Author:      David Elliott
 // Modified by:
 // Created:     2003/03/16
 // Author:      David Elliott
 // Modified by:
 // Created:     2003/03/16
-// RCS-ID:      $Id$
 // Copyright:   (c) 2003 David Elliott
 // Copyright:   (c) 2003 David Elliott
-// Licence:     wxWidgets licence
+// Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
 #include "wx/wxprec.h"
 /////////////////////////////////////////////////////////////////////////////
 
 #include "wx/wxprec.h"
@@ -26,7 +25,6 @@
 #import <AppKit/NSButton.h>
 #import <Foundation/NSString.h>
 
 #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)
 BEGIN_EVENT_TABLE(wxCheckBox, wxCheckBoxBase)
 END_EVENT_TABLE()
 WX_IMPLEMENT_COCOA_OWNER(wxCheckBox,NSButton,NSControl,NSView)
@@ -47,7 +45,7 @@ bool wxCheckBox::Create(wxWindow *parent, wxWindowID winid,
     [m_cocoaNSView release];
     [GetNSButton() setButtonType: NSSwitchButton];
     [GetNSButton() setAllowsMixedState: Is3State()];
     [m_cocoaNSView release];
     [GetNSButton() setButtonType: NSSwitchButton];
     [GetNSButton() setAllowsMixedState: Is3State()];
-    [GetNSButton() setTitle:wxNSStringWithWxString(GetLabelText(label))];
+    CocoaSetLabelForObject(label, GetNSButton());
     [GetNSControl() sizeToFit];
 
     if(m_parent)
     [GetNSControl() sizeToFit];
 
     if(m_parent)
@@ -131,7 +129,7 @@ void wxCheckBox::Cocoa_wxNSButtonAction(void)
         // skip mixed, go right back to on
         [GetNSButton() setState: NSOnState];
     }
         // skip mixed, go right back to on
         [GetNSButton() setState: NSOnState];
     }
-    wxCommandEvent event(wxEVT_COMMAND_CHECKBOX_CLICKED, GetId());
+    wxCommandEvent event(wxEVT_CHECKBOX, GetId());
     InitCommandEvent(event); //    event.SetEventObject(this);
     event.SetInt(Get3StateValue());
     Command(event);
     InitCommandEvent(event); //    event.SetEventObject(this);
     event.SetInt(Get3StateValue());
     Command(event);
@@ -140,7 +138,7 @@ void wxCheckBox::Cocoa_wxNSButtonAction(void)
 void wxCheckBox::SetLabel(const wxString& s)
 {
     wxAutoNSAutoreleasePool pool;
 void wxCheckBox::SetLabel(const wxString& s)
 {
     wxAutoNSAutoreleasePool pool;
-    [GetNSButton() setTitle:wxNSStringWithWxString(s)];
+    CocoaSetLabelForObject(s, GetNSButton());
 }
 
 wxString wxCheckBox::GetLabel() const
 }
 
 wxString wxCheckBox::GetLabel() const