From 2cc0f481fa8d66be65d7fcd57bcb3fe9c5454e1f Mon Sep 17 00:00:00 2001 From: cxl Date: Thu, 27 Sep 2018 09:20:39 +0000 Subject: [PATCH] .upptst git-svn-id: svn://ultimatepp.org/upp/trunk@12311 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- upptst/DnDText/DnDText.upp | 9 +++++++++ upptst/DnDText/main.cpp | 26 ++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 upptst/DnDText/DnDText.upp create mode 100644 upptst/DnDText/main.cpp 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(); +}