implemented GetLabel() (part of patch 1679337)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@44792 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2007-03-13 23:45:47 +00:00
parent e55a667c1c
commit d174f457e6
4 changed files with 20 additions and 4 deletions

View 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;

View 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__

View 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

View 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)
{
}