mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-07-26 09:56:06 +02:00
TreeFilter: fix moving up and down when tree has multiselect enabled.
git-svn-id: trunk@34466 -
This commit is contained in:
parent
633f92bf41
commit
e762c4e425
@ -5,7 +5,7 @@
|
|||||||
<Name Value="LazControls"/>
|
<Name Value="LazControls"/>
|
||||||
<AddToProjectUsesSection Value="True"/>
|
<AddToProjectUsesSection Value="True"/>
|
||||||
<CompilerOptions>
|
<CompilerOptions>
|
||||||
<Version Value="10"/>
|
<Version Value="11"/>
|
||||||
<PathDelim Value="\"/>
|
<PathDelim Value="\"/>
|
||||||
<SearchPaths>
|
<SearchPaths>
|
||||||
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
|
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
|
||||||
|
@ -422,31 +422,13 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TTreeFilterEdit.MoveNext;
|
procedure TTreeFilterEdit.MoveNext;
|
||||||
var
|
|
||||||
tn: TTreeNode;
|
|
||||||
begin
|
begin
|
||||||
tn := fFilteredTreeview.Selected;
|
fFilteredTreeview.MoveToNextNode;
|
||||||
if not Assigned(tn) then
|
|
||||||
begin
|
|
||||||
tn := fFilteredTreeview.TopItem;
|
|
||||||
if Assigned(tn) then
|
|
||||||
fFilteredTreeview.Selected := tn;
|
|
||||||
Exit;
|
|
||||||
end;
|
|
||||||
tn := tn.GetNext;
|
|
||||||
if Assigned(tn) then
|
|
||||||
fFilteredTreeview.Selected := tn;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TTreeFilterEdit.MovePrev;
|
procedure TTreeFilterEdit.MovePrev;
|
||||||
var
|
|
||||||
tn: TTreeNode;
|
|
||||||
begin
|
begin
|
||||||
tn := fFilteredTreeview.Selected;
|
fFilteredTreeview.MoveToPrevNode;
|
||||||
if not Assigned(tn) then Exit;
|
|
||||||
tn := tn.GetPrev;
|
|
||||||
if Assigned(tn) then
|
|
||||||
fFilteredTreeview.Selected := tn;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
@ -2914,6 +2914,8 @@ type
|
|||||||
function GetLastMultiSelected: TTreeNode;
|
function GetLastMultiSelected: TTreeNode;
|
||||||
function SelectionVisible: boolean;
|
function SelectionVisible: boolean;
|
||||||
procedure MakeSelectionVisible;
|
procedure MakeSelectionVisible;
|
||||||
|
procedure MoveToNextNode;
|
||||||
|
procedure MoveToPrevNode;
|
||||||
public
|
public
|
||||||
property BackgroundColor: TColor
|
property BackgroundColor: TColor
|
||||||
read FBackgroundColor write SetBackgroundColor default clWindow;
|
read FBackgroundColor write SetBackgroundColor default clWindow;
|
||||||
|
@ -3332,6 +3332,14 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCustomTreeView.SetSeparatorColor(const AValue: TColor);
|
||||||
|
begin
|
||||||
|
if fSeparatorColor=AValue then exit;
|
||||||
|
fSeparatorColor:=AValue;
|
||||||
|
if tvoShowSeparators in Options then
|
||||||
|
Invalidate;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TCustomTreeView.SetShowButton(Value: Boolean);
|
procedure TCustomTreeView.SetShowButton(Value: Boolean);
|
||||||
begin
|
begin
|
||||||
if ShowButtons <> Value then begin
|
if ShowButtons <> Value then begin
|
||||||
@ -5435,12 +5443,42 @@ begin
|
|||||||
ANode.MakeVisible;
|
ANode.MakeVisible;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomTreeView.SetSeparatorColor(const AValue: TColor);
|
procedure TCustomTreeView.MoveToNextNode;
|
||||||
|
var
|
||||||
|
lNode: TTreeNode;
|
||||||
begin
|
begin
|
||||||
if fSeparatorColor=AValue then exit;
|
if tvoAllowMultiSelect in FOptions then
|
||||||
fSeparatorColor:=AValue;
|
lNode := FTreeNodes.FLastMultiSelected
|
||||||
if tvoShowSeparators in Options then
|
else
|
||||||
Invalidate;
|
lNode := Selected;
|
||||||
|
if lNode <> nil then
|
||||||
|
lNode := lNode.GetNextExpanded
|
||||||
|
else if Items.Count > 0 then
|
||||||
|
lNode := FTreeNodes.GetFirstNode;
|
||||||
|
if lNode <> nil then
|
||||||
|
if tvoAllowMultiSelect in FOptions then
|
||||||
|
FTreeNodes.SelectOnlyThis(lNode)
|
||||||
|
else
|
||||||
|
Selected := lNode;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCustomTreeView.MoveToPrevNode;
|
||||||
|
var
|
||||||
|
lNode: TTreeNode;
|
||||||
|
begin
|
||||||
|
if tvoAllowMultiSelect in FOptions then
|
||||||
|
lNode := FTreeNodes.FLastMultiSelected
|
||||||
|
else
|
||||||
|
lNode := Selected;
|
||||||
|
if lNode <> nil then
|
||||||
|
lNode := lNode.GetPrevExpanded
|
||||||
|
else if Items.Count > 0 then
|
||||||
|
lNode := Items.GetLastExpandedSubNode;
|
||||||
|
if lNode <> nil then
|
||||||
|
if tvoAllowMultiSelect in FOptions then
|
||||||
|
FTreeNodes.SelectOnlyThis(lNode)
|
||||||
|
else
|
||||||
|
Selected := lNode;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// back to comctrls.pp
|
// back to comctrls.pp
|
||||||
|
Loading…
Reference in New Issue
Block a user