LazControls: Prevent a ListBox flashing when ListFilterEdit is updated. Move BeginUpdate up. Issue #40279, patch by n7800.

This commit is contained in:
Juha 2023-05-23 11:32:55 +03:00
parent 62acfd9909
commit d0671c7447

View File

@ -200,8 +200,9 @@ begin
clb:=Nil;
if fFilteredListbox is TCustomCheckListBox then
clb:=TCustomCheckListBox(fFilteredListbox);
fFilteredListbox.Clear;
fFilteredListbox.Items.BeginUpdate;
try
fFilteredListbox.Clear;
for i:=0 to fSortedData.Count-1 do begin
s:=fSortedData[i];
ListInd:=fFilteredListbox.Items.AddObject(s, fSortedData.Objects[i]);
@ -214,7 +215,9 @@ begin
clb.Checked[ListInd]:=fCheckedItems.Contains(s);
end;
end;
finally
fFilteredListbox.Items.EndUpdate;
end;
if FSimpleSelection and (fSortedData.Count > 0) then begin
if (Text<>'') then begin
MoveTo(0, true);