On 09.09.2012 15:27, guyingpinming wrote:
> Thank you for your work,Matthias!
> I have tried running a program on my WindowsXP,the events work!So,maybe the 
> sentence is wrong.But I still need to point out that the events work do not 
> means it can work anywhere inside the window,if there is a widget inside the 
> window and you drag a file into it and then release the file,our window won't 
> be able to receive event FL_DND_RELEASE(event FL_DND_ENTER and FL_DND_DRAG 
> work as well as the former case),thus it cannot receive event FL_PASTE and 
> the event data.
> Now,I am trying to find a way out to solve the problem,I think maybe we can 
> make the widget send an event message to its parent window and then our 
> window can process the event.That's my raw idea,I need more time to make an 
> attempt.If anybody who knows how to solve the problem,please tell me,thanks.
> ----guyingpinming

What you describe seems to be normal FLTK behavior, but we can
only know exactly if we see your code. If possible, please post
a small, but full example code that shows the problem, but please
read further first.

If your widgets inside the window respond to certain events by
returning 1, then they will get the related FL_DND_* event(s)
as well, if the dragging operation moves the cursor over the
widgets. So the task to do would be to /deny/ FL_DND_* events
by returning 0 for some events, probably FL_DND_ENTER and more.
Please see the docs, this is off the top of my head. The visible
clue should be that the cursor does not change to DND drop mode,
i.e. it doesn't show a '+' or other additional mark when it is
above the other widgets inside your window.

That said, FLTK text widgets enable DND, so if you want to
disable this for widgets in your window, you'd probably need to
subclass them and use your class's handle() method to return 0
on FL_DND_ENTER and maybe others. If you did this, and maybe also
derived your own window class that handles the event(s) properly,
then FLTK would send the events to your window class and not to
the particular widgets you may see them sent to now.

I hope this is clear enough for you to see what to do. If this
doesn't work as expected, please post example code as requested
above, or ask here again.

To Matt: personally, I'd say that the docs are wrong, and maybe
the described scenario was the reason Duncan (Engelsman) thought
it wouldn't work, but I can't tell positively /that/ it works
with window and group classes.

Albrecht

_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to