Drag'n'drop between apps
Posted: Fri Aug 16, 2013 9:07 pm
Currently it is possible to drag icons from WB to an app (using AppWIndows, AppIcons etc), and sort-of possible to drag things from applications to WB using manual icon dragging creation and WhichWorkbenchObject(). However, it is not possible to drag directly from one application to another.
I would like to see:
* An extension to the current AppWindow/AppMessage interface so an application can send an AppMessage direct to another application, with a file attached. Implementation-wise, this might involve a temporary file unless the application being dragged to is "ExtendedAppMessage-aware".
* Visible icon dragging via an easy icon.library function on any screen - exactly the same as Workbench does it, but accessible from an application by calling a function and passing a DiskObject.
* Ideally, these two things should be tied together, so when the mouse button is released, the OS sees where the icon was dropped, passing it back to the application to then send the appropriate message (ideally through an easy SendAppMessage function - I can see a timing issue here, so if the data is ready to go and the icon dragging function can immediately pass the message, that would probably be better)
* WB itself should support AppWindows and AppMessages for drawers so files can be dragged to WB without the WhichWorkbenchObject kludge.
* This system should also be able to support clipboard text, images and other objects. I can see two ways of doing this - either (a) use a reserved clipboard unit and signal a paste or open from clipboard operation through the ExtendedAppMessage, or (b) treat this data exactly the same as a file, and let the destination application decide whether it needs to be copied directly in, or loaded like a file. I think (b) is probably better, as that is what is done currently with AppWindows.
I would like to see:
* An extension to the current AppWindow/AppMessage interface so an application can send an AppMessage direct to another application, with a file attached. Implementation-wise, this might involve a temporary file unless the application being dragged to is "ExtendedAppMessage-aware".
* Visible icon dragging via an easy icon.library function on any screen - exactly the same as Workbench does it, but accessible from an application by calling a function and passing a DiskObject.
* Ideally, these two things should be tied together, so when the mouse button is released, the OS sees where the icon was dropped, passing it back to the application to then send the appropriate message (ideally through an easy SendAppMessage function - I can see a timing issue here, so if the data is ready to go and the icon dragging function can immediately pass the message, that would probably be better)
* WB itself should support AppWindows and AppMessages for drawers so files can be dragged to WB without the WhichWorkbenchObject kludge.
* This system should also be able to support clipboard text, images and other objects. I can see two ways of doing this - either (a) use a reserved clipboard unit and signal a paste or open from clipboard operation through the ExtendedAppMessage, or (b) treat this data exactly the same as a file, and let the destination application decide whether it needs to be copied directly in, or loaded like a file. I think (b) is probably better, as that is what is done currently with AppWindows.