From d274cabbe1c3ecccc143dab680f95cd06be36c3b Mon Sep 17 00:00:00 2001 From: cxl Date: Fri, 9 Apr 2021 07:16:31 +0000 Subject: [PATCH] .upptst git-svn-id: svn://ultimatepp.org/upp/trunk@15902 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- upptst/PenTest/PenTest.upp | 9 ----- upptst/PenTest/main.cpp | 68 -------------------------------------- 2 files changed, 77 deletions(-) delete mode 100644 upptst/PenTest/PenTest.upp delete mode 100644 upptst/PenTest/main.cpp diff --git a/upptst/PenTest/PenTest.upp b/upptst/PenTest/PenTest.upp deleted file mode 100644 index 5c4f53e15..000000000 --- a/upptst/PenTest/PenTest.upp +++ /dev/null @@ -1,9 +0,0 @@ -uses - CtrlLib; - -file - main.cpp; - -mainconfig - "" = "GUI"; - diff --git a/upptst/PenTest/main.cpp b/upptst/PenTest/main.cpp deleted file mode 100644 index 4a2f053d0..000000000 --- a/upptst/PenTest/main.cpp +++ /dev/null @@ -1,68 +0,0 @@ -#include - -using namespace Upp; - -struct MyApp : TopWindow { - Point pos; - - Vector>> drawing; - - PenInfo pen; - - virtual bool Pen(Point p, const PenInfo& pn, dword keyflags) { - if(keyflags&K_SHIFT) - return false; - if(pn.pressure) { - if((!!pn.pressure == !!pen.pressure) && drawing.GetCount()) - drawing.Top().Add(MakeTuple(pn.pressure, p)); - else - drawing.Add().Add(MakeTuple(pn.pressure, p)); - } - pen = pn; - Refresh(); - return true; - } - - void LeftDown(Point p, dword keyflags) override { - if(keyflags & K_SHIFT) { - RectTracker tracker(*this); - tracker.MinSize(Size(-100000,-100000)); - tracker.Track(Rect(p,p)); - } - } - - - virtual void Paint(Draw& w0) { - DrawPainter w(w0, GetSize()); - w.Co(); - w.Clear(SColorPaper()); - - w.LineCap(LINECAP_ROUND); - for(const auto& stroke : drawing) - if(stroke.GetCount()) - for(int i = 0; i < stroke.GetCount() - 1; i++) { - w.Move(stroke[i].b); - w.Line(stroke[i + 1].b); - w.Stroke(DPI(20) * stroke[i].a, Black()); - } - - int fcy = GetStdFontCy(); - int y = 10; - auto Text = [&] (const String& text) { - w.DrawText(10, y, text); - y += fcy; - }; - Text(AsString(pos)); - Text(String() << "Pressure: " << pen.pressure); - Text(String() << "Rotation: " << pen.rotation); - Text(String() << "Tilt: " << pen.tilt); - Text(String() << "Barrel: " << pen.barrel); - Text(String() << "Inverted: " << pen.inverted); - Text(String() << "Eraser: " << pen.eraser); // FIXED to IsPenEraserPressed() - } -}; - -GUI_APP_MAIN -{ - MyApp().Run(); -}