0
Answered

drag drop items on run time

diego 8 years ago in Applications / i3 Pro updated by Ekaterina (head of support) 8 years ago 3

Is it possible to program drag & drop items on run time ? On windows, IOS or Android.

Could you send any example? I need to know the XY position of the mouse or touch.


Best regards

Answered

Hello
It is possible to DnD popups:


If you need some advanced JS with DnD of items on page please see this sample: http://www.iridiummobile.net/download/software/v3/interface_detail/advanced-graphic-capabilities/

(DnD of AV source to AV zone).

Thanks!!

This is that I'm looking for:

IR.AddListener(IR.EVENT_MOUSE_MOVE, Source_id, function(x, y) ...
IR.AddListener(IR.EVENT_TOUCH_MOVE, Source_id, function(x, y) ...
So, to the next time that I need documentation about the references funtions, Are there any document that explain it?

On wiki, http://dev.iridiummobile.net/GUI_API/en#IR.EVENT_MOUSE_MOVE ; I don't see this information.


Best regards

+1

Description updated, tnx!

You can get the coordinates of cursor when move the cursor with pressed left mouse button.

It works with mouse (IR.EVENT_MOUSE_MOVE) or finger (IR.EVENT_TOUCH_MOVE). The event starts from specified item. The coordinates stop changing when you release the button.


IR.AddListener(IR.EVENT_MOUSE_MOVE, IR.GetItem("Page 1").GetItem("Item 1"), function ()
{
    IR.Log(x + ":" + y); // new coordinates on move
});

In the " Advanced capabilities" sample it is used to change the coordinates of item (drag it).


var item = IR.GetItem("Page 1").GetItem("Item 1");

IR.AddListener(IR.EVENT_MOUSE_MOVE, item, function(x, y)
{
   //IR.Log(x+":"+y);
   item.X = x;
   item.Y = y;    
}); 

IR.AddListener(IR.EVENT_TOUCH_MOVE, item, function(x, y)
{
   //IR.Log(x+":"+y);
   item.X = x;
   item.Y = y;    
});