LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Drag Over Event not firing properly in XControl

I have an XControl that contains a tree control.  In the Facade I am handling the Drag Over event for that tree.  When I run and drag something into the tree within the XControl the event doesn't fire (probes do not update, used conditional probes to stop on any condition).  So I naturally put a breakpoint into the event case within the facade to double check.  I have to drag something into the tree anywhere between 5 and 30 times before the breakpoint gets hit and then LabVIEW halts dead in its tracks and I have to CTL-ALT-DEL.  Is there a special trick to this?  Anyone have any thoughts?
CLA, CCVID, Certified Instructor
0 Kudos
Message 1 of 5
(2,775 Views)
Hi JS at ARC,
 
Is there anyway for you to post your exact code?
 
Kevin S.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 5
(2,755 Views)
Hi Js,
         Are you adding some delay of your own?
Message 3 of 5
(2,745 Views)
I decided to create an over-simplified example to demonstrate what is happening.  Open the TEST_DRAG vi and use the text tool to add a few tree items (peers).  Run the VI and open the facade block diagram from the block diagram of the calling VI.  Place a break point in the drag over event in the facade, then attempt to drag one of the tree items over one of the other tree items.  The breakpoint doesn't get hit.  If you drag something from an outside source (like the text in a URL bar in IE or FireFox)...the event still does not get hit, however the default tree behavior occurs, placing the URL text as a child item of the target tree item.

What am I missing?

Ultimately the goal is to allow the user to move predetermined tree items around within the XControl (certain tree items will have different effects on the other tree items they are dropped on, so I need to implement special cases for handling which item is dragged and which item is receiving the drop...also some drags will be blocked depending on source item and target item, hence overriding the drag over event).
CLA, CCVID, Certified Instructor
0 Kudos
Message 4 of 5
(2,733 Views)
If I create a VI, open your facade vi and put a break point in the Drag Over
case, then put the xctl on my front panel, I do get a break when I move
something into it.

Breakpoints aren't the best way to debug an XControl. I think I've noticed
what you are seeing a few times, but I can't seem to be able to reproduce
it.

To see if an event triggers, it's much easier to simply create a control and
wire it to the "time" of the event. Put the control somewhere in your
controls FP, and you can see it change.

Regards,

Wiebe.


0 Kudos
Message 5 of 5
(2,721 Views)