Rav_Raven 8 Posted April 19, 2009 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
dr_eyeball 16 Posted April 19, 2009 Not sure if you are already aware about the UI event handlers. LBDrag, LBDragging, LBDrop. Never seen anyone using them yet though. Share this post Link to post Share on other sites
Rav_Raven 8 Posted April 19, 2009 (edited) 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. Edited April 19, 2009 by RAV_RAVEN Share this post Link to post Share on other sites
i0n0s 0 Posted April 27, 2009 (edited) 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 April 27, 2009 by i0n0s Share this post Link to post Share on other sites
Rav_Raven 8 Posted May 1, 2009 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