From: Vadim Zeitlin Date: Thu, 22 Mar 2007 02:43:52 +0000 (+0000) Subject: don't lose the combobox text when it's opened and closed (patch 1684252, closes bug... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/f785bfddbd2030348b6a098828678c840776a27f don't lose the combobox text when it's opened and closed (patch 1684252, closes bug 1612994) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45010 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/msw/choice.cpp b/src/msw/choice.cpp index e7d100a954..4af53089a6 100644 --- a/src/msw/choice.cpp +++ b/src/msw/choice.cpp @@ -722,6 +722,13 @@ bool wxChoice::MSWCommand(WXUINT param, WXWORD WXUNUSED(id)) // need to reset the selection back to it if it's eventually // cancelled by user m_lastAcceptedSelection = GetCurrentSelection(); + if ( m_lastAcceptedSelection == -1 ) + { + // no current selection so no need to restore it later (this + // happens when opening a combobox containing text not from its + // list of items and we shouldn't erase this text) + m_lastAcceptedSelection = wxID_NONE; + } break; case CBN_CLOSEUP: