tree widget feature request

"Christian Boulanger (Bibliograph Development)" <[email protected]> Mon, 24 Jan 2005 19:18:15 +0100
Newsgroups gmane.comp.windows.devel.netwindows
Message-ID <[email protected]>
Hi Alex,

I am using the tree widget together with the PEAR:Tree Class on the 
server-side and things work well except that I don't manage to move tree 
nodes around. I tried the following

(currObj : a nwTreeNode)

with(currObj.parent){
                    removeChildByIndex(prevPos);
                    addChild(currObj,newPos);
            }

and

with(currObj.parent){
                    addChild(currObj,newPos);
                    removeChildByIndex(prevPos);
            }

with no luck. Both times, the moved node is appended at the end of the 
tree.

I suggest to add the following methods:

to the tree node prototype

essential:
NWTELP.insertBefore( nWTreeNode source child object, nWTreeNode target 
child object)
NWTELP.moveByIndex(int source index, int  target index2)

optional:
NWTELP.moveDown(index or nodeObj )
NWTELP.moveUp(index or nodeObj )
NWTELP.insertAfter( nWTreeNode source child object, nWTreeNode target 
child object)

to the tree prototype

NWTP.insertBefore( nWTreeNode source object, nWTreeNode target object)
NWTP.insertAfter( nWTreeNode source object, nWTreeNode target object)
this should be more expensive since you have to find the node in the 
tree first.

Thanks,

Christian

_______________________________________________
The netWindows developers list: [email protected]
http://netwindows.org/mailman/listinfo/devel_netwindows.org