IonicWind Software

Aurora Compiler => GUI => Topic started by: Parker on December 11, 2005, 03:25:15 PM

Title: (Very) simple drawing app
Post by: Parker on December 11, 2005, 03:25:15 PM
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;
}
Title: Re: (Very) simple drawing app
Post by: Doc on December 11, 2005, 04:39:24 PM
Simple but cool and it works as advertised!  8) 8) 8)

Thanks for sharing.

-Doc-