mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-21 06:45:39 -06:00
.upptst
git-svn-id: svn://ultimatepp.org/upp/trunk@14315 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
b35a32cd24
commit
3ae4a64e1a
2 changed files with 37 additions and 0 deletions
10
upptst/ViewDrawRect/ViewDrawRect.upp
Normal file
10
upptst/ViewDrawRect/ViewDrawRect.upp
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
uses
|
||||
CtrlLib;
|
||||
|
||||
file
|
||||
main.cpp;
|
||||
|
||||
mainconfig
|
||||
"" = "GUI",
|
||||
"" = "GUI X11";
|
||||
|
||||
27
upptst/ViewDrawRect/main.cpp
Normal file
27
upptst/ViewDrawRect/main.cpp
Normal 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();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue