Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- procedure TMyForm.VSTFreeNode(Sender: TBaseVirtualTree; Node: PVirtualNode);
- var
- NewFocus: PVirtualNode;
- begin
- NewFocus := VST.GetNext(Node);
- if not Assigned(newFocus) then
- NewFocus := VST.GetPrevious(Node);
- if Assigned(NewFocus) then
- begin
- VST.FocusedNode := NewFocus;
- VST.Selected[NewFocus] := True
- end;
- end;
- procedure TMyForm.VSTFocusChanged(Sender: TBaseVirtualTree; Node: PVirtualNode; Column: TColumnIndex);
- begin
- btn1.Enabled := Assigned(Node);
- end;
- procedure TMyForm.VSTStructureChange(Sender: TBaseVirtualTree; Node: PVirtualNode;
- Reason: TChangeReason);
- begin
- { ActionDeleteNode is assigned to the button's Action property; SelectedCount
- is a bit paranoic here because if you use the toAlwaysSelectNode option, at
- least one node should be always selected, so RootNodeCount > 0 could do the
- same here }
- ActionDeleteNode.Enabled := Sender.SelectedCount > 0;
- end;
- VST.DeleteNode(VST.FocusedNode);
- ButtonDeleteNode.Enabled := VST.SelectedCount > 0;
Add Comment
Please, Sign In to add comment