+ wxLogTrace(wxTRACE_COCOA,wxT("Checkbox"));
+ // What we really want to do is override [NSCell -nextState] to return
+ // NSOnState in lieu of NSMixedState but this works (aside from the
+ // very slightly noticeable drawing of - and then a check) -DE
+
+ // Cocoa always allows a 3-state button to transition into
+ // the mixed/undetermined state by clicking, we don't
+ if ( !Is3rdStateAllowedForUser()
+ && [GetNSButton() state] == NSMixedState )
+ {
+ // Cocoa's sequence is on/off/mixed
+ // skip mixed, go right back to on
+ [GetNSButton() setState: NSOnState];
+ }
+ wxCommandEvent event(wxEVT_COMMAND_CHECKBOX_CLICKED, GetId());
+ InitCommandEvent(event); // event.SetEventObject(this);
+ event.SetInt(Get3StateValue());
+ Command(event);
+}
+
+void wxCheckBox::SetLabel(const wxString& s)
+{
+ wxAutoNSAutoreleasePool pool;
+ [GetNSButton() setTitle:wxNSStringWithWxString(s)];
+}
+
+wxString wxCheckBox::GetLabel() const
+{
+ wxAutoNSAutoreleasePool pool;
+ return wxStringWithNSString([GetNSButton() title]);
+