Drag from a TREE object

Find and share HowTos to various installations / configurations!
2 posts • Page 1 of 1
tmalone
Posts:192
Joined: Mon Nov 22, 2010 11:21 pm

Drag from a TREE object

Post by tmalone »

There seems to be a few examples of the DPTREE object, but the example from the help on Drag and Drop shows a tree object, but is very limited on the answer. This panel seems to have vanished from the product.

So, I am trying to build a tree object and drag from it to TextField objects.

Here is the init code for my TREE object:

main()
{
dyn_string dps, MCVariables;
int i, j;
string dp;

this.columnWidthMode(TREE_WIDTH_MAXIMUM);
this.acceptDrops(FALSE);
this.showDropIndicator(TRUE);
this.selectionBehavior("1");
this.selectionMode("Single");

dps = dpNames("*", "_MC_Datasource");

for(i=1; i<=dynlen(dps); i++)
{
dp = dpSubStr(dps, DPSUB_DP);

this.addColumn("Data Source/Variables");
this.appendItemNC("", dp, dp);
this.dragEnabled(dp);

dpGet(dps + ".Datapoints", MCVariables);
this.appendItems(dp, MCVariables, MCVariables);

for(j=1; j<=dynlen(MCVariables); j++)
{
this.dragEnabled(MCVariables[j]);
}
}
}

So, I have the required dragEnabled on the IDs.

DragStart event looks like:

main(int keys, string id)
{
DebugN("drag start", keys, id);

dragStart(id, "text_left.png", DRAG_COPY);
}

I get no drag start. There must be an example of this somewhere?

Todd Malone

tmalone
Posts:192
Joined: Mon Nov 22, 2010 11:21 pm

Re: Drag from a TREE object

Post by tmalone »

this.dragEnabled(dp); // is for reading the drag enabled property

this.setDragEnabled(dp, TRUE); // is to enable the property of dragging.

2 posts • Page 1 of 1