There are a number of ways to handle this. I would stay away from "munging"
the events, however. I would recommend that you have a function to convert
from a specific form value to a general-purpose form value and back again.
You would want to have all of the navigation form controls at the same
relative ID to the form that owns the control. You could then translate any
form control to a non-relative form value and key off that in your common
handler code. For example:
Uint16 GetCommonFormControlID( Uint16 formID, Uint16 controlID )
{
return controlID - formID;
}
Uint16 GetSpecificFormID( Uint16 formID, Uint16 specificID )
{
return formID + specificID;
}
Then in your common handler code, you could do things like
table = GetObjectPtr( GetSpecificFormID(currentForm, ScrollBarID ) );
// act on table
or the other way
switch ( GetCommonFormControlID( currentForm, controlID ) )
case ScrollBarID:
// handle scroll event
(ignore the improper case, Outlook (Word) likes to help me by "fixing" my
case!)
//Ray
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Ron
Nicholson
Sent: Thursday, March 22, 2001 1:44 AM
To: Palm Developer Forum
Subject: RE: Running two different forms at the same time
Using this method, can the form navigation control resources be shared,
or will they have to be duplicated? If they are duplicated, how will the
common navigation code handle all the multiple control ID's for the
"same" control? Seems like you might have to "munge" the selection
events before passing them to common navigation code...
Ron Nicholson
HotPaw
<http://www.hotpaw.com/rhn/hotpaw/ >
(hopefully my emailer is configured to send only plain text this time)
-----Original Message-----
Ray Marshall wrote:
>Unless I am not understanding what you are doing, you shouldn't need to
have
>any application bloat (except for a slight duplication of the resources).
>You should write common code to handle the navigation form and have the
>event handler for each form just call the common navigation code. Not only
>will this reduce your code size but will also be a whole lot easier to
>maintain.
...
--
For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/tech/support/forums/
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/