Jump to content
Sign in to follow this  
Rav_Raven

drag and drop between two ListBox

Recommended Posts

Can anyone tell me which commands to use drag and drop an item from one listbox to another?

It is a script to transfer equipment between units ingame.

I'm using LbAdd and LbSetValue to extract items but I need the sequence of drag.

Thanks for your time.

Share this post


Link to post
Share on other sites

Yes Dr_Eyeball.

I tried to make them work but without success.

Strangely, (onLBDrag, onLBDragging and onLBDrop) are the only ones I could not run (and it appears that I need).

In the Wiki has not anyone used (just a reference surface).

The dialog box Gear in ArmA uses it, but I could not find the process.

drag.jpg

Edited by RAV_RAVEN

Share this post


Link to post
Share on other sites

To enable Drag&Drop add the following code to the list box:

canDrag = 1;

Now you're able to drag objects from the list.

To drop add a onLBDrop-eventhandler to the ctrl where you want to accept the drop.

It will return [ctrl, _x, _y, starter_IDC, [[entry name, entry value, entry data]]].

I couldn't get onLBDragging working, but that should be enough to get drag & drop working.

Nevertheless the system has a few problems: Drag is enabled for all items. You can't say that only items 1-3 are draggable, 4 not. Also you can't show that the target accept drops.

Edited by i0n0s

Share this post


Link to post
Share on other sites

i0n0s, you were right.

Thanks to your help I could make a decent drag & drop.

There are many limitations (as you indicate), but it is what it is.

Thank you very much.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×