mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-23 18:39:49 +02:00
FilterEdit: improve the logic of moving in the list when using up/down keys.
git-svn-id: trunk@35672 -
This commit is contained in:
parent
c70cb74622
commit
083d8fdab4
@ -233,10 +233,12 @@ var
|
|||||||
i: Integer;
|
i: Integer;
|
||||||
begin
|
begin
|
||||||
i := GetFirstSelected + 1;
|
i := GetFirstSelected + 1;
|
||||||
if i < fFilteredListbox.Count then
|
if fFilteredListbox.Count > 0 then begin
|
||||||
begin
|
|
||||||
UnselectAll;
|
UnselectAll;
|
||||||
fFilteredListbox.Selected[i] := True;
|
if i < fFilteredListbox.Count then
|
||||||
|
fFilteredListbox.Selected[i] := True
|
||||||
|
else
|
||||||
|
fFilteredListbox.Selected[0] := True;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -245,10 +247,12 @@ var
|
|||||||
i: Integer;
|
i: Integer;
|
||||||
begin
|
begin
|
||||||
i := GetFirstSelected - 1;
|
i := GetFirstSelected - 1;
|
||||||
if i >= 0 then
|
if fFilteredListbox.Count > 0 then begin
|
||||||
begin
|
|
||||||
UnselectAll;
|
UnselectAll;
|
||||||
fFilteredListbox.Selected[i] := True;
|
if i >= 0 then
|
||||||
|
fFilteredListbox.Selected[i] := True
|
||||||
|
else
|
||||||
|
fFilteredListbox.Selected[fFilteredListbox.Count-1] := True;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -911,10 +911,8 @@ begin
|
|||||||
Result:=ANode;
|
Result:=ANode;
|
||||||
end;
|
end;
|
||||||
end
|
end
|
||||||
else begin
|
else
|
||||||
Assert(Parent.Visible, 'TTreeNode.GetPrevVisible: Parent is not Visible');
|
|
||||||
Result := Parent;
|
Result := Parent;
|
||||||
end;
|
|
||||||
if (Result<>nil) and (TreeView<>nil) and (not TreeView.IsNodeVisible(Result)) then
|
if (Result<>nil) and (TreeView<>nil) and (not TreeView.IsNodeVisible(Result)) then
|
||||||
Result:=nil;
|
Result:=nil;
|
||||||
end;
|
end;
|
||||||
@ -5632,8 +5630,8 @@ begin
|
|||||||
else
|
else
|
||||||
ANode := Selected;
|
ANode := Selected;
|
||||||
if ANode <> nil then
|
if ANode <> nil then
|
||||||
ANode := ANode.GetNextExpanded
|
ANode := ANode.GetNextVisible;
|
||||||
else if Items.Count > 0 then
|
if (ANode = nil) and (Items.Count > 0) then
|
||||||
ANode := FTreeNodes.GetFirstVisibleNode;
|
ANode := FTreeNodes.GetFirstVisibleNode;
|
||||||
if ANode <> nil then
|
if ANode <> nil then
|
||||||
if tvoAllowMultiSelect in FOptions then
|
if tvoAllowMultiSelect in FOptions then
|
||||||
@ -5651,8 +5649,8 @@ begin
|
|||||||
else
|
else
|
||||||
ANode := Selected;
|
ANode := Selected;
|
||||||
if ANode <> nil then
|
if ANode <> nil then
|
||||||
ANode := ANode.GetPrevExpanded
|
ANode := ANode.GetPrevVisible;
|
||||||
else if Items.Count > 0 then
|
if (ANode = nil) and (Items.Count > 0) then
|
||||||
ANode := Items.GetLastExpandedSubNode;
|
ANode := Items.GetLastExpandedSubNode;
|
||||||
if ANode <> nil then
|
if ANode <> nil then
|
||||||
if tvoAllowMultiSelect in FOptions then
|
if tvoAllowMultiSelect in FOptions then
|
||||||
|
Loading…
Reference in New Issue
Block a user