Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Drag image?

6 views
Skip to first unread message

-JM

unread,
Nov 6, 2007, 11:11:19 AM11/6/07
to
I'd like to have an image of what's being dragged attached to the
cursor while dragging "stuff" between Finder/Explorer and my wx-based
application. Is there a wx-supported way of displaying a drag image
during a drag within/to/from other apps (e.g., Finder/Explorer) so
that it interacts properly (and automatically) with the OS' drag
manager? I've found wxDragImage, which sounds promising, but doesn't
do what I want (and seem to require a lot of hand-holding with Hide/
Move/Show, etc).

It appears that both Windows and MacOS has native support for this
feature, and I figured a comprehensive framework such as wx ought to
have some built-in support for this common feature. Hopefully I'm
just missing something obvious?

-JM


---------------------------------------------------------------------
To unsubscribe, e-mail: wx-users-u...@lists.wxwidgets.org
For additional commands, e-mail: wx-use...@lists.wxwidgets.org

Manfred Hanke

unread,
Nov 6, 2007, 1:15:01 PM11/6/07
to
Hi all,

I have the same problem for drag/drop
I use my own implementation for window, I try later to use the OSX way...

in MSW you need to use "IDragSourceHelper"
IDragSourceHelper* pDragSourceHelper;
pDragSourceHelper->InitializeFromBitmat
pDragSourceHelper->InitializeFromWindow

I hope this will be implemented in the next version of wxWidget :)

Manfred

"-JM" <j...@apostle.se> a écrit dans le message de news:
C2C1F9B7-F3D5-4DD8...@apostle.se...

Vadim Zeitlin

unread,
Nov 6, 2007, 1:52:43 PM11/6/07
to
On Tue, 6 Nov 2007 19:15:01 +0100 Manfred Hanke <ann...@free.fr> wrote:

MH> I have the same problem for drag/drop
MH> I use my own implementation for window, I try later to use the OSX way...
MH>
MH> in MSW you need to use "IDragSourceHelper"
MH> IDragSourceHelper* pDragSourceHelper;
MH> pDragSourceHelper->InitializeFromBitmat
MH> pDragSourceHelper->InitializeFromWindow
MH>
MH> I hope this will be implemented in the next version of wxWidget :)

Why not contribute your code as a patch for a start? It shouldn't be
difficult to modify the code in src/msw/ole/drop*.cpp.

And to answer the OP, for now you can create custom cursors and use them
in wxDropSource ctor.

Regards,
VZ

--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/

Manfred Hanke

unread,
Nov 6, 2007, 2:41:08 PM11/6/07
to
Yes it's possible to integrate my code with the drag and drop
implementation of wxWidget.
But it's not the case yet, I need to... OSX also.

Changing cursor is well, but an image or a part of window/screen is realy
good and this is a complement to...


"Vadim Zeitlin" <va...@wxwidgets.org> a écrit dans le message de news:
8-6O7B.A....@brage.sunsite.dk...

-JM

unread,
Nov 7, 2007, 4:54:10 PM11/7/07
to
On 7 Nov 2007, at 20:31, Vadim wrote:

> Why not contribute your code as a patch for a start? It shouldn't be
> difficult to modify the code in src/msw/ole/drop*.cpp.

Yes, I could probably put something together myself that could work
under Windows. However, considering that wx has been around for quite
some time, I just assumed that this common feature (which has been
available on Windows and MacOS for many years) was already supported
by wx DnD.

Since this drag image stuff works in very different ways under MacOS
and Windows, it would be nice if it could be handled through wx in a
cross platform manner. Preferably, all I'd have to do is provide a
wxImage and a "hot spot" when I initiate the drag from my app.
Likewise, any image provided from the outside would be drawn
automatically by wx while over one of my apps windows.

> And to answer the OP, for now you can create custom cursors and use
> them
> in wxDropSource ctor.

That probably won't help me show drag images when dragging stuff in
from Windows Explorer or other applications. Here I assume I need to
use the proper OLE mechanism. Ditto for supporting drags out of my
app to other apps I assume.

-JM

0 new messages