SetSelection() must update m_selectionOld, otherwise it doesn't correspond to the real selection any more and selection change events are sent twice

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37190 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2006-01-28 00:43:23 +00:00
parent be96ed8c5d
commit 3110909fec
2 changed files with 11 additions and 1 deletions

View File

@@ -91,7 +91,7 @@ public:
virtual wxTextPos GetLastPosition() const;
virtual void Replace(long from, long to, const wxString& value);
virtual void Remove(long from, long to);
virtual void SetSelection(int n) { wxChoice::SetSelection(n); }
virtual void SetSelection(int n);
virtual void SetSelection(long from, long to);
virtual int GetSelection() const;
virtual void GetSelection(long* from, long* to) const;

View File

@@ -755,6 +755,16 @@ void wxComboBox::Clear()
m_value.clear();
}
// ----------------------------------------------------------------------------
// overridden wxChoice methods
// ----------------------------------------------------------------------------
void wxComboBox::SetSelection(int n)
{
wxChoice::SetSelection(n);
m_selectionOld = n;
}
// ----------------------------------------------------------------------------
// standard event handling
// ----------------------------------------------------------------------------