diff --git a/upptst/DnDText/DnDText.upp b/upptst/DnDText/DnDText.upp new file mode 100644 index 000000000..5872304d3 --- /dev/null +++ b/upptst/DnDText/DnDText.upp @@ -0,0 +1,9 @@ +uses + CtrlLib; + +file + main.cpp; + +mainconfig + "" = "GUI"; + diff --git a/upptst/DnDText/main.cpp b/upptst/DnDText/main.cpp new file mode 100644 index 000000000..f3e89329d --- /dev/null +++ b/upptst/DnDText/main.cpp @@ -0,0 +1,26 @@ +#include + +using namespace Upp; + +struct MyApp : TopWindow { + String text; + + void LeftDrag(Point, dword) { + VectorMap data; + Append(data, String("Hello world!")); + text = decode(DoDragAndDrop(data, CtrlImg::exclamation()), DND_MOVE, "MOVE", + DND_COPY, "COPY", + "NONE"); + Refresh(); + } + + void Paint(Draw& w) { + w.DrawRect(GetSize(), White()); + w.DrawText(10, 10, text, Arial(50)); + } +}; + +GUI_APP_MAIN +{ + MyApp().Run(); +}