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
[email protected]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk

Reply via email to