10-09-2012 11:23 AM
LV 2010.0
Take a look at this JING: http://screencast.com/t/k5AeQivM2
I'm a newbie at drag-and-drop stuff in LabVIEW.
In this case, the SOURCE is the cluster on the left that has a parameter selector and a cylinder selector.
The target is the Listbox.
I'm basing my code on the DnD examples.
A MOUSE DOWN event on the cluster causes me to set a flag.
A MOUSE UP event on the cluster causes me to clear that flag.
A MOUSE LEAVE event on the cluster causes me to check the flag.
If set, then I read the PARAM selector and CYL selector, generate some private records, package them up and START DRAG with the cluster as the source.
If not set, I do nothing.
A DRAG ENTER and DRAG OVER on the preview cause me to look at the data type and adjust the symbols in the listbox.
A DROP on one of the symbols causes me to take the drag data and insert into the table.
This works, but not ALWAYS.
Notice the HISTORY on the right.
Sometimes I get the MOUSE DOWN, but NOT the MOUSE LEAVE.
It seems to be related to how fast I move the mouse.
In the video, the mouse should leave the CYL SELECTOR, leave the CLUSTER (which should trigger the drag start but doesn't always), leave the TAB control, then enter the LISTBOX.
What could cause it to miss the MOUSE LEAVE event?
More to the point, how do I fix that?
Blog for (mostly LabVIEW) programmers: Tips And Tricks
10-09-2012 12:04 PM
Here's another JING: http://screencast.com/t/QEUEQ7kR8E
This is a different tab as the SOURCE, but the same idea.
I detect a MOUSE DOWN on the cluster and a MOUSE LEAVE.
When the mouse LEAVES, I start the drag.
In this case, one of the items is a cluster of checkboxes.
I don't seem to have trouble if I drag the checkbox over, but if I drag the listbox too fast, it again misses the MOUSE LEAVE event.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
10-09-2012 01:14 PM
Here's yet another JING: http://screencast.com/t/SeYYeR6Rte
I had put a boolean in the cluster as a sort of guide for the user: "DRAG THIS".
In fact, if you drag that thing, it works. EVERY TIME.
But why doesn't it work every time if you drag from the Selector?
I've tried increasing the space between the tab border and the MC List box - no improvement.
I've tried increasing the space between the cluster border and the tab border - no improvement.
It works if I drag the dummy boolean.
Why?
Blog for (mostly LabVIEW) programmers: Tips And Tricks