Recent

Author Topic: VST RootNode  (Read 281 times)

eldonfsr

  • Sr. Member
  • ****
  • Posts: 337
VST RootNode
« on: November 03, 2022, 02:58:41 pm »
Hi I don't knwo what i made wrong at RootNode datas are not saved or i made some wrong.. here is my code...
Code: Pascal  [Select][+][-]
  1.      XNode := VSTPL.AddChild(nil);
  2.      if ( VSTPL.AbsoluteIndex(XNode) > -1 ) then   begin
  3.         Data := VSTPL.GetNodeData(Xnode);
  4.         Data^.RItem   := 'Top';
  5.         Data^.RQty    := 0;
  6.         Data^.RPart   := FormProdCtrl.SQLQProds.FieldByName('Pnpartnumber').AsString;
  7.         Data^.RCost   := FormProdCtrl.SQLQProds.FieldByName('PnCurrentCost').AsFloat;
  8.         Data^.RDetail := FormProdCtrl.SQLQProds.FieldByName('PnDetail').AsString;
  9.         Data^.RTitle  := FormProdCtrl.SQLQProds.FieldByName('PnTitle').AsString;
  10.         Data^.RType   := FormProdCtrl.SQLQProds.FieldByName('PNType').AsString;
  11.      end;
  12. //     VSTPL.Expanded[VSTPL.FocusedNode] := True;
  13.      RxMPLNK.first;
  14.      while(not RxMPLNK.EOF) do begin
  15.         if(RxMPLNK.FieldByName('RxChild').AsBoolean = true) then begin
  16.           XNode := VSTPL.TopNode;
  17. //          XNode := VSTPL.AddChild(VSTPL.TopNode.Index);
  18.           VSTPL.InsertNode(VSTPL.FocusedNode,amInsertBefore);
  19.         end else begin
  20.          XNode:= VSTPL.TopNode;
  21.          XNode := VSTPL.AddChild(VSTPL.TopNode);
  22.         end;
  23.         Data := VSTPL.GetNodeData(Xnode);
  24.         Data^.RItem := InttoStr(RxMPLNK.FieldByName('RxPlItem').AsInteger);
  25.         Data^.RQty  := RxMPLNK.FieldByName('RxPlQty').AsInteger;
  26.         Data^.RPart := RxMPLNK.FieldByName('RxPnpartnumber').AsString;
  27.         Data^.RCost := RxMPLNK.FieldByName('RxCurrentCost').AsFloat;
  28.         Data^.RDetail := RxMPLNK.FieldByName('RxDetail').AsString;
  29.         Data^.RTitle := RxMPLNK.FieldByName('RxTitle').AsString;
  30.         Data^.RType := RxMPLNK.FieldByName('RxPlType').AsString;
  31.         RxMPLNK.Next;
  32.      end;
  33.  
  34.  
  35.  
You can see root node not has value but childs has it...

eldonfsr

  • Sr. Member
  • ****
  • Posts: 337
Re: VST RootNode
« Reply #1 on: November 04, 2022, 12:54:42 am »
All exmples show to addchild node is that is selected but not programatically  llike array how we can the node

to insert a node using thsi procedure
VSTPL.InsertNode(VSTPL.FocusedNode,amInsertBefore);

but you see if is focused or selected but not VSTPL.Node[2]

we can get absolutepostiosn but not see some to access lika that ...

Has two option go TopNode or BottomNode first and last one but another address....


 

TinyPortal © 2005-2018