I forgot one other point, plus I have a few replies.

Several people have been talking about importing and exporting files to Pose.
I've used the HostImportFile and HostExportFile functions with large success.  I
have apps which export their databases during app stop, and which import the
databases again at app start.  If the databases don't exist, then the app
creates them.


>1. It's only when processing a frmUpdateEvent that FrmGetActiveForm may
return another form's pointer?

No.  The events frmSaveForm and frmCloseForm can be broadcast directly to form
event handlers too.  You can check this yourself by noticing the
FrmCloseAllForms and FrmSaveAllForms functions in Form.h.


>2. If I have two forms Form1 and Form2 and I call FrmUpdateForm (Form2, x)
whilst Form1 is active, the frmUpdateEvent is sent to Form1's event handler.
Letting it fall through to FrmHandleEvent doesn't send it to Form2's event
handler. And the implication in your posting is that I may well receive a
frmUpdateEvent with a formID of other forms. Obviously, I'm not supposed to
handle redraws for all other forms in my Form1 event handler. I'm confused!

So, looking in Form.c, FrmDispatchForm sends events to the active form, called
CurrentForm in the source.  Other forms will not be sent the event.  So when a
normal event loop is doing it's working, only the active form gets events.

But broadcasts to form event handlers are different.  They directly call all
registered event handling functions.

So if an event handler receives a frmUpdateEvent, it should update it's form.
If your code is using frmUpdateEvent for it's own purposes, make sure to account
for it.  You can just check that event.data.frmUpdate.updateCode ==
frmRedrawUpdateCode.  But it's probably safer to check for a code used by your
app and them.  Otherwise return the event unhandled for the OS handle.


>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.


-Roger Flores


Reply via email to