From 3110909fec7862e2b0828ed05c3daacffe00e60d Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 28 Jan 2006 00:43:23 +0000 Subject: [PATCH] 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 --- include/wx/msw/combobox.h | 2 +- src/msw/combobox.cpp | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/include/wx/msw/combobox.h b/include/wx/msw/combobox.h index 7449a7b526..0ef87a536a 100644 --- a/include/wx/msw/combobox.h +++ b/include/wx/msw/combobox.h @@ -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; diff --git a/src/msw/combobox.cpp b/src/msw/combobox.cpp index d85ef7e887..c8fd88ae27 100644 --- a/src/msw/combobox.cpp +++ b/src/msw/combobox.cpp @@ -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 // ---------------------------------------------------------------------------- -- 2.45.2