Example #1
0
void Manutencao(Button bUp, Button bDown, Button bOk){
	Manutencao_Init();
	
	LCD_WriteString("MODO DE");
	LCD_Goto(1,6);
	LCD_WriteString("Manutencao");
	TMR0_Delay(3000);
	
	LCD_Clear();
	
	getSubMenu();
	
	while(1){
		if(BUTTON_getState(bUp){
			executeAction(MUP);
		}
		if(BUTTON_getState(bDown){
			executeAction(MDOWN);
		}
		if(BUTTON_getState(bOk){
			//SAIR DO MODO DE MANUTENCAO
			if(m.currSubMenu == 6)
				return;
			executeAction(MOK);
		}
	}
}
Example #2
0
void cOptionMenuHidden::addSubmenu(const char *name, const char *parent) {
  COptionMenu *tmenu = new COptionMenu(size, listener, tag);
  
  if(parent == NULL) {
    addEntry(tmenu, (char*)name);
  }
  else {
    getSubMenu(findSubmenu(parent))->addEntry(tmenu, (char*)name);
  }
  
  char *tname = new char[MAX_MENU_NAME];
  strncpy(tname, name, MAX_MENU_NAME);
  m_submenu_names.push_back(tname);
  ++m_submenu_items;
}
Example #3
0
void CMainFrame::updateLoadOptionsMenu() {
  const StringArray optionNames = Options::getExistingNames();
  const String saveOptionsMenuPath = _T("3/11");
  int index;
  HMENU optionsMenu = findMenuByString(m_hMenuDefault, saveOptionsMenuPath, index);
  HMENU loadMenu    = (optionsMenu && (index >= 0)) ? getSubMenu(optionsMenu, _T("load options")) : NULL;

  if(loadMenu == NULL) {
    if(optionNames.size() > 0) {
      loadMenu = insertSubMenu(optionsMenu, 12, _T("&Load options"));
    } else {
      return;
    }
  } else {
    removeAllMenuItems(loadMenu);
  }
  const int n = min((int)optionNames.size(), 9);
  for(int i = 0; i < n; i++) {
    insertMenuItem(loadMenu,i, format(_T("%s\tCtrl+%d"), optionNames[i].cstr(), i+1), ID_OPTIONS_LOADOPTIONS+i+1);
  }
}