Recent

Author Topic: [SOLVED] VST add root and child  (Read 941 times)

Pe3s

  • Hero Member
  • *****
  • Posts: 533
[SOLVED] VST add root and child
« on: February 28, 2023, 07:03:18 pm »
Hello, I can't find an example of how to add string values ​​to the VST tree, e.g. from the edit component?

« Last Edit: March 01, 2023, 04:35:11 pm by Pe3s »

KodeZwerg

  • Hero Member
  • *****
  • Posts: 2010
  • Fifty shades of code.
    • Delphi & FreePascal
Re: VST add root and child
« Reply #1 on: February 28, 2023, 07:37:31 pm »
Here you go removed data to save webspace
« Last Edit: February 28, 2023, 09:27:18 pm by KodeZwerg »
« Last Edit: Tomorrow at 31:76:97 xm by KodeZwerg »

Pe3s

  • Hero Member
  • *****
  • Posts: 533
Re: VST add root and child
« Reply #2 on: February 28, 2023, 07:53:25 pm »
@KodeZwerg, and how can i add a child record to create such an expandable tree?

KodeZwerg

  • Hero Member
  • *****
  • Posts: 2010
  • Fifty shades of code.
    • Delphi & FreePascal
Re: VST add root and child
« Reply #3 on: February 28, 2023, 09:20:11 pm »
Here you go
« Last Edit: Tomorrow at 31:76:97 xm by KodeZwerg »

wp

  • Hero Member
  • *****
  • Posts: 11858
Re: VST add root and child
« Reply #4 on: February 28, 2023, 11:50:59 pm »
KodeZwerg, your sample project is leaking memory. You must free the string in the OnFreeNode event:
Code: Pascal  [Select][+][-]
  1. procedure TForm1.VSTFreeNode(Sender: TBaseVirtualTree; Node: PVirtualNode);
  2. var
  3.   Data: PLCLTextData;
  4. begin
  5.   Data := VST.GetNodeData(Node);
  6.   Data^.Text := '';
  7. end;

jamie

  • Hero Member
  • *****
  • Posts: 6091
Re: VST add root and child
« Reply #5 on: March 01, 2023, 01:04:22 am »
KodeZwerg, your sample project is leaking memory. You must free the string in the OnFreeNode event:
Code: Pascal  [Select][+][-]
  1. procedure TForm1.VSTFreeNode(Sender: TBaseVirtualTree; Node: PVirtualNode);
  2. var
  3.   Data: PLCLTextData;
  4. begin
  5.   Data := VST.GetNodeData(Node);
  6.   Data^.Text := '';
  7. end;

Ah, We have a LEAKER in the forums! :o
The only true wisdom is knowing you know nothing

KodeZwerg

  • Hero Member
  • *****
  • Posts: 2010
  • Fifty shades of code.
    • Delphi & FreePascal
Re: VST add root and child
« Reply #6 on: March 01, 2023, 09:58:31 am »
KodeZwerg, your sample project is leaking memory. You must free the string in the OnFreeNode event:
Thank you for taking care!
« Last Edit: Tomorrow at 31:76:97 xm by KodeZwerg »

Pe3s

  • Hero Member
  • *****
  • Posts: 533
Re: VST add root and child
« Reply #7 on: March 01, 2023, 04:34:54 pm »
Thank You  :)

 

TinyPortal © 2005-2018