Sends copies of items to another tree.
Syntax
rv = Send_Message(Ctrl, "OLE.SendItems":@FM:1, Items:@FM:DestCtrl:@FM:DestItem:@FM:Action:@FM:Animate:@FM:IncludeChildren)
Parameters
Parameter | Description |
---|---|
Items | The items to be sent |
DestCtrl | The destination tree control |
DestItem | The destingation item in the destination tree control |
Action | Determines whether the items are added to the destination, or inserted before or after it |
Animate | Determines whether or not the user will see the items travel to the new tree control |
IncludeChildren | Determines whether or not all children of the specified items are to be sent too |
Remarks
The SendItems method sends copies of items from this tree to another tree. In order for this method to work, you must be sure to set the CtrlEntId properties for all SRP Tree Controls. The Items parameter is an @VM delimited list of items you wish to send. The DestCtrl parameter is the CtrlEntId of the tree to which the items should be sent, and the DestItem parameter is the destination item within the destination tree to which the items will be added or before or after which the items will be inserted.
The Action parameter indicates how the items are sent. Set this parameter to "Add" if you want to add the items as children to the destination item. If you wish to insert the items instead, then set this parameter to "Before" or "After" to insert before the destination item or after the destination item respectively. If you want to place the items at the root level, then set DestItem to "" and Action to "Add".
The Animate parameter is a flag indicating whether or not an animation should occur. Setting this parameter to 1 will cause the items to appear, to the user, as if the items are flying from the source tree to the destination tree. Set this to 0 if you don't need the feedback or if either of the trees are not currently visible to the user.
The IncludeChildren parameter is a flag indicating whether or not the given items' children are to be sent as well. Set this to 1 to cause all the items' children to copy over with them or to 0 to send just the items listed.
Calling this method performs a copy, so the items will still exist in the source tree. If you wish to simulate a move, then follow this method with a call to the RemoveItems method.
If you need to send the items' parents along with the items themselves, use the TransferItems method instead.
Example
// Assume two trees with boys and girls organized into teams // Send the unassigned children to the green team in tree #2 Items = "Abigail":@VM:"Hailey":@VM:"Joshua":@VM:"Logan" // Since there are more than 4 parameters, we have to pass them in an array Params = "" Params<1> = Items ;// Items Params<2> = @Window:".OLE_TREE_2" ;// DestCtrl Params<3> = "GreenTeam" ;// DestItem Params<4> = "Add" ;// Action Params<5> = 1 ;// Animate Params<6> = 1 ;// IncludeChildren // Be sure to append the method name with @FM:1, since there are more than 4 parameters Send_Message(@Window:".OLE_TREE", "OLE.SendItems":@FM:1, Params) // Remove the items from this tree to simulate a move operation Send_Message(@Window:".OLE_TREE", "OLE.RemoveItems", Items)