don't change the combobox text when it's being resized (see #10126)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58413 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
d57f1dd7fe
commit
428f8b0610
@ -39,6 +39,7 @@
|
||||
#endif
|
||||
|
||||
#include "wx/clipbrd.h"
|
||||
#include "wx/wupdlock.h"
|
||||
#include "wx/msw/private.h"
|
||||
|
||||
#if wxUSE_TOOLTIPS
|
||||
@ -233,8 +234,23 @@ WXLRESULT wxComboBox::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lPara
|
||||
|
||||
long fromOld, toOld;
|
||||
GetSelection(&fromOld, &toOld);
|
||||
|
||||
// if an editable combobox has a not empty text not from the
|
||||
// list, it tries to autocomplete it from the list when it is
|
||||
// resized, but we don't want this to happen as it doesn't seem
|
||||
// to make any sense, so we forcefully restore the old text
|
||||
wxString textOld;
|
||||
if ( !HasFlag(wxCB_READONLY) && GetCurrentSelection() == -1 )
|
||||
textOld = GetValue();
|
||||
|
||||
// eliminate flickering during following hacks
|
||||
wxWindowUpdateLocker lock(this);
|
||||
|
||||
WXLRESULT result = wxChoice::MSWWindowProc(nMsg, wParam, lParam);
|
||||
|
||||
if ( !textOld.empty() && GetValue() != textOld )
|
||||
SetLabel(textOld);
|
||||
|
||||
long fromNew, toNew;
|
||||
GetSelection(&fromNew, &toNew);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user