FLTK DnD support works quite reliably in FLTK. You have to derive your
own widget and respond to FL_DND_ENTER, FL_DND_LEAVE and FL_DND_RELEASE
as well as FL_PASTE:
to be more concrete:
class mywidget: public Fl_Box
{
public:
mywidget(int X, int Y, int W, int H, const char*
L=""):Fl_Box(X,Y,W,H,L) {}
int handle(int e)
{ switch(e)
{ case FL_DND_ENTER: {/*do something on enter*/ return(1);} break;
case FL_DND_LEAVE: {/*do something on leave*/ return(1);} break;
case FL_DND_DRAG: {/*do something while user is dragging mouse
with dnd data inside the widget*/ return(1);} break;
case FL_DND_RELEASE: {/*accept dropping -> results will be
pasted as an FL_PASTE event*/ return(1);} break;
case FL_PASTE: {/* here is the dnd-data in Fl::event_text() and
its length Fl::event_length() */ return(1);} break;
default: return(Fl_Box::handle(e));
}
}
};
You will find more information on events at
http://www.fltk.org/doc-1.3/events.html
I hope this helps.
Cheers,
Herman
On 09/01/2012 03:18 AM, guyingpinming wrote:
> I'm working with a project using fltk to construct a gui,but now I want
> the exe to support the operation of dropping files,that is,if I drop a file
> to the menuWindow,the software can automatically open the file with the right
> format(the file itself is support by the software).
> How can I manage to realize it?It's like enable a window with the
> property of Accept Files and response to the Message WM_DROPFILES.I wonder
> wether it's realible for fltk to support that.
> Thanks a lot for your replies.
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk