From: Vadim Zeitlin Date: Tue, 13 Mar 2007 23:46:08 +0000 (+0000) Subject: implemented Set/GetLabel() (part of patch 1679337) X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/aa67a27af195f1f258c40f35a19dd2ade1ce80d8?hp=d174f457e6a3337d85dbfe1152308cf548e07fa3 implemented Set/GetLabel() (part of patch 1679337) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@44793 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/cocoa/statbox.h b/include/wx/cocoa/statbox.h index e6aab49b45..0fab6da0f1 100644 --- a/include/wx/cocoa/statbox.h +++ b/include/wx/cocoa/statbox.h @@ -41,6 +41,9 @@ public: long style = 0, const wxString& name = wxStaticBoxNameStr); virtual ~wxStaticBox(); + virtual void SetLabel(const wxString& label); + virtual wxString GetLabel() const; + // ------------------------------------------------------------------------ // Cocoa callbacks // ------------------------------------------------------------------------ diff --git a/src/cocoa/statbox.mm b/src/cocoa/statbox.mm index 289294fff6..6bfc8111dd 100644 --- a/src/cocoa/statbox.mm +++ b/src/cocoa/statbox.mm @@ -63,3 +63,15 @@ void wxStaticBox::GetBordersForSizer(int *borderTop, int *borderOther) const if(nextBorder > *borderOther) *borderOther = nextBorder; } + +void wxStaticBox::SetLabel(const wxString& label) +{ + wxAutoNSAutoreleasePool pool; + [GetNSBox() setTitle:wxNSStringWithWxString(label)]; +} + +wxString wxStaticBox::GetLabel() const +{ + wxAutoNSAutoreleasePool pool; + return wxStringWithNSString([GetNSBox() title]); +}