Guest User

Untitled

a guest
Jul 18th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. procedure TMyForm.VSTFreeNode(Sender: TBaseVirtualTree; Node: PVirtualNode);
  2. var
  3. NewFocus: PVirtualNode;
  4. begin
  5. NewFocus := VST.GetNext(Node);
  6. if not Assigned(newFocus) then
  7. NewFocus := VST.GetPrevious(Node);
  8. if Assigned(NewFocus) then
  9. begin
  10. VST.FocusedNode := NewFocus;
  11. VST.Selected[NewFocus] := True
  12. end;
  13. end;
  14.  
  15. procedure TMyForm.VSTFocusChanged(Sender: TBaseVirtualTree; Node: PVirtualNode; Column: TColumnIndex);
  16. begin
  17. btn1.Enabled := Assigned(Node);
  18. end;
  19.  
  20. procedure TMyForm.VSTStructureChange(Sender: TBaseVirtualTree; Node: PVirtualNode;
  21. Reason: TChangeReason);
  22. begin
  23. { ActionDeleteNode is assigned to the button's Action property; SelectedCount
  24. is a bit paranoic here because if you use the toAlwaysSelectNode option, at
  25. least one node should be always selected, so RootNodeCount > 0 could do the
  26. same here }
  27. ActionDeleteNode.Enabled := Sender.SelectedCount > 0;
  28. end;
  29.  
  30. VST.DeleteNode(VST.FocusedNode);
  31. ButtonDeleteNode.Enabled := VST.SelectedCount > 0;
Add Comment
Please, Sign In to add comment