I’ve successfully in the past created apps that have a wx.FileDropTarget that accepts files through drag and drop, and custom drag and drop targets from wx.PyDropTarget`.
I’m trying to create an app that has a single control (wx.ListCtrl) that accepts files to be dropped from the file system, and also allows a custom drag and drop so the user is able to reorder the list, after dropping files in.
As far as I’m aware you can only set one drop target on a control, I’ve tried using multiple inheritance to make a class that inherits from both wx.PyDropTarget and wx.FileDropTarget but this doesn’t seem to work (neither type of drop works).
Might I suggest combining the last example from Mike Driscoll’s blog post with: http://wiki.wxpython.org/ListControls#Drag_and_Drop_with_a_striped_drag_list
I don’t have access to my dev computer at the moment to test any sample code at the moment but will definitely work on something to post here when I have the chance.
···
On Thursday, March 13, 2014 7:25:07 AM UTC-4, Paul wrote:
I’ve successfully in the past created apps that have a wx.FileDropTarget that accepts files through drag and drop, and custom drag and drop targets from wx.PyDropTarget`.
I’m trying to create an app that has a single control (wx.ListCtrl) that accepts files to be dropped from the file system, and also allows a custom drag and drop so the user is able to reorder the list, after dropping files in.
As far as I’m aware you can only set one drop target on a control, I’ve tried using multiple inheritance to make a class that inherits from both wx.PyDropTarget and wx.FileDropTarget but this doesn’t seem to work (neither type of drop works).
Managed to create a small example combining Mike Driscoll’s ObjectListView drag’ndrop example with the example listed in the link I provided above. I have
On Thursday, March 13, 2014 10:07:29 AM UTC-4, Mike Stover wrote:
Might I suggest combining the last example from Mike Driscoll’s blog post with: http://wiki.wxpython.org/ListControls#Drag_and_Drop_with_a_striped_drag_list
I don’t have access to my dev computer at the moment to test any sample code at the moment but will definitely work on something to post here when I have the chance.
On Thursday, March 13, 2014 7:25:07 AM UTC-4, Paul wrote:
I’ve successfully in the past created apps that have a wx.FileDropTarget that accepts files through drag and drop, and custom drag and drop targets from wx.PyDropTarget`.
I’m trying to create an app that has a single control (wx.ListCtrl) that accepts files to be dropped from the file system, and also allows a custom drag and drop so the user is able to reorder the list, after dropping files in.
As far as I’m aware you can only set one drop target on a control, I’ve tried using multiple inheritance to make a class that inherits from both wx.PyDropTarget and wx.FileDropTarget but this doesn’t seem to work (neither type of drop works).
You can create a wx.DataObjectComposite as shown here:
I did it when I created a “converter” that could accept dragged text
or filenames as input.
Works fine.
···
On 3/13/2014 7:25 AM, Paul Wiseman
wrote:
I’ve successfully in the past created apps that have a wx.FileDropTarget that
accepts files through drag and drop, and custom drag and drop
targets from wx.PyDropTarget`.
I’m trying to create an app that has a single control (wx.ListCtrl )
that accepts files to be dropped from the file system, and
also allows a custom drag and drop so the user is able to
reorder the list, after dropping files in.
As far as I'm aware you can only set one drop target on a
control, I’ve tried using multiple inheritance to make a class
that inherits from both wx.PyDropTarget and wx.FileDropTarget but
this doesn’t seem to work (neither type of drop works).
Does any know if this is possible?
–
You received this message because you are subscribed to the Google
Groups “wxPython-users” group.
To unsubscribe from this group and stop receiving emails from it,
Note that OLV is MSWindows only, so if you are looking for cross platform the attached sample you whipped up could be modified to a regular ListCtrl or VirtualList, etc.
I have a collection of oddball dragdrop target classes I use for my SourceCoder, one of which accepts just about any file type, sorts them all out into catagories options in a checklistbox setup like a rearrangeCtrl from the newer wxVersions, and also uses it’s own class to allow adding to the lists if more files are dropped on it while it is still open and supports drag rearranging along with button options.
So basically in a nutshell, what you need to do is parse the dropped stuff for the drop target catagories you need to handle and send each type to whatever function you want to handle them in.
Other than basic Text and File Drop targets, you pretty much have to write all the custom glue code yourself. The wiki has some different examples floating around for various widgets that are easily modded for your various purposes.
···
On Thursday, March 13, 2014 10:11:54 AM UTC-5, Mike Stover wrote:
Managed to create a small example combining Mike Driscoll’s ObjectListView drag’ndrop example with the example listed in the link I provided above. I have
On Thursday, March 13, 2014 10:07:29 AM UTC-4, Mike Stover wrote:
Might I suggest combining the last example from Mike Driscoll’s blog post with: http://wiki.wxpython.org/ListControls#Drag_and_Drop_with_a_striped_drag_list
I don’t have access to my dev computer at the moment to test any sample code at the moment but will definitely work on something to post here when I have the chance.
On Thursday, March 13, 2014 7:25:07 AM UTC-4, Paul wrote:
I’ve successfully in the past created apps that have a wx.FileDropTarget that accepts files through drag and drop, and custom drag and drop targets from wx.PyDropTarget`.
I’m trying to create an app that has a single control (wx.ListCtrl) that accepts files to be dropped from the file system, and also allows a custom drag and drop so the user is able to reorder the list, after dropping files in.
As far as I’m aware you can only set one drop target on a control, I’ve tried using multiple inheritance to make a class that inherits from both wx.PyDropTarget and wx.FileDropTarget but this doesn’t seem to work (neither type of drop works).
OLV is not MS Windows only. It works fine for me on Linux. It’s just a wrapper on top of the wx.ListCtrl, so it should work on all platforms. I do not have a Mac, so I can’t test there.
Mike
···
On Friday, March 14, 2014 6:45:59 PM UTC-5, Metallicow wrote:
Note that OLV is MSWindows only, so if you are looking for cross platform the attached sample you whipped up could be modified to a regular ListCtrl or VirtualList, etc.
Can definitely confirm that it works on Mac, have a media library app that uses OLV to display a list of various media files on my Linux server, and tested it on Mac OSX 10.5.8 recently. The app was a little buggy, but that was more due to my coding than anything.
···
On Monday, March 17, 2014 9:35:53 AM UTC-4, Mike Driscoll wrote:
On Friday, March 14, 2014 6:45:59 PM UTC-5, Metallicow wrote:
Note that OLV is MSWindows only, so if you are looking for cross platform the attached sample you whipped up could be modified to a regular ListCtrl or VirtualList, etc.
OLV is not MS Windows only. It works fine for me on Linux. It’s just a wrapper on top of the wx.ListCtrl, so it should work on all platforms. I do not have a Mac, so I can’t test there.
Hmmm it isn’t?, Ok, I guess I’ll have to look into that again. I must have been mistaken. I recall when I tested it initially on linux, that there was some issues or wasn’t working as I expected. Maybe I had introduced a typo or something in my code it didn’t like…
I guess I should have tested the included demos also. Tho I wouldn’t recall the version no. Just checked and I see the site version is this Version 2.7.0 (2014/02/26) which is recently updated so I’ll try again fiddling with that.
Whatever version I was using was definitely older than that at the time. Maybe it was a un-bugfix version I happened to get my hands on.
Nice to know it works on mac also. Thanks.
···
On Monday, March 17, 2014 8:35:53 AM UTC-5, Mike Driscoll wrote:
On Friday, March 14, 2014 6:45:59 PM UTC-5, Metallicow wrote:
Note that OLV is MSWindows only, so if you are looking for cross platform the attached sample you whipped up could be modified to a regular ListCtrl or VirtualList, etc.
OLV is not MS Windows only. It works fine for me on Linux. It’s just a wrapper on top of the wx.ListCtrl, so it should work on all platforms. I do not have a Mac, so I can’t test there.
Managed to create a small example combining Mike Driscoll's ObjectListView
drag'ndrop example with the example listed in the link I provided above. I
have
Awesome Was able to get it working using this example. Many Thanks!!
···
On 13 March 2014 16:11, Mike Stover <hakugin.gin@gmail.com> wrote:
On Thursday, March 13, 2014 10:07:29 AM UTC-4, Mike Stover wrote:
Might I suggest combining the last example from Mike Driscoll's blog post
with: http://wiki.wxpython.org/ListControls#Drag_and_
Drop_with_a_striped_drag_list
I don't have access to my dev computer at the moment to test any sample
code at the moment but will definitely work on something to post here when
I have the chance.
On Thursday, March 13, 2014 7:25:07 AM UTC-4, Paul wrote:
I've successfully in the past created apps that have a wx.FileDropTarget that
accepts files through drag and drop, and custom drag and drop targets from
wx.PyDropTarget`.
I'm trying to create an app that has a single control (wx.ListCtrl)
that accepts files to be dropped from the file system, and also allows a
custom drag and drop so the user is able to reorder the list, after
dropping files in.
There's examples of different uses of drag and drop here ( http://www.blog.pythonlibrary.org/2012/06/20/
wxpython-introduction-to-drag-and-drop/), all the examples work well
individually however I've been unsuccessful at trying to get any working
together.
As far as I'm aware you can only set one drop target on a control, I've
tried using multiple inheritance to make a class that inherits from both
wx.PyDropTarget and wx.FileDropTarget but this doesn't seem to work
(neither type of drop works).
Does any know if this is possible?
--
You received this message because you are subscribed to the Google Groups
"wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to wxpython-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Managed to create a small example combining Mike Driscoll’s ObjectListView drag’ndrop example with the example listed in the link I provided above. I have
Awesome Was able to get it working using this example. Many Thanks!!
On Thursday, March 13, 2014 10:07:29 AM UTC-4, Mike Stover wrote:
Might I suggest combining the last example from Mike Driscoll’s blog post with: http://wiki.wxpython.org/ListControls#Drag_and_Drop_with_a_striped_drag_list
I don’t have access to my dev computer at the moment to test any sample code at the moment but will definitely work on something to post here when I have the chance.
On Thursday, March 13, 2014 7:25:07 AM UTC-4, Paul wrote:
I’ve successfully in the past created apps that have a wx.FileDropTarget that accepts files through drag and drop, and custom drag and drop targets from wx.PyDropTarget`.
I’m trying to create an app that has a single control (wx.ListCtrl) that accepts files to be dropped from the file system, and also allows a custom drag and drop so the user is able to reorder the list, after dropping files in.
As far as I’m aware you can only set one drop target on a control, I’ve tried using multiple inheritance to make a class that inherits from both wx.PyDropTarget and wx.FileDropTarget but this doesn’t seem to work (neither type of drop works).
Does any know if this is possible?
–
You received this message because you are subscribed to the Google Groups “wxPython-users” group.