//============================================================================
void HomeScene::menuPlayCallback(Object *pSender)
{ // Declare Variables
  //--------------------------------------------------
  
  PlayButtonClick();
  Director::getInstance()->pushScene(MainScene::createScene());
  
  //--------------------------------------------------
} // End of menuPlayCallback Method
//============================================================================
void HomeScene::menuExitCallback(Object *pSender)
{ // Declare Variables
  //--------------------------------------------------
  
  PlayButtonClick();
  Director::getInstance()->end();
  
#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
  exit(0);
#endif
  
  //--------------------------------------------------
} // End of menuExitCallback Method
Exemple #3
0
/* Editor Form event handler */
Boolean EditorFormEventHandler(EventType * e)
{
  switch ((UInt16)e->eType)
    {
    case frmOpenEvent:
      FormOpen();
      return true;

    case frmUpdateEvent:
      FormUpdate();
      return true;

    case frmCloseEvent:
      FormClose();
      return false; /* return unhandled status for call default system handler (witch free form data),
		       accordin with standard sdk examples */
    case penDownEvent:
      return FormPenDownEvent(e);

    case ctlSelectEvent:
      switch (e->data.ctlSelect.controlID) {
      case ID_EditorDropButton: DropButtonClick(); return true;
      case ID_EditorSaveButton: SaveButtonClick(); return true;
      case ID_EditorPlayButton: PlayButtonClick(); return true;
      }
      break;

    case sclRepeatEvent:
      ScrollbarEvent((struct sclRepeat *)&e->data);
      return false;

    case MKeysNoteTappedEvent:
      NoteButtonPressed(e->data.generic.datum[0]);
      return true;
    }
  return false;
}