I used an extended gadget in a little utility application a while ago. While developing it I found a couple of things strange in the way that extended gadgets are implemented in Palm OS. Now I'm converting some home-grown dynamic UI (written before Palm OS supported it) and am trying to port some gadget based controls into 4.0 compliant extended gadgets, and the same strangeness is bothering me, but now the strangeness is actually a development problem.
What is that strangeness you ask? Well, extended gadgets work by associating a callback routine with the gadget so that FrmHandleEvent can pass events to your gadget. This "GadgetHandleEvent" callback function handles the event destined for your gadget. In my earlier development, I found it strange that one gets frmGadgetEnter events in the gadget handler, but one never gets penMove, penDown or penUp events in the gadget. This forces one to handle these events in the form handler, thus separating the work of tracking these things between the form handler and the gadget handler. Specifically, I was forced to set a flag (penCaptured) on the frmGadgetEnter event and then process penMove events in the form handler and then unset the penCaptured flag on the penUp (are you with me still?). It just seemed kind of schizoid to me... So, my question is: how come pen events that are in the gadget are not passed to the gadget by the form handle event? My problem now is that in my dynamic UI, I have a single form that is continuously created and destroyed with script generated screens. This base form has a generic event handler and I was hoping to keep all gadget-specific handling in the gadget handler. However, because of the "split handling" of events, I cannot do this. I don't want to have to forward pen events from the form to the gadget because I would have to have some knowledge of the gadget to do so, and I don't want to care what gadgets are on the form from the form handler... Am I missing something? Thanks, Kevin -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/
