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:
@@ -39,6 +39,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/clipbrd.h"
|
#include "wx/clipbrd.h"
|
||||||
|
#include "wx/wupdlock.h"
|
||||||
#include "wx/msw/private.h"
|
#include "wx/msw/private.h"
|
||||||
|
|
||||||
#if wxUSE_TOOLTIPS
|
#if wxUSE_TOOLTIPS
|
||||||
@@ -233,8 +234,23 @@ WXLRESULT wxComboBox::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lPara
|
|||||||
|
|
||||||
long fromOld, toOld;
|
long fromOld, toOld;
|
||||||
GetSelection(&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);
|
WXLRESULT result = wxChoice::MSWWindowProc(nMsg, wParam, lParam);
|
||||||
|
|
||||||
|
if ( !textOld.empty() && GetValue() != textOld )
|
||||||
|
SetLabel(textOld);
|
||||||
|
|
||||||
long fromNew, toNew;
|
long fromNew, toNew;
|
||||||
GetSelection(&fromNew, &toNew);
|
GetSelection(&fromNew, &toNew);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user