win32: postpone combobox CBN_CLOSEUP message to let CBN_SELCHANGE to be handled first (fixes bug #0013189)

git-svn-id: trunk@18723 -
This commit is contained in:
paul 2009-02-17 07:29:14 +00:00
parent 2298d92d57
commit ff0c1822d1

View File

@ -1381,11 +1381,19 @@ begin
CBN_SELCHANGE is sent when the user changes the text by
selecting in the list, but before text is actually changed.
itemindex is updated, so set text manually }
CBN_SELCHANGE: begin
CBN_SELCHANGE:
begin
UpdateComboBoxText(TCustomComboBox(lWinControl));
SendSimpleMessage(lWinControl, LM_CHANGED);
LMessage.Msg := LM_SELCHANGE;
end;
CBN_CLOSEUP:
begin
// according to msdn CBN_CLOSEUP can happen before CBN_SELCHANGE and
// unfortunately it is simple truth. but we need correct order in the LCL
PostMessage(lWinControl.Handle, CN_COMMAND, WParam, LParam);
Exit;
end;
end;
end;