Hi Martin,

 I read msedatanodes.pas to find any method to give current node in the tree 
without success.


I tried

grid.rowcount:=1;
node:=tmynode(treeedit[0]);
tmynode(treeedit[0]).caption:='ROOT';

current:=node.add(tmynode);
current.caption:='A1.'+inttostr(current.treelevel);
node:=current.add(tmynode);
node.caption:='A2.'+inttostr(node.treelevel);

In that way I got the tree:

   +ROOT

       +A1.1

          A2.2
Is there a simplest way? I tried with addchildren  ( current.addchildren( 
tmynode) no success.

the problem gets more complicated  when I used addchildren to specific node 
because it is in a previous level ?

for example :

before doing  c.addchildren(b)   do I have to search the parent

while    .......
  node:=node.parent;


I have never used tree object specially with mseIde.

I studied the examples  in mseuniverse sources. I learned the basic. But now I 
want to write something to save and restore
a tree from db file.

Regards.








________________________________
De : Martin Schreiber <[email protected]>
Envoyé : vendredi 27 juillet 2018 20:18
À : [email protected]
Objet : Re: [MSEide-MSEgui-talk] treeitemedit

On 07/27/2018 11:18 AM, mohamed hamza wrote:
> I did not find a property level of a node. Do you think we do not need it?
>
Please use
"
 ttreelistitem = class(tlistitem)
[...]
   property treelevel: integer read ftreelevel;
"

Martin

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk

Reply via email to