drag and drop (DnD) with Ctrl-key pressed - move vs. copy

Hi,
I would like extend my program to respond differently when you are dragging a
file into the frame WHILE holding down the Ctrl key.
Under KDE on Linux it already looks like the keys does "something", because
a '+' appears next to the mouse pointer. In DnD-lingo I think this would be
called "switching from copy events to move events" !?
I'm using these lines in my program:
class MyFileDropTarget(wx.FileDropTarget):
   ...
dt = MyFileDropTarget(self)
frame.SetDropTarget(dt)

Is this possible and does someone have an example for it ? (I check the
wxPython Wiki ...)

Thanks,
Sebastian Haase

Sebastian,

On the wiki, there's a Drag and Drop example in the TreeCtrl page that I
wrote a couple of months ago. It claims not to work on Mac or Linux, but I
discovered yesterday that if you remove the EVT_ON_MOTION event from that
code, it runs on the Mac just fine and will probably work on Linux too.
(I'm cramming to be ready for conferences the next two weeks, so won't have
a chance to update the example for a while.)

Anyway, that code implements copy/move using the Ctrl key to signal. Please
note that that example does not move tree nodes, but produces output in the
terminal window that describes the results of copies and moves.

David

···

-----Original Message-----
From: Sebastian Haase [mailto:haase@msg.ucsf.edu]
Sent: Friday, April 09, 2004 4:27 PM
To: wxPython-users@lists.wxwidgets.org
Subject: [wxPython-users] drag and drop (DnD) with Ctrl-key pressed -
move vs. copy

Hi,
I would like extend my program to respond differently when you are dragging
a
file into the frame WHILE holding down the Ctrl key.
Under KDE on Linux it already looks like the keys does "something",
because
a '+' appears next to the mouse pointer. In DnD-lingo I think this would
be
called "switching from copy events to move events" !?
I'm using these lines in my program:
class MyFileDropTarget(wx.FileDropTarget):
   ...
dt = MyFileDropTarget(self)
frame.SetDropTarget(dt)

Is this possible and does someone have an example for it ? (I check the
wxPython Wiki ...)

Thanks,
Sebastian Haase

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org

Is this directly applicable for classes that are derived from
wx.FileDropTarget ? I thought the TreeCtrl case was much more complicated
than ''standard'' file DnD ...

Thanks for the answer,
Sebastian

···

On Friday 09 April 2004 02:41 pm, David Woods wrote:

Sebastian,

On the wiki, there's a Drag and Drop example in the TreeCtrl page that I
wrote a couple of months ago. It claims not to work on Mac or Linux, but I
discovered yesterday that if you remove the EVT_ON_MOTION event from that
code, it runs on the Mac just fine and will probably work on Linux too.
(I'm cramming to be ready for conferences the next two weeks, so won't have
a chance to update the example for a while.)

Anyway, that code implements copy/move using the Ctrl key to signal.
Please note that that example does not move tree nodes, but produces output
in the terminal window that describes the results of copies and moves.

David

-----Original Message-----
From: Sebastian Haase [mailto:haase@msg.ucsf.edu]
Sent: Friday, April 09, 2004 4:27 PM
To: wxPython-users@lists.wxwidgets.org
Subject: [wxPython-users] drag and drop (DnD) with Ctrl-key pressed -
move vs. copy

Hi,
I would like extend my program to respond differently when you are dragging
a
file into the frame WHILE holding down the Ctrl key.
Under KDE on Linux it already looks like the keys does "something",
because
a '+' appears next to the mouse pointer. In DnD-lingo I think this would
be
called "switching from copy events to move events" !?
I'm using these lines in my program:
class MyFileDropTarget(wx.FileDropTarget):
   ...
dt = MyFileDropTarget(self)
frame.SetDropTarget(dt)

Is this possible and does someone have an example for it ? (I check the
wxPython Wiki ...)

Thanks,
Sebastian Haase

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org

It might be a little more complicated, but it's not that difficult to
follow. I offer it only because it's an example that addresses your
question that I was familiar with.

Good luck

David

···

-----Original Message-----
From: Sebastian Haase [mailto:haase@msg.ucsf.edu]
Sent: Friday, April 09, 2004 5:32 PM
To: wxPython-users@lists.wxwidgets.org
Subject: Re: [wxPython-users] drag and drop (DnD) with Ctrl-key pressed
- move vs. copy

Is this directly applicable for classes that are derived from
wx.FileDropTarget ? I thought the TreeCtrl case was much more complicated
than ''standard'' file DnD ...

Thanks for the answer,
Sebastian

On Friday 09 April 2004 02:41 pm, David Woods wrote:

Sebastian,

On the wiki, there's a Drag and Drop example in the TreeCtrl page that I
wrote a couple of months ago. It claims not to work on Mac or Linux, but

I

discovered yesterday that if you remove the EVT_ON_MOTION event from that
code, it runs on the Mac just fine and will probably work on Linux too.
(I'm cramming to be ready for conferences the next two weeks, so won't

have

a chance to update the example for a while.)

Anyway, that code implements copy/move using the Ctrl key to signal.
Please note that that example does not move tree nodes, but produces

output

in the terminal window that describes the results of copies and moves.

David

-----Original Message-----
From: Sebastian Haase [mailto:haase@msg.ucsf.edu]
Sent: Friday, April 09, 2004 4:27 PM
To: wxPython-users@lists.wxwidgets.org
Subject: [wxPython-users] drag and drop (DnD) with Ctrl-key pressed -
move vs. copy

Hi,
I would like extend my program to respond differently when you are

dragging

a
file into the frame WHILE holding down the Ctrl key.
Under KDE on Linux it already looks like the keys does "something",
because
a '+' appears next to the mouse pointer. In DnD-lingo I think this would
be
called "switching from copy events to move events" !?
I'm using these lines in my program:
class MyFileDropTarget(wx.FileDropTarget):
   ...
dt = MyFileDropTarget(self)
frame.SetDropTarget(dt)

Is this possible and does someone have an example for it ? (I check the
wxPython Wiki ...)

Thanks,
Sebastian Haase

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org