Jump to content

Recommended Posts

Hi all,

I must be doing something wrong. I want an event to control when the user drops an external file into a Path control.

So, I create an Event Structure and add an event case ("Drop") linked to the path control. I drag and drop the external files: the Path updates with the new file path, but the events doesn't trigger. What else is necessary?

:headbang:

Saludos,

Aitor

Link to post
Share on other sites
I'm not sure if this is it, but do you have "Allow drop" checked in the Advanced menu for the control?

Yes. In fact it's true by default for path controls. I don't know, maybe this event is just for inner LabVIEW drag'n'drop :wacko: .

Saludos,

Aitor

Link to post
Share on other sites
Yes. In fact it's true by default for path controls. I don't know, maybe this event is just for inner LabVIEW drag'n'drop :wacko: .

Saludos,

Aitor

:oops: Oh wait, I do know this one. I've been through this already trying to do the exact same thing. All drag and drop events only work within Labview. Doesn't seem too useful if you can't drag and drop from outside of Labview.

George

Link to post
Share on other sites
:oops: Oh wait, I do know this one. I've been through this already trying to do the exact same thing. All drag and drop events only work within Labview. Doesn't seem too useful if you can't drag and drop from outside of Labview.

Ok, thanks, you have saved me a lot of time trying :yes:. But it's still a pity we don't have an event for external drag'n'drop.

I'll forget that feature, then. Just thought it would be great to add that to the application in the LV8 version. In fact, what I had in mind was having a drag'n'drop event for all the pane, like Word, etc. But I guess that's even more impossible :wacko: .

Saludos,

Aitor

Link to post
Share on other sites
You can just associate "Value Change" event to the control path. It works well. See attach VI.

Yep, it's a good advice, thanks. In the end, I have emulated the pane behavior I was looking for by creating a transparent path control that covers all the FP. When VI is frontmost, the path control goes invisible, allowing the user to manipulate the rest of controls as usual. When VI is not frontmost, the path control goes visible and so it catches the files the user drag'n'drop from Windows.

Maybe not the cleanest solution, but it works.

Thanks everybody,

Aitor

Link to post
Share on other sites
Maybe not the cleanest solution, but it works.

That's quite a novel approach - well done! As long as it's well documented so the next developer that works on it isn't sctaching his/her head, then it sounds just fine to me :)

Link to post
Share on other sites
Yep, it's a good advice, thanks. In the end, I have emulated the pane behavior I was looking for by creating a transparent path control that covers all the FP. When VI is frontmost, the path control goes invisible, allowing the user to manipulate the rest of controls as usual. When VI is not frontmost, the path control goes visible and so it catches the files the user drag'n'drop from Windows.

Maybe not the cleanest solution, but it works.

Thanks everybody,

Aitor

Aitor: I've used this technique on several occasions -- it works very well.

Link to post
Share on other sites
:oops: Oh wait, I do know this one. I've been through this already trying to do the exact same thing. All drag and drop events only work within Labview. Doesn't seem too useful if you can't drag and drop from outside of Labview.

George

But drag and drop from outside of LabVIEW is a big pitta to do right. An applciation can provide whatever format it thinks is right for the data and the receiver can only try to ask for another format but essentially has to deal with what is provided and that means a lot of potential conversion types. Asking for the disk path only is rather useless for anything but a path control and asking for the real data can give text, and image, formatted data etc. etc and then it is a big task to figure out how to convert that data to something you could use.

Even more complex is the fact that Drag & Drop should work not just on Windows and with MS Office applications only but on MacOS, Linux and Windows with just about any applcation. This means that Drag & Drop events would need some multiplatform D&D manager in LabVIEW, which probably isn't fully there yet, and the D&D events will give you a somewhat complicated interface where you have to handle the recursive query of specific data formats until you get one that is provided by the data source and its conversion to something more suitable eventually.

Rolf Kalbermatter

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.