FilterEdit: improve the logic of moving in the list when using up/down keys.

git-svn-id: trunk@35672 -
This commit is contained in:
juha 2012-03-03 15:55:59 +00:00
parent c70cb74622
commit 083d8fdab4
2 changed files with 15 additions and 13 deletions

View File

@ -233,10 +233,12 @@ var
i: Integer;
begin
i := GetFirstSelected + 1;
if i < fFilteredListbox.Count then
begin
if fFilteredListbox.Count > 0 then begin
UnselectAll;
fFilteredListbox.Selected[i] := True;
if i < fFilteredListbox.Count then
fFilteredListbox.Selected[i] := True
else
fFilteredListbox.Selected[0] := True;
end;
end;
@ -245,10 +247,12 @@ var
i: Integer;
begin
i := GetFirstSelected - 1;
if i >= 0 then
begin
if fFilteredListbox.Count > 0 then begin
UnselectAll;
fFilteredListbox.Selected[i] := True;
if i >= 0 then
fFilteredListbox.Selected[i] := True
else
fFilteredListbox.Selected[fFilteredListbox.Count-1] := True;
end;
end;

View File

@ -911,10 +911,8 @@ begin
Result:=ANode;
end;
end
else begin
Assert(Parent.Visible, 'TTreeNode.GetPrevVisible: Parent is not Visible');
else
Result := Parent;
end;
if (Result<>nil) and (TreeView<>nil) and (not TreeView.IsNodeVisible(Result)) then
Result:=nil;
end;
@ -5632,8 +5630,8 @@ begin
else
ANode := Selected;
if ANode <> nil then
ANode := ANode.GetNextExpanded
else if Items.Count > 0 then
ANode := ANode.GetNextVisible;
if (ANode = nil) and (Items.Count > 0) then
ANode := FTreeNodes.GetFirstVisibleNode;
if ANode <> nil then
if tvoAllowMultiSelect in FOptions then
@ -5651,8 +5649,8 @@ begin
else
ANode := Selected;
if ANode <> nil then
ANode := ANode.GetPrevExpanded
else if Items.Count > 0 then
ANode := ANode.GetPrevVisible;
if (ANode = nil) and (Items.Count > 0) then
ANode := Items.GetLastExpandedSubNode;
if ANode <> nil then
if tvoAllowMultiSelect in FOptions then