From aac5c510b4535c283e42460d96782a3bd5989411 Mon Sep 17 00:00:00 2001 From: micha Date: Wed, 5 Jul 2006 20:31:49 +0000 Subject: [PATCH] preserve combobox text when changing string in list (issue #1734) git-svn-id: trunk@9566 - --- lcl/interfaces/win32/win32listsl.inc | 2 +- lcl/interfaces/win32/win32wsstdctrls.pp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lcl/interfaces/win32/win32listsl.inc b/lcl/interfaces/win32/win32listsl.inc index de3edeb4f8..9c80c4dd82 100644 --- a/lcl/interfaces/win32/win32listsl.inc +++ b/lcl/interfaces/win32/win32listsl.inc @@ -267,7 +267,7 @@ begin if lItemIndex = -1 then begin lItemIndex := SendMessage(FWin32List, FFlagGetItemIndex, 0, 0); - lSelected := true; + lSelected := lItemIndex >= 0; end; inherited; diff --git a/lcl/interfaces/win32/win32wsstdctrls.pp b/lcl/interfaces/win32/win32wsstdctrls.pp index d72e394be0..7ad12e4ea1 100644 --- a/lcl/interfaces/win32/win32wsstdctrls.pp +++ b/lcl/interfaces/win32/win32wsstdctrls.pp @@ -736,6 +736,7 @@ var begin Assert(False, Format('Trace:TWin32WSCustomComboBox.SetText --> %S', [AText])); Handle := AWinControl.Handle; + Windows.SendMessage(Handle, CB_SETCURSEL, -1, 0); if TCustomComboBox(AWinControl).ReadOnly then Windows.SendMessage(Handle, CB_SELECTSTRING, -1, LPARAM(PChar(AText))) else