Aitor Solar Posted March 7, 2006 Report Share Posted March 7, 2006 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 Quote Link to comment
george seifert Posted March 7, 2006 Author Report Share Posted March 7, 2006 What else is necessary? I'm not sure if this is it, but do you have "Allow drop" checked in the Advanced menu for the control? Quote Link to comment
Aitor Solar Posted March 7, 2006 Report Share Posted March 7, 2006 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 . Saludos, Aitor Quote Link to comment
george seifert Posted March 7, 2006 Author Report Share Posted March 7, 2006 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 .Saludos, Aitor 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 Quote Link to comment
Aitor Solar Posted March 7, 2006 Report Share Posted March 7, 2006 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 . 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 . Saludos, Aitor Quote Link to comment
Adnan Posted March 7, 2006 Report Share Posted March 7, 2006 You can just associate "Value Change" event to the control path. It works well. See attach VI. Download File:post-1057-1141748574.vi Quote Link to comment
Jim Kring Posted March 7, 2006 Report Share Posted March 7, 2006 You can just associate "Value Change" event to the control path. It works well. See attach VI. I agree with Adnan. Use the Value Changed event for this. Quote Link to comment
Aitor Solar Posted March 8, 2006 Report Share Posted March 8, 2006 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 Quote Link to comment
crelf Posted March 8, 2006 Report Share Posted March 8, 2006 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 Quote Link to comment
Jim Kring Posted March 8, 2006 Report Share Posted March 8, 2006 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. Quote Link to comment
Rolf Kalbermatter Posted March 9, 2006 Report Share Posted March 9, 2006 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 Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.