struct menu_displaypara *peripheralrespond_general(struct menu_displaypara *operatingDispara, void *para)
{
   struct menu_displaypara  *temp;
   u8 cmd=*(u8 *)(para);
   switch (cmd)
   {
      case GOTO_SUBMENU:
            temp=goto_submenu(operatingDispara);
            if(NULL!=temp)
            {
                operatingDispara=temp;
            }
            break;
      case GOTO_PARENT:
            temp=goto_parmenu(operatingDispara);
            if(NULL!=temp)
            {
                operatingDispara=temp;
            }
            break;
      case GOTO_NEXT:
           goto_nextmenuitem(operatingDispara);
           break;
      case GOTO_PRE:
           goto_premenuitem(operatingDispara);
           break;
      case  GOTO_EXE:
            operatingDispara=exe_menuitemfunc(operatingDispara);
            break;
      default:
              break;
   }
   return operatingDispara;
}
Example #2
0
// =========================================================================
// 函数功能:左键响应函数
// 输入参数:operatingDispara,当前正在操作的菜单项
// 输出参数:
// 返回值    :经过更新的当前正在操作的菜单项
// 说明        :在九宫格中,对于左键,主菜单会向前返前面一个菜单项,子菜单会切换回父菜单
// =========================================================================
struct menu_displaypara* KeyLeftAction_9cell(struct menu_displaypara* operatingDispara)
{
  if(NULL==operatingDispara->pre)//主菜单
  {
    goto_premenuitem(operatingDispara);
  }
  else//子菜单
  {
    operatingDispara=goto_parmenu(operatingDispara);
  }

  return operatingDispara;
}
Example #3
0
// =========================================================================
// 函数功能:esc键响应函数
// 输入参数:operatingDispara,当前正在操作的菜单项
// 输出参数:
// 返回值    :经过更新的当前正在操作的菜单项
// 说明        :在九宫格中,对于返回键,主菜单不响应,子菜单会切换会父菜单
// =========================================================================
struct menu_displaypara*  KeyEscAction_9cell(struct menu_displaypara* operatingDispara)
{
  if(NULL==operatingDispara->pre)//主菜单
  {
    printf("This is the main menu,can not Esc any more!\n");
  }
  else//子菜单
  {
    operatingDispara=goto_parmenu(operatingDispara);
  }

  return operatingDispara;

}