简体   繁体   English

突出重点节点

[英]Highlight focused node

在 VirtualTreeView 中使用 getprevious(node) 或 getnext(node) 时,是否可以通过单击在选择节点上的上一个或下一个节点上获得蓝色突出显示?

This is how you make a node highlighted with blue: (or other colour set at VST.Colors...)这就是您如何使节点以蓝色突出显示:(或在 VST.Colors 中设置的其他颜色...)
VST.Selected[Node] := True;

Do not mix with : VST.FocusedNode !不要与: VST.FocusedNode

You may consider to deselect the previous blue one first.您可以考虑先取消选择之前的蓝色。 If VST.TreeOptions.SelectionOptions >> toMultiSelect = False , it's enough to simply "remember" the last one:如果VST.TreeOptions.SelectionOptions >> toMultiSelect = False ,只需“记住”最后一个就足够了:

var
  LastSelected: PVirtualNode;  // you can put this to the Form's private section
...  
procedure DeselectLastOne();
begin
  if (csDestroying in VST.ComponentState) then Exit;
  if Assigned(LastSelected) then begin
    VST.Selected[LastSelected] := False;
    LastSelected := nil;
  end;
end;

procedure SelectNewOne(N: PVirtualNode);
begin
  if (csDestroying in VST.ComponentState) then Exit;
  DeselectLastOne();
  VST.Selected[N] := True;
  LastSelected := N;  
end;          

initialization
  LastSelected = nil;  // you can put this to the Form's OnCreate proc.

But if you have set VST.TreeOptions.SelectionOptions >> toMultiSelect = True than you'll have to iterate through VST.SelectedNodes() function first to deselect ALL highlighted nodes.但是,如果您已设置VST.TreeOptions.SelectionOptions >> toMultiSelect = True ,则您必须首先遍历VST.SelectedNodes()函数以取消选择所有突出显示的节点。

See also: VST.SelectedCount : integer;另见: VST.SelectedCount : integer; , VST.GetFirstSelected() , VST.GetNextSelected() , VST.GetFirstSelected() , VST.GetNextSelected()

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 聚焦或单击时如何突出显示 ImageView? - How to highlight ImageView when focused or clicked? 有什么方法可以突出显示焦点输入的字段/格? - Is there a way where I can highlight the field/div of the focused input? Chrome-将节点悬停在Web检查器中时突出显示网页上的相应元素 - Chrome - highlight corresponding element on webpage when node hovered in web inspector Vis.js:突出显示选定节点并将其他节点灰显 - Vis.js: Highlight selected node and grey out the others Marklogic:“突出显示”似乎不适用于Node.js和QueryBuilder - Marklogic : “highlight” seem not work withe Node.js and QueryBuilder D3强制布局:突出显示节点的颜色(“圆形”) - D3 force layout: highlight the color of a node (“circle”) Cytoscape.js-突出显示所选节点的所有路径 - Cytoscape.js - Highlight all paths from the selected node jsTree-展开并突出显示我在上一页中单击的节点 - jsTree - expand and highlight node I clicked on previous page d3js force directed - 在悬停到节点时,突出显示/ colourup链接的节点和链接? - d3js force directed - On hover to node, highlight/colourup linked nodes and links? 在D3力导向图中突出显示所选节点,其链接及其子节点 - Highlight selected node, its links, and its children in a D3 force directed graph
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM