Draw with the mouse. It just demonstrates using OnMouseMove and LineTo, pretty much. But it's my first windows app with AuroraÂÃ, :D
class DrawApp : window
{
declare OnMouseMove(int x, int y, int flags),int;
declare OnClose(),int;
declare OnCreate(),int;
POINT p;
}
global sub main()
{
DrawApp drw;
drw.Create(0, 0, 500, 500, AWS_CAPTION|AWS_VISIBLE|AWS_BORDER|AWS_SYSMENU|AWS_AUTODRAW, 0, "Drawing app", null);
do { wait(); } until drw.m_hWnd = 0;
return;
}
DrawApp::OnMouseMove(int x, int y, int flags)
{
Move(p.x, p.y);
if (flags = 1) LineTo(x, y);
p.x = x; p.y = y;
return window!!OnMouseMove(x, y, flags);
}
DrawApp::OnClose()
{
Destroy();
return true;
}
DrawApp::OnCreate()
{
CenterWindow();
return true;
}
Simple but cool and it works as advertised! 8) 8) 8)
Thanks for sharing.
-Doc-