Implement wxComboBox::SetValue() in wxQt

Make setting combobox value work.
This commit is contained in:
Scott Furry
2017-07-14 16:50:21 +02:00
committed by Vadim Zeitlin
parent 019cf6e6f0
commit fd7f4dfe3d
2 changed files with 10 additions and 0 deletions

View File

@@ -69,6 +69,8 @@ public:
bool IsListEmpty() const { return wxItemContainer::IsEmpty(); }
bool IsTextEmpty() const { return wxTextEntry::IsEmpty(); }
virtual void SetValue(const wxString& value) wxOVERRIDE;
virtual void Popup();
virtual void Dismiss();

View File

@@ -118,6 +118,14 @@ bool wxComboBox::Create(wxWindow *parent, wxWindowID id,
return QtCreateControl( parent, id, pos, size, style, validator, name );
}
void wxComboBox::SetValue(const wxString& value)
{
if ( HasFlag(wxCB_READONLY) )
SetStringSelection(value);
else
wxTextEntry::SetValue(value);
}
wxString wxComboBox::DoGetValue() const
{
return wxQtConvertString( m_qtComboBox->currentText() );