LCL: TTreeview: CustomSort with Begin/EndUpdate

git-svn-id: trunk@30783 -
This commit is contained in:
mattias 2011-05-17 11:43:20 +00:00
parent cc85f36b4e
commit 03e8b0a1dc

View File

@ -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;