From 7748a0b287298582ac0410e11f5221d63932cee8 Mon Sep 17 00:00:00 2001 From: David Elliott Date: Mon, 3 Sep 2007 18:16:03 +0000 Subject: [PATCH] Merged 47941 from trunk: Implement wxRadioButton Get/SetLabel methods. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@48532 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/cocoa/radiobut.h | 2 ++ src/cocoa/radiobut.mm | 11 +++++++++++ 2 files changed, 13 insertions(+) diff --git a/include/wx/cocoa/radiobut.h b/include/wx/cocoa/radiobut.h index 274b07a433..6d0d203390 100644 --- a/include/wx/cocoa/radiobut.h +++ b/include/wx/cocoa/radiobut.h @@ -64,6 +64,8 @@ private: public: virtual void SetValue(bool); virtual bool GetValue() const; + virtual void SetLabel(const wxString& label); + virtual wxString GetLabel() const; protected: wxRadioButtonList m_radioSlaves; wxRadioButton *m_radioMaster; diff --git a/src/cocoa/radiobut.mm b/src/cocoa/radiobut.mm index 3edd79a16d..f46e4e72a1 100644 --- a/src/cocoa/radiobut.mm +++ b/src/cocoa/radiobut.mm @@ -145,6 +145,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