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

include/wx/cocoa/checkbox.h
include/wx/cocoa/stattext.h
src/cocoa/checkbox.mm
src/cocoa/stattext.mm

index 2cdaa412c25b0553906c0b3b298c2377bc5623d1..93c10cb3fcc733792fef2a9e6bcbd346a5f13913 100644 (file)
@@ -59,6 +59,8 @@ public:
     virtual void SetValue(bool);
     virtual bool GetValue() const;
     virtual void SetLabel(const wxString& label);
+    virtual wxString GetLabel() const;
+
 protected:
     virtual void DoSet3StateValue(wxCheckBoxState state);
     virtual wxCheckBoxState DoGet3StateValue() const;
index d34bbdac9fca8f6473a97123b4e773b1484b577a..74f8c1ced5e4ac7bd54541bc2fbfd7d53c6a1ec5 100644 (file)
@@ -52,8 +52,8 @@ protected:
 // Implementation
 // ------------------------------------------------------------------------
 public:
-    void SetLabel(const wxString& label);
+    virtual void SetLabel(const wxString& label);
+    virtual wxString GetLabel() const;
 };
 
-#endif
-    // __WX_COCOA_STATTEXT_H__
+#endif // __WX_COCOA_STATTEXT_H__
index 0e73912c1fae485500dc57068b379fdc1edcd0db..c17d1152fcde79448f2a5d0e2d8b03effda96dff 100644 (file)
@@ -142,4 +142,12 @@ void wxCheckBox::SetLabel(const wxString& s)
     wxAutoNSAutoreleasePool pool;
     [GetNSButton() setTitle:wxNSStringWithWxString(s)];
 }
-#endif
+
+wxString wxCheckBox::GetLabel() const
+{
+    wxAutoNSAutoreleasePool pool;
+    return wxStringWithNSString([GetNSButton() title]);
+
+}
+
+#endif // wxUSE_CHECKBOX
index 4bba022c2751253db4da65137530b776a642b91c..b009c21868abaa0f0f3f0b907a05c35df2012993 100644 (file)
@@ -91,6 +91,12 @@ void wxStaticText::SetLabel(const wxString& label)
     [[GetNSTextField() superview] setNeedsDisplayInRect:newFrameRect];
 }
 
+wxString wxStaticText::GetLabel() const
+{
+    wxAutoNSAutoreleasePool pool;
+    return wxStringWithNSString([GetNSTextField() stringValue]);
+}
+
 void wxStaticText::Cocoa_didChangeText(void)
 {
 }