Here's an (incomplete) event handler for a form which includes some code that should do what you need:
Boolean SomeFormEventHandler(EventType* eventP)
{
EventType evt;
Boolean done = false;...
case penDownEvent:
// Initialize the drawing using data from the penDown event
while(!done) {
EvtGetEvent(&evt, 1); switch(evt.eType)
{
case penMoveEvent:
// do some drawing work
break; case penUpEvent:
done = true;
break; default:
// Handle other events?
break;
}
}
handled = true;
break;...
return handled; }
Remember that you might get other events (such as nilEvents) during the processing of this loop, so you have to handle them accordingly.
At 12:00 AM 6/21/2003 -0700, "Kelly Perkins" <[EMAIL PROTECTED]> wrote:
Has anyone encountered problems with the penMove event in OS5 on real devices? We have an application that draws a line from pendown to penup but also captures penMove. It works great in pre-OS5 and great on the OS5 simulator. However, on a real device, it is very choppy at best and doesn't seem to capture all of the movements. This is in the normal drawing window, nothing fancy like drawing over Graffiti or anything. Any ideas to fix it would be appreciated! Thanks! Or, does anyone know how to get the source code for Palm Notepad since that seems to work fine?
Here is a sample to try to see the problem - note it works fine in the Simulator, so you have to try it on a real device:
case penDownEvent: s_x = eventP->screenX; s_y = eventP->screenY; s_bPenDown = true; break;
case penMoveEvent: if (s_bPenDown == true) { xNew = eventP->screenX; yNew = eventP->screenY;
// draw a single line WinDrawLine(s_x, s_y, xNew, yNew); s_x = xNew; s_y = yNew; } break;
----
Tom Frauenhofer, [EMAIL PROTECTED]
http://www.beret.com
-- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
