Slide 7.12: Line-by-line anatomy of Hello_a.c (cont.)
  Slide 7.14: Line-by-line anatomy of Hello_a.c (cont.)
  Home


Line-by-line Anatomy of Hello_a.c (Cont.)


case frmLoadEvent:
The control routines FrmGotoForm( ) and FrmPopupForm( ) send this event frmLoadEvent. It is a request that the application loads a form into memory. The application is responsible for handling this event. In response to this event, applications typically initialize the form, make it active, and set the event handler. For this event, the data field contains the following structure:
    struct  frmLoad {
      UInt16  formID;
    }  frmLoad;
where formID: Developer-defined ID of the form.

FrmSetActiveForm( FrmInitForm( e.data.frmLoad.formID ) );
The function void FrmSetActiveForm ( FormType *formP ) sets the active form. All input (key and pen) is directed to the active form and all drawing occurs there. The function FormType *FrmInitForm( UInt16 rscID ) loads and initializes a form resource.
case frmOpenEvent:
The form routines FrmGotoForm( ) and FrmPopupForm( ) send this event frmOpenEvent. It is a request that the application initializes and draws a form. The application is responsible for handling this event. For this event, the data field contains the following structure:
    struct  frmOpen {
      UInt16  formID;
    }  frmOpen;
where formID: Developer-defined ID of the form.