So what you're generally discussing is how to update inactive forms.

The change you're proposing is to make FrmUpdateEvent directly call and update
inactive forms.  This could be done, but it has some problems, like the form is
generally obscured, so drawing doesn't help because the draws would be clipped
away.  Also, when the form covering is erased, it will restore pixels to the way
it used to look.

The Palm OS convention is to have FrmUpdateEvent place the frmUpdateEvent on the
queue.  This is carefully done so that when EvtGetEvent returns it,
frmUpdateEvent's form is the active form, which has full access to draw to the
screen.

So if the Reference claims that FrmDispatchEvent sends events to inactive forms,
that's wrong.  It only sends them to the active form. That's a general model
that Palm OS follows.  Exceptions are the three cases of broadcasts discussed.
It's simple but still gets the job done.


-Roger Flores





"Stephen Best" <[EMAIL PROTECTED]> on 09/11/99 12:19:01 AM

Please respond to [EMAIL PROTECTED]

Sent by:  "Stephen Best" <[EMAIL PROTECTED]>


To:   [EMAIL PROTECTED]
cc:    (Roger Flores/HQ/3Com)
Subject:  Re: More Tips and stuff




>>I reckon there's a bug in the FrmDispatchEvent code.

>Hmmm.  I reckon there's a bug too.  I see FrmUpdateForm sets formID
>but that RedrawDisplay, when it broadcasts to forms to redraw,
>doesn't.  Thanks.

It's not only that the formID may or may not be set, but that a
FrmUpdateForm should send the frmUpdateEvent to the identified form. The
Reference for FrmDispatchEvent states that "The event is dispatched to the
current form's handler unless the form ID is specified in the event data".
This then should apply to a frmUpdateEvent as well. I reckon the following
lines should be added to FrmDispatchEvent (Form.c after line 3766 for OS
3.0):

   else if ( (eventP->eType == frmUpdateEvent) &&
             (eventP->data.frmUpdate.formID != 0) )
      frm = FrmGetFormPtr (eventP->data.frmUpdate.formID);

I've noticed that some apps (e.g. Address) call FrmUpdateForm with the
formID parameter set to zero ... mainly I guess because currently it's
ignored.

Stephen Best
Bitware Australia Pty. Ltd.







Reply via email to