/*===============================================================================
INCLUDES AND VARIABLE DEFINITIONS
=============================================================================== */
/*-------------------------------------------------------------------
Applet structure. All variables in here are reference via "me->"
-------------------------------------------------------------------*/
// create an applet structure that's passed around. All variables in
// here will be able to be referenced as static.
typedef struct _helloformapp {
IApplet ia;
IAppletVtbl iavt;
int nRefs;
IDisplay *pIDisplay; // give a standard way to access the Display interface
IShell *pIShell; // give a standard way to access the Shell interface
IModule *pIModule;
AEEDeviceInfo DeviceInfo; // always have access to the hardware device information
// add your own variables here...
IRootForm *piRootForm; // root form
IForm *piForm; // form to be displayed
IVectorModel *piVectorModel;
IValueModel *piValueModel;
switch (eCode) {
// App is told it is starting up
case EVT_APP_START:
// Add your code here...
return(TRUE);
// App is told it is exiting
case EVT_APP_STOP:
// Add your code here...
return(TRUE);
// App is being suspended
case EVT_APP_SUSPEND:
// Add your code here...
return(TRUE);
// App is being resumed
case EVT_APP_RESUME:
// Add your code here...
return(TRUE);
// An SMS message has arrived for this app. Message is in the dwParam above as (char *)
// sender simply uses this format "//BREW:ClassId:Message", example //BREW:0x00000001:Hello World
case EVT_APP_MESSAGE:
// Add your code here...
return(TRUE);
// A key was pressed. Look at the wParam above to see which key was pressed. The key
// codes are in AEEVCodes.h. Example "AVK_1" means that the "1" key was pressed.
case EVT_KEY:
switch (wParam) {
// UP
case AVK_UP:
return TRUE;
// DOWN
case AVK_DOWN:
return TRUE;
// LEFT
case AVK_LEFT:
return TRUE;
// RIGHT
case AVK_RIGHT:
return TRUE;
// SELECT
case AVK_SELECT:
return TRUE;
// CLEAR
case AVK_CLR:
return TRUE;
// SOFTKEY 1
case AVK_SOFT1:
// will change the text here
IFORM_GetWidget(me->piForm, WID_FORM, &piw);
IWIDGET_SetText(piw, awchNewText, TRUE);
RELEASEIF(piw);
return TRUE;
// set some keys and titles
IFORM_SetText(me->piForm, FID_TITLE, awchTitle);
IFORM_SetText(me->piForm, FID_SOFTKEY1, awchSoftkey1);
IFORM_SetText(me->piForm, FID_SOFTKEY2, awchSoftkey2);
// push the form to the root form
nErr = IROOTFORM_PushForm(me->piRootForm, me->piForm);
// if there have been no failures up to this point then return success
return nErr;
}
/*===============================================================================
INCLUDES AND VARIABLE DEFINITIONS
=============================================================================== */
#include "myform1.h"
#include "AEEFile.h"
/*-------------------------------------------------------------------
Applet structure. All variables in here are reference via "pMe->"
-------------------------------------------------------------------*/
// create an applet structure that's passed around. All variables in
// here will be able to be referenced as static.
typedef struct _Window2 {
IDisplay *pIDisplay; // give a standard way to access the Display interface
IShell *pIShell; // give a standard way to access the Shell interface
IRootForm *pRootForm;