X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/525007cf12a3025c2a6ca3c58663062e567c0e25..4521f6c88cbefa7f13e3733d344776b795f981e4:/src/cocoa/radiobut.mm diff --git a/src/cocoa/radiobut.mm b/src/cocoa/radiobut.mm index 3edd79a16d..523b6acb41 100644 --- a/src/cocoa/radiobut.mm +++ b/src/cocoa/radiobut.mm @@ -4,9 +4,8 @@ // Author: David Elliott // Modified by: // Created: 2003/03/16 -// RCS-ID: $Id$ // Copyright: (c) 2003 David Elliott -// Licence: wxWidgets licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #include "wx/wxprec.h" @@ -28,7 +27,6 @@ WX_DEFINE_LIST(wxRadioButtonList); -IMPLEMENT_DYNAMIC_CLASS(wxRadioButton, wxControl) // wxRadioButtonBase == wxControl BEGIN_EVENT_TABLE(wxRadioButton, wxControl) END_EVENT_TABLE() @@ -145,6 +143,17 @@ bool wxRadioButton::GetValue() const return state==NSOnState; } +void wxRadioButton::SetLabel(const wxString& label) +{ + wxAutoNSAutoreleasePool pool; + CocoaSetLabelForObject(label, GetNSButton()); +} + +wxString wxRadioButton::GetLabel() const +{ + return wxStringWithNSString([GetNSButton() title]); +} + /** * If this radio button is part of a group, this method turns off every other * button in the group. If this radio button is not part of a group, this @@ -172,7 +181,7 @@ void wxRadioButton::Cocoa_wxNSButtonAction(void) { Cocoa_DeselectOtherButtonsInTheGroup(); } - wxCommandEvent event(wxEVT_COMMAND_RADIOBUTTON_SELECTED, GetId()); + wxCommandEvent event(wxEVT_RADIOBUTTON, GetId()); InitCommandEvent(event); // event.SetEventObject(this); event.SetInt(GetValue()); Command(event);