begin
  if grid.rowcount = 0 then

  begin
   For i := 0 to 1 do
   begin
   grid.rowcount:=grid.rowcount+1;
   with tmynode(treeedit[i]) do begin
    caption:= chr(65+i);
     for j := 0 to 2  do begin
     add(1,tmynode );
     items[j].caption:= 'A' ;  these items are not added to tmynode(treeedit[i])
    end;end; end; end; end


Regards
________________________________
De : Martin Schreiber <mse00...@gmail.com>
Envoyé : mercredi 25 juillet 2018 17:00
À : mseide-msegui-talk@lists.sourceforge.net
Objet : Re: [MSEide-MSEgui-talk] treeitemedit

On 07/25/2018 05:03 PM, mohamed hamza wrote:
> How  to add a child item to a parent item.
>
>
> In the msuniverse there are examples but with a known numbers of nodes.
>
> {
> with tmynode(treeedit[0]) do begin
>    caption:= 'AAAAA';
>    add(3,tmynode);
>    items[0].caption:= 'A0';
>    items[1].caption:= 'A1';
>    items[2].caption:= 'A2';
>   end; }
>
>
> I want to do
>
>
> with  tmynode [ nparent] do begin
>
>
> add child ?
>
I probably don't understand.
"
 ttreelistitem = class(tlistitem)
[...]
   procedure addchildren(const aitem: ttreelistitem);
                   //transfers children
   function add(const aitem: ttreelistitem): integer; overload;
                   //returns index, nil ignored
   procedure add(const aitems: treelistitemarty); overload;
   function add(const itemclass: treelistitemclassty = nil):
                                                 ttreelistitem; overload;
   procedure add(const acount: integer;
                            const itemclass: treelistitemclassty = nil;
                            const defaultstate: nodestatesty = []);
overload;
   procedure insert(aindex: integer; const aitem: ttreelistitem);
   procedure insert(const aitem: ttreelistitem; aindex: integer);
deprecated;
                               //use insert(aindex,aitem) above instead
"
are the add() possibilities of ttreelistitem.

"
   property count: integer read fcount;
"
returns the children count.

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
mseide-msegui-talk@lists.sourceforge.net
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
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk

Reply via email to