diff --git a/reference/DragAndDropFiles/DragAndDropFiles.upp b/reference/DragAndDropFiles/DragAndDropFiles.upp deleted file mode 100644 index 78afc12a4..000000000 --- a/reference/DragAndDropFiles/DragAndDropFiles.upp +++ /dev/null @@ -1,9 +0,0 @@ -uses - CtrlLib; - -file - main.cpp; - -mainconfig - "" = "GUI SSE2"; - diff --git a/reference/DragAndDropFiles/main.cpp b/reference/DragAndDropFiles/main.cpp deleted file mode 100644 index 0f39d9cc1..000000000 --- a/reference/DragAndDropFiles/main.cpp +++ /dev/null @@ -1,19 +0,0 @@ -#include - -using namespace Upp; - -struct MyApp : TopWindow { - String path; - - virtual void Paint(Draw& w) { - w.DrawRect(GetSize(), SColorPaper()); - w.DrawText(10, 10, path); - } - - virtual void DragAndDrop(Point p, PasteClip& d); - -}; - -GUI_APP_MAIN -{ -} diff --git a/reference/DropFiles/DropFiles.upp b/reference/DropFiles/DropFiles.upp index dae7a4444..eb8970867 100644 --- a/reference/DropFiles/DropFiles.upp +++ b/reference/DropFiles/DropFiles.upp @@ -7,5 +7,6 @@ file main.cpp; mainconfig - "" = "GUI"; + "" = "GUI", + "" = "GUI X11"; diff --git a/reference/DropFiles/main.cpp b/reference/DropFiles/main.cpp index 260e4c1c6..bd23d02a0 100644 --- a/reference/DropFiles/main.cpp +++ b/reference/DropFiles/main.cpp @@ -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 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 data; + AppendFiles(data, files); + DoDragAndDrop(data, Null, DND_COPY); + } +} + DndTest::DndTest() { Title("I need files!");