LCL: TTreeView.ClearSelection, patch #25014

git-svn-id: trunk@42776 -
This commit is contained in:
mattias 2013-09-13 19:07:42 +00:00
parent 03c1d319be
commit decd9058d8
2 changed files with 9 additions and 0 deletions

View File

@ -3259,6 +3259,7 @@ type
constructor Create(AnOwner: TComponent); override;
destructor Destroy; override;
function AlphaSort: Boolean;
procedure ClearSelection(KeepPrimary: Boolean = false); virtual;
procedure ConsistencyCheck;
function CustomSort(SortProc: TTreeNodeCompare): Boolean;
function DefaultTreeViewSort(Node1, Node2: TTreeNode): Integer;

View File

@ -5483,6 +5483,14 @@ begin
Include(FStates,tvsCanvasChanged);
end;
procedure TCustomTreeView.ClearSelection(KeepPrimary: Boolean);
begin
if tvoAllowMultiSelect in FOptions then
Items.ClearMultiSelection(not KeepPrimary)
else
if not KeepPrimary then Selected := nil;
end;
function TCustomTreeView.IsCustomDrawn(Target: TCustomDrawTarget;
Stage: TCustomDrawStage): Boolean;
begin