mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-05 12:37:23 +01:00
LCL: TTreeview: CustomSort with Begin/EndUpdate
git-svn-id: trunk@30783 -
This commit is contained in:
parent
cc85f36b4e
commit
03e8b0a1dc
@ -2960,19 +2960,20 @@ var Node: TTreeNode;
|
||||
begin
|
||||
Result := False;
|
||||
if FTreeNodes.Count>0 then begin
|
||||
BeginUpdate;
|
||||
if not assigned(SortProc) then SortProc := @DefaultTreeViewSort;
|
||||
FTreeNodes.SortTopLevelNodes(SortProc);
|
||||
|
||||
Node := FTreeNodes.GetFirstNode;
|
||||
while Node <> nil do begin
|
||||
if Node.HasChildren then Node.CustomSort(SortProc);
|
||||
if (Node.GetFirstChild<>nil) then Node.CustomSort(SortProc);
|
||||
Node := Node.GetNext;
|
||||
end;
|
||||
Items.ClearCache;
|
||||
FStates:= FStates+[tvsTopsNeedsUpdate, tvsTopItemNeedsUpdate,
|
||||
tvsBottomItemNeedsUpdate,
|
||||
tvsScrollbarChanged,tvsMaxRightNeedsUpdate];
|
||||
tvsBottomItemNeedsUpdate,tvsScrollbarChanged];
|
||||
Invalidate;
|
||||
EndUpdate;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user