mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-11 22:48:15 +02:00
LazControls: Prevent a ListBox flashing when ListFilterEdit is updated. Move BeginUpdate up. Issue #40279, patch by n7800.
This commit is contained in:
parent
62acfd9909
commit
d0671c7447
@ -200,8 +200,9 @@ begin
|
|||||||
clb:=Nil;
|
clb:=Nil;
|
||||||
if fFilteredListbox is TCustomCheckListBox then
|
if fFilteredListbox is TCustomCheckListBox then
|
||||||
clb:=TCustomCheckListBox(fFilteredListbox);
|
clb:=TCustomCheckListBox(fFilteredListbox);
|
||||||
fFilteredListbox.Clear;
|
|
||||||
fFilteredListbox.Items.BeginUpdate;
|
fFilteredListbox.Items.BeginUpdate;
|
||||||
|
try
|
||||||
|
fFilteredListbox.Clear;
|
||||||
for i:=0 to fSortedData.Count-1 do begin
|
for i:=0 to fSortedData.Count-1 do begin
|
||||||
s:=fSortedData[i];
|
s:=fSortedData[i];
|
||||||
ListInd:=fFilteredListbox.Items.AddObject(s, fSortedData.Objects[i]);
|
ListInd:=fFilteredListbox.Items.AddObject(s, fSortedData.Objects[i]);
|
||||||
@ -214,7 +215,9 @@ begin
|
|||||||
clb.Checked[ListInd]:=fCheckedItems.Contains(s);
|
clb.Checked[ListInd]:=fCheckedItems.Contains(s);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
finally
|
||||||
fFilteredListbox.Items.EndUpdate;
|
fFilteredListbox.Items.EndUpdate;
|
||||||
|
end;
|
||||||
if FSimpleSelection and (fSortedData.Count > 0) then begin
|
if FSimpleSelection and (fSortedData.Count > 0) then begin
|
||||||
if (Text<>'') then begin
|
if (Text<>'') then begin
|
||||||
MoveTo(0, true);
|
MoveTo(0, true);
|
||||||
|
Loading…
Reference in New Issue
Block a user