mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-08-25 14:22:54 -06:00
reference: DropFiles
git-svn-id: svn://ultimatepp.org/upp/trunk@7428 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
7d67270fb0
commit
d5ed2ccd73
4 changed files with 16 additions and 30 deletions
|
|
@ -6,6 +6,8 @@ struct DndTest : public TopWindow {
|
|||
virtual void Paint(Draw &w);
|
||||
virtual void DragAndDrop(Point p, PasteClip& d);
|
||||
virtual bool Key(dword key, int count);
|
||||
virtual void LeftDrag(Point p, dword keyflags);
|
||||
|
||||
Vector<String> files;
|
||||
|
||||
DndTest();
|
||||
|
|
@ -23,7 +25,9 @@ void DndTest::Paint(Draw &w)
|
|||
|
||||
void DndTest::DragAndDrop(Point p, PasteClip& d)
|
||||
{
|
||||
if (AcceptFiles(d)) {
|
||||
if(IsDragAndDropSource())
|
||||
return;
|
||||
if(AcceptFiles(d)) {
|
||||
files = GetFiles(d);
|
||||
Refresh();
|
||||
}
|
||||
|
|
@ -39,6 +43,15 @@ bool DndTest::Key(dword key, int count)
|
|||
return false;
|
||||
}
|
||||
|
||||
void DndTest::LeftDrag(Point p, dword keyflags)
|
||||
{
|
||||
if(files.GetCount()) {
|
||||
VectorMap<String, ClipData> data;
|
||||
AppendFiles(data, files);
|
||||
DoDragAndDrop(data, Null, DND_COPY);
|
||||
}
|
||||
}
|
||||
|
||||
DndTest::DndTest()
|
||||
{
|
||||
Title("I need files!");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue