cocoa needs a special implementation for read-only combo box

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74175 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor 2013-06-12 05:45:35 +00:00
parent 1d90958ba3
commit fde8374482
2 changed files with 9 additions and 1 deletions

View File

@ -104,10 +104,10 @@ class WXDLLIMPEXP_CORE wxComboBox :
virtual unsigned int GetCount() const;
virtual void SetValue(const wxString& value);
// these methods are provided by wxTextEntry for the native impl.
#if wxOSX_USE_CARBON
// Text field functions
virtual void SetValue(const wxString& value);
virtual wxString GetValue() const;
virtual void WriteText(const wxString& text);

View File

@ -189,6 +189,14 @@ wxString wxComboBox::GetStringSelection() const
return sel == wxNOT_FOUND ? wxString() : GetString(sel);
}
void wxComboBox::SetValue(const wxString& value)
{
if ( HasFlag(wxCB_READONLY) )
SetStringSelection( value ) ;
else
wxTextEntry::SetValue( value );
}
void wxComboBox::SetString(unsigned int n, const wxString& s)
{
// Notice that we shouldn't delete and insert the item in this control