Elliot,
You also need to setup a Form event handler for each form, so that they
can receive update, pen etc events. To do this, do the following ..
static Boolean AppHandleEvent(EventPtr inEventPtr)
{
UInt16 aFormID;
FormPtr aFormPtr;
if (inEventPtr->eType == frmLoadEvent)
{
// Load the form resource.
aFormID = inEventPtr->data.frmLoad.formID;
aFormPtr = FrmInitForm(aFormID);
FrmSetActiveForm(aFormPtr);
// Set the event handler for the form. The handler of the currently
// active form is called by FrmHandleEvent each time is receives an
// event.
switch (aFormID)
{
case Form1:
FrmSetEventHandler(aFormPtr, Form1HandleEvent);
break;
case Form2:
FrmSetEventHandler(aFormPtr, Form2HandleEvent);
break;
case Form3:
FrmSetEventHandler(aFormPtr, Form3HandleEvent);
break;
case Form4:
FrmSetEventHandler(aFormPtr, Form4HandleEvent);
break;
default:
// ErrFatalDisplay("Invalid Form Load Event");
break;
}
return true;
}
return false;
}
Then for each Form you create, you place a case statement in the above
switch, and add a new event handling function for the new Form ..
Boolean Form1HandleEvent(EventPtr inEventPtr)
{
Boolean aHandled = false;
FormPtr aFormPtr;
switch (inEventPtr->eType)
{
case menuEvent:
return MainFormDoCommand(inEventPtr->data.menu.itemID);
case frmOpenEvent:
aFormPtr = FrmGetActiveForm();
// Form1Init(aFormPtr);
FrmDrawForm(aFormPtr);
aHandled = true;
break;
default:
break;
}
return aHandled;
}
This should help
------------
Steve Fillingham
CodeDrive Pty Ltd
[EMAIL PROTECTED]
"elliott ..." <[EMAIL PROTECTED]> wrote in message
news:32138@palm-dev-forum...
>
>
> hi, thanks alot for the code, but i just have one problem with compiling
> it.. see when i compile it, i get 8 errors that say undefined identifier,
> for all Forms and MainOptionForms. something odd that i noticed though was
> that the header file generated by constructor was in the Rsc folder, not
the
> Src folder. tso i added the "good" header file to the project and incuded
it
> to the source, and it compiled ok. but when the app is running on the
palm,
> and i click the menu items, it goes to a blank screen.. anyone know what i
> can do?
>
> thanks for your time.
>
>
> (this is the code im using)
> > >Elliott ..
> > >
> > >switch (command)
> > >{
> > > case MainOptionsForm1:
> > > FrmGotoForm(Form1);
> > > handled = true;
> > > break;
> > >
> > > case MainOptionsForm2:
> > > FrmGotoForm(Form2);
> > > handled = true;
> > > break;
> > >
> > > case MainOptionsForm3:
> > > FrmGotoForm(Form3);
> > > handled = true;
> > > break;
> > >
> > > case MainOptionsForm4:
> > > FrmGotoForm(Form4);
> > > handled = true;
> > > break;
> > >
> > > case MainOptionsAboutStarterApp:
> > > MenuEraseStatus (0);
> > > AbtShowAbout (appFileCreator);
> > > handled = true;
> > > break;
> > > }
> > >
> > >
> > >Above code assumes you have created 4 forms (Form1, Form2, Form3,
Form4)
> > >and
> > >in the main form have 4 menu options (MainOptionsForm1 ..
> >MainOptionsForm4)
> > >
> > >Inside constructor, each form can link to only one Menu Bar, see the
> >forms
> > >Menu Bar ID. Link Menu Bars to Forms using this property.
> > >
> > >
> > >--
> > >------------
> > >Steve Fillingham
> > >CodeDrive Pty Ltd
> > >[EMAIL PROTECTED]
> > >"elliott ..." <[EMAIL PROTECTED]> wrote in message
> > >news:32094@palm-dev-forum...
>
>
____________________________________________________________________________
_________
> Get more from the Web. FREE MSN Explorer download :
http://explorer.msn.com
>
>
>
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/