Update the text part of combobox when changing text of selected item in wxGTK.
Add a call to SetValue() to wxComboBox::SetString() in wxGTK if the item being changed is the currently selected one. The new behaviour is consistent with wxMSW and also makes more sense. Document it too to remove any doubts about what is supposed to happen in this case. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70880 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -282,6 +282,19 @@ void wxComboBox::SetValue(const wxString& value)
|
||||
wxTextEntry::SetValue(value);
|
||||
}
|
||||
|
||||
void wxComboBox::SetString(unsigned int n, const wxString& text)
|
||||
{
|
||||
wxChoice::SetString(n, text);
|
||||
|
||||
if ( static_cast<int>(n) == GetSelection() )
|
||||
{
|
||||
// We also need to update the currently shown text, for consistency
|
||||
// with wxMSW and also because it makes sense as leaving the old string
|
||||
// in the text but not in the list would be confusing to the user.
|
||||
SetValue(text);
|
||||
}
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// standard event handling
|
||||
// ----------------------------------------------------------------------------
|
||||
|
Reference in New Issue
Block a user