Exemple #1
0
void MainFormPressFindButton(const FormType* form) 
{
    Assert(form);
    Assert(formDictMain==FrmGetFormId(form));
    UInt16 index=FrmGetObjectIndex(form, buttonFind);
    Assert(frmInvalidObjectId!=index);
    const ControlType* findButton=static_cast<const ControlType*>(FrmGetObjectPtr(form, index));
    Assert(findButton);
    CtlHitControl(findButton);
}
Exemple #2
0
UInt16 DisplayDialog( UInt16 formID, FormEventHandlerPtr handler ) 
{ 
	FormPtr active = FrmGetActiveForm();
    
	UInt16 activeID = ( active != NULL ) ? FrmGetFormId( active ) : 0;
	FormPtr dialog = FrmInitForm( formID );
	UInt16 buttonPressed = 0;
    
	FrmSetActiveForm( dialog ); 
	if( handler ){ 
		FrmSetEventHandler( dialog, handler ); 
	} 
	FrmPopupForm( formID ); 
	buttonPressed = FrmDoDialog( dialog ); 
	FrmReturnToForm( activeID );
    
	return buttonPressed;
} 
Exemple #3
0
/***********************************************************************
 * handling for the main drop down menu actions
 ***********************************************************************/
Boolean
HandleMenuEvent (UInt16 command)
{
  Boolean handled = false;
  MenuEraseStatus(0);
  gMenuCurrentForm=FrmGetFormId(FrmGetActiveForm());

  switch (command) {
  case MENUITEM_about:
    FrmDoDialog(FrmInitForm(FORM_about));
    handled=true;
    break;

  case MENUITEM_course:
    AddCourse();
    handled=true;
    break;

  case MENUITEM_time:
    if (CountCourses() != 0) {
      AddTime();
    } else {
      FrmAlert(ALERT_nocourses);
    }
    handled=true;
    break;

  case MENUITEM_courselist:
    FrmGotoForm(FORM_courselist);
    handled=true;
    break;

  case MENUITEM_settings:
    FrmPopupForm(FORM_settings);
    handled=true;
    break;

  case MENUITEM_alarm:
    FrmPopupForm(FORM_alarm_sets);
    handled=true;
    break;

  case MENUITEM_exams:
    FrmGotoForm(FORM_exams);
    handled=true;
    break;

  case MENUITEM_beam:
    BeamSemester(DatabaseGetCat());
    handled=true;
    break;

  case MENUITEM_chat:
    AppLaunchWithCommand(UNICHAT_APP_CREATOR, sysAppLaunchCmdNormalLaunch, NULL);
    handled=true;
    break;

  case MENUITEM_mensa:
    AppLaunchWithCommand(UNIMENSA_APP_CREATOR, sysAppLaunchCmdNormalLaunch, NULL);
    handled=true;
    break;

  default:
    break;
  }

  return handled;
}