From aa67a27af195f1f258c40f35a19dd2ade1ce80d8 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 13 Mar 2007 23:46:08 +0000 Subject: [PATCH] implemented Set/GetLabel() (part of patch 1679337) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@44793 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/cocoa/statbox.h | 3 +++ src/cocoa/statbox.mm | 12 ++++++++++++ 2 files changed, 15 insertions(+) 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]); +} -- 2.45.2