]> git.saurik.com Git - wxWidgets.git/commitdiff
implemented Set/GetLabel() (part of patch 1679337)
authorVadim Zeitlin <vadim@wxwidgets.org>
Tue, 13 Mar 2007 23:46:08 +0000 (23:46 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Tue, 13 Mar 2007 23:46:08 +0000 (23:46 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@44793 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/cocoa/statbox.h
src/cocoa/statbox.mm

index e6aab49b45eca2a85c579e5a2a0c49fbc180e752..0fab6da0f12a923d1fd2846dc9fb248701d431db 100644 (file)
@@ -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
 // ------------------------------------------------------------------------
index 289294fff6f283fa9fb79c9a4ec939714b58f92c..6bfc8111dd7c15420025578920b71b582023b796 100644 (file)
@@ -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]);
+}