git-svn-id: svn://ultimatepp.org/upp/trunk@14315 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2020-04-15 16:21:09 +00:00
parent b35a32cd24
commit 3ae4a64e1a
2 changed files with 37 additions and 0 deletions

View file

@ -0,0 +1,10 @@
uses
CtrlLib;
file
main.cpp;
mainconfig
"" = "GUI",
"" = "GUI X11";

View file

@ -0,0 +1,27 @@
#include <CtrlLib/CtrlLib.h>
using namespace Upp;
struct Widget : public Ctrl {
void Paint(Draw& w) {
w.DrawRect(GetSize(), LtCyan());
}
void MouseMove(Point p, dword) {
ViewDraw draw(this, p.x - 16, p.y - 16, 32, 32);
DrawPainter sw(draw, 32, 32);
sw.Clear(White());
sw.Move(0, 0).Line(31, 31);
sw.Move(0, 31).Line(31, 0);
sw.Stroke(5, Red());
}
};
GUI_APP_MAIN
{
TopWindow win;
Widget h;
win.Add(h.LeftPosZ(10, 300).TopPosZ(10, 300));
win.Run();
}