mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
Syncing uppdev
git-svn-id: svn://ultimatepp.org/upp/trunk@1716 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
0b1e185e26
commit
c08e243fc7
5 changed files with 76 additions and 0 deletions
6
uppdev/PainterLine/PainterLine.h
Normal file
6
uppdev/PainterLine/PainterLine.h
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
#ifndef _PainterLine_PainterLine_h
|
||||
#define _PainterLine_PainterLine_h
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
3
uppdev/PainterLine/PainterLine.lay
Normal file
3
uppdev/PainterLine/PainterLine.lay
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
LAYOUT(PainterLineLayout, 200, 100)
|
||||
END_LAYOUT
|
||||
|
||||
12
uppdev/PainterLine/PainterLine.upp
Normal file
12
uppdev/PainterLine/PainterLine.upp
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
uses
|
||||
CtrlLib,
|
||||
Painter;
|
||||
|
||||
file
|
||||
PainterLine.h,
|
||||
main.cpp,
|
||||
PainterLine.lay;
|
||||
|
||||
mainconfig
|
||||
"" = "GUI";
|
||||
|
||||
5
uppdev/PainterLine/init
Normal file
5
uppdev/PainterLine/init
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
#ifndef _PainterLine_icpp_init_stub
|
||||
#define _PainterLine_icpp_init_stub
|
||||
#include "CtrlLib/init"
|
||||
#include "Painter/init"
|
||||
#endif
|
||||
50
uppdev/PainterLine/main.cpp
Normal file
50
uppdev/PainterLine/main.cpp
Normal 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();
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue