Here's something that just forced me to change the design of some code I was
working on.

The idea is that I wanted to produce something like a MS wizard, with
several linked forms that guide the user through a complicated process.  I
was originally going to use a series of alerts and modal dialogs to move
through the system, but I realized that this would cause a Palm UI problem.

The issue is exiting from within the wizard process.  If you have code like

   // do form 1
   FrmAlert(FooAlert);
   // do form 2
   FrmAlert(BarAlert);
   // do form 3
   FrmAlert(BazAlert);

then if the user tries to switch away, by tapping the launcher icon or
hitting a hard key while you're displaying the first alert, that dialog will
go away, the next one will be displayed, it will be dismissed by the extant
appStop event, and this will continue with default buttons being hit until
you reach some sort of processing point.

The solution is to not have "one choice" dialogs.  Provide a consistent
cancel button to get out of your alerts and dialogs, and make sure its the
default button so the dialog event handler will "push" it when the user
tries to switch out of the application.  Then, the code which moves the user
through the forms must check for cancellations, but that's pretty easy to
add.

An even better solution is to move the wizard into a series of non-modal
forms, but the effort to do that and implement a whole state transition
system may be more than an application needs, although I'm currently toying
with a reusable "wizard" system using a separate event loop that manages a
set of forms outside the normal flow of a Palm application, using some
dialog techniques to return state to the original form that invoked this.

Just some late night thoughts...
--
Ben Combee
Veriprise Wireless <http://www.veriprise.com>



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to