Well Chris, you answered my question... which was: "is there a simple way?"
I agree there are some interesting challenges here. I'm on basically the
same track you describe but my code was getting so elaborate I thought I
better get a reality check to see if I was missing some little piece of
elegance. Turns out I'm not. I now appreciate the simplicity of using the
Palm Progress Manager which handles all these details nicely (i think).
Thanks much for your valuable feedback.
Mitch
> -----Original Message-----
> From: Chris Antos [SMTP:[EMAIL PROTECTED]]
> Sent: Tuesday, September 14, 1999 2:58 PM
> To: [EMAIL PROTECTED]
> Subject: Re: Progress meters
>
> kind of. i have one, but haven't added the Cancel button yet. i designed
> it with that in mind, though, so the calling model is correct at least.
> (i
> have an ProgressUpdate function that the loop calls to update the meter,
> and
> the return value from ProgressUpdate says whether to cancel or not). of
> course the hard part is handling the events logically. however, that
> should
> really be quite simple, come to think of it. pop up a miniature form with
> no title. put a "working..." label on it, a gadget where you'll draw the
> progress meter, and a Cancel button. since the ProgressUpdate function
> will
> be called inside a loop, then ta-da that's your event loop. so inside the
> Update function, you clear a global "cancelled" variable, and then call
> SystemHandleEvent and then FrmDispatchEvent. the form event handler can
> set
> the global "cancelled" variable if the Cancel button was tapped. if the
> appStopEvent happens, then set the global variable, and also re-enqueue
> the
> appStopEvent (so that app will get it again after the loop terminates). i
> think the interesting part will be (1) handling alarm events (maybe queue
> them into an array, and then re-enqueue them all when the ProgressFinished
> function is called). and (2) handling penDownEvent and penUpEvent in a
> timely manner (probably just loop and dispatch the events until the event
> is
> not penDownEvent, penUpEvent, or penMoveEvent).
>
> hope that helps!
>
>
> ----- Original Message -----
> From: Fawcett, Mitch <[EMAIL PROTECTED]>
> To: 'PalmDevForum' <[EMAIL PROTECTED]>
> Sent: Tuesday, September 14, 1999 8:27 AM
> Subject: Progress meters
>
>
> > Has anyone written their own progress meters? I want something that I
> can
> > use in all versions of PalmOS and it looks like the Progress Manager
> only
> > works in OS3 or higher. I thought rolling my own would be pretty
> simple...
> > create a while loop with EvtGetEvent at the top and detect a pen down on
> the
> > spot where my cancel button is to interrupt my long process. It's
> getting
> > more complicated than that though, and I seem to be re-writing all the
> > Progress Manager code to handle system events, hard key presses,
> touching
> > the graffiti area, alarms, etc. Does anyone have a simpler way to
> indicate
> a
> > process is underway and allow the user to cancel it?
> >
> > Mitch
> >
>