Drag and Drop from Palette Window
Posted: Thu Apr 16, 2020 7:36 pm
Hi, I have been looking for ways to emulate the behavior of the IDE tool palette, where you can drag and drop a control onto your stack. I am not looking for code examples, just a general approach to how it is done. When I peruse the revTools stack script, there is a lot going on there I appreciate but just barely follow. However, I have gleaned a few things and want to know if I'm on the right track:
PseudoCode
Check if mouse is down in your Palette stack over a control
Allow for some threshold movement tracking when the mouse enters a control
Create a temporary stack with a window shape that is derived from the control shape
Optionally, set the blend level of the the temp stack while it is being dragged (if you want it to be "ghosted" during drag)
If the mouse is released while the temp stack is in the window of the main stack, then delete the temp stack that is being dragged and...
Lastly, create the new control at the location where the mouse is released.
One of my favorite early hypercard stacks was PippinPuss. I have recreated it in LiveCode completely, but would like to move the grid of face components into a palette...hence my question.
PseudoCode
Check if mouse is down in your Palette stack over a control
Allow for some threshold movement tracking when the mouse enters a control
Create a temporary stack with a window shape that is derived from the control shape
Optionally, set the blend level of the the temp stack while it is being dragged (if you want it to be "ghosted" during drag)
If the mouse is released while the temp stack is in the window of the main stack, then delete the temp stack that is being dragged and...
Lastly, create the new control at the location where the mouse is released.
One of my favorite early hypercard stacks was PippinPuss. I have recreated it in LiveCode completely, but would like to move the grid of face components into a palette...hence my question.