Syncing uppdev

git-svn-id: svn://ultimatepp.org/upp/trunk@1716 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2009-11-23 08:26:16 +00:00
parent 0b1e185e26
commit c08e243fc7
5 changed files with 76 additions and 0 deletions

View file

@ -0,0 +1,6 @@
#ifndef _PainterLine_PainterLine_h
#define _PainterLine_PainterLine_h
#endif

View file

@ -0,0 +1,3 @@
LAYOUT(PainterLineLayout, 200, 100)
END_LAYOUT

View file

@ -0,0 +1,12 @@
uses
CtrlLib,
Painter;
file
PainterLine.h,
main.cpp,
PainterLine.lay;
mainconfig
"" = "GUI";

5
uppdev/PainterLine/init Normal file
View file

@ -0,0 +1,5 @@
#ifndef _PainterLine_icpp_init_stub
#define _PainterLine_icpp_init_stub
#include "CtrlLib/init"
#include "Painter/init"
#endif

View file

@ -0,0 +1,50 @@
#include <CtrlLib/CtrlLib.h>
#include <Painter/Painter.h>
using namespace Upp;
struct PainterLine : public TopWindow {
int wd;
Point tg;
virtual Image CursorImage(Point p, dword keyflags)
{
return Null;
}
virtual void LeftDown(Point p, dword keyflags) {
wd = wd + 1;
if(wd > 10)
wd = 0;
Refresh();
}
virtual void MouseMove(Point p, dword keyflags)
{
tg = p;
Refresh();
}
virtual void Paint(Draw& w) {
{
DrawPainter g(w, GetSize()/*, MODE_NOAA*/);
g.DrawRect(GetSize(), White());
g.DrawRect(100, 100, 200, 150, LtGray());
g.DrawLine(100, 100, tg.x, tg.y, wd);
}
w.Offset(0, 200);
w.DrawRect(100, 100, 200, 150, LtGray());
w.DrawLine(100, 100, tg.x, tg.y, wd);
w.End();
}
public:
typedef PainterLine CLASSNAME;
PainterLine() { wd = 0; }
};
GUI_APP_MAIN
{
PainterLine().Run();
}