use DoGetValue() in parent class will be enough, and add readonly support to SetValue()

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77793 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2014-09-23 17:40:39 +00:00
parent 26ce3d6361
commit 02526cc9d2
2 changed files with 3 additions and 10 deletions

View File

@ -163,8 +163,6 @@ public:
virtual void SetClientDataType(wxClientDataType clientDataItemsType) wxOVERRIDE;
protected:
virtual wxString DoGetValue() const wxOVERRIDE;
virtual int DoInsertItems(const wxArrayStringsAdapter& items,
unsigned int pos,
void **clientData, wxClientDataType type) wxOVERRIDE;

View File

@ -270,17 +270,12 @@ wxComboBox::~wxComboBox()
// wxComboBox methods forwarded to wxTextCtrl
// ----------------------------------------------------------------------------
wxString wxComboBox::DoGetValue() const
{
return GetTextCtrl() ? GetTextCtrl()->GetValue() : m_valueString;
}
void wxComboBox::SetValue(const wxString& value)
{
if ( GetTextCtrl() )
GetTextCtrl()->SetValue(value);
if ( HasFlag(wxCB_READONLY) )
SetStringSelection(value);
else
m_valueString = value;
GetTextCtrl()->SetValue(value);
}
void wxComboBox::WriteText(const wxString& value)