implemented auto selection visible for component tree

git-svn-id: trunk@4766 -
This commit is contained in:
mattias 2003-11-07 15:57:45 +00:00
parent ab28387ed2
commit 8307c1426c
3 changed files with 34 additions and 0 deletions

View File

@ -2392,6 +2392,7 @@ begin
PropertyGrid.Selections:=FComponentList;
EventGrid.Selections:=FComponentList;
ComponentTree.Selections:=FComponentList;
ComponentTree.MakeSelectionVisible;
if (not Visible) and (FComponentList.Count>0) then
Visible:=true;
end;

View File

@ -1731,6 +1731,8 @@ type
procedure LockSelectionChangeEvent;
procedure UnlockSelectionChangeEvent;
function GetFirstMultiSelected: TTreeNode;
function SelectionVisible: boolean;
procedure MakeSelectionVisible;
public
property BackgroundColor: TColor
read FBackgroundColor write SetBackgroundColor;
@ -1935,6 +1937,9 @@ end.
{ =============================================================================
$Log$
Revision 1.91 2003/11/07 15:57:45 mattias
implemented auto selection visible for component tree
Revision 1.90 2003/10/22 17:50:16 mattias
updated rpm scripts

View File

@ -5093,6 +5093,34 @@ begin
Result:=Items.FFirstMultiSelected;
end;
function TCustomTreeView.SelectionVisible: boolean;
var
ANode: TTreeNode;
begin
ANode:=GetFirstMultiSelected;
while (ANode<>nil) do begin
if ANode.IsVisible then begin
Result:=true;
exit;
end;
ANode:=ANode.GetNextMultiSelected;
end;
ANode:=Selected;
Result:=(ANode<>nil) and (ANode.IsVisible);
end;
procedure TCustomTreeView.MakeSelectionVisible;
var
ANode: TTreeNode;
begin
if SelectionVisible then exit;
ANode:=GetFirstMultiSelected;
if (ANode=nil) then
ANode:=Selected;
if ANode=nil then exit;
ANode.MakeVisible;
end;
procedure TCustomTreeView.SetSeparatorColor(const AValue: TColor);
begin
if fSeparatorColor=AValue then exit;