mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-09 15:36:10 +02:00
TreeView: Add Select methods for Deplhi compatibility.
Patch by Ocean. git-svn-id: trunk@43259 -
This commit is contained in:
parent
9a50b81dd5
commit
c42232d6f1
@ -3300,6 +3300,9 @@ type
|
||||
procedure UnlockSelectionChangeEvent;
|
||||
function GetFirstMultiSelected: TTreeNode;
|
||||
function GetLastMultiSelected: TTreeNode;
|
||||
procedure Select(Node: TTreeNode; ShiftState: TShiftState = []);
|
||||
procedure Select(const Nodes: array of TTreeNode); virtual;
|
||||
procedure Select(Nodes: TList); virtual;
|
||||
function SelectionVisible: boolean;
|
||||
procedure MakeSelectionVisible;
|
||||
procedure ClearInvisibleSelection;
|
||||
|
@ -5650,6 +5650,44 @@ begin
|
||||
Result := Items.FLastMultiSelected;
|
||||
end;
|
||||
|
||||
procedure TCustomTreeView.Select(Node: TTreeNode; ShiftState: TShiftState = []);
|
||||
begin
|
||||
if (tvoAllowMultiSelect in FOptions) and (ssCtrl in ShiftState) then
|
||||
Node.Selected := True
|
||||
else begin
|
||||
ClearSelection;
|
||||
Selected := Node;
|
||||
if (tvoAllowMultiSelect in FOptions) then
|
||||
Node.Selected := True;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TCustomTreeView.Select(const Nodes: array of TTreeNode);
|
||||
var
|
||||
I: Integer;
|
||||
begin
|
||||
ClearSelection;
|
||||
if Length(Nodes)>0 then begin
|
||||
Selected := Nodes[0];
|
||||
if tvoAllowMultiSelect in FOptions then
|
||||
for I := Low(Nodes) to High(Nodes) do
|
||||
Nodes[I].Selected := True;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TCustomTreeView.Select(Nodes: TList);
|
||||
var
|
||||
I: Integer;
|
||||
begin
|
||||
ClearSelection;
|
||||
if Nodes.Count>0 then begin
|
||||
Selected := TTreeNode(Nodes[0]);
|
||||
if tvoAllowMultiSelect in FOptions then
|
||||
for I := 0 to Nodes.Count - 1 do
|
||||
TTreeNode(Nodes[I]).Selected := True;
|
||||
end;
|
||||
end;
|
||||
|
||||
function TCustomTreeView.SelectionVisible: boolean;
|
||||
var
|
||||
ANode: TTreeNode;
|
||||
|
Loading…
Reference in New Issue
Block a user