本文整理汇总了C++中MENU::back方法的典型用法代码示例。如果您正苦于以下问题:C++ MENU::back方法的具体用法?C++ MENU::back怎么用?C++ MENU::back使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MENU
的用法示例。
在下文中一共展示了MENU::back方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: menuBack
volatile char menuBack(char key, char first)
{
if(key == FL_KEY)
menu.back();
return FN_CANCEL;
}
示例2: shutter_saveAs
volatile char shutter_saveAs(char key, char first)
{
static char name[MENU_NAME_LEN - 1];
static char newId;
if(first)
{
newId = timer.nextId();
if(newId < 0)
{
menu.message(TEXT("No Space"));
return FN_CANCEL;
}
}
char ret = menu.editText(key, name, TEXT("Save As"), first);
if(ret == FN_SAVE)
{
name[MENU_NAME_LEN - 2] = 0;
strcpy((char*)timer.current.Name, name);
timer.save(newId);
menu.message(TEXT("Saved"));
menu.back();
}
return ret;
}
示例3: timerRevert
volatile char timerRevert(char key, char first)
{
if(first)
timer.load(timer.currentId);
menu.message(TEXT("Reverted"));
menu.back();
return FN_CANCEL;
}
示例4: timerSaveCurrent
volatile char timerSaveCurrent(char key, char first)
{
if(first)
timer.save(timer.currentId);
menu.message(TEXT("Saved"));
menu.back();
return FN_CANCEL;
}
示例5: timerSaveDefault
volatile char timerSaveDefault(char key, char first)
{
if(first)
timer.save(0);
menu.message(TEXT("Saved"));
menu.back();
return FN_CANCEL;
}
示例6: timerStop
volatile char timerStop(char key, char first)
{
if(first)
timer.running = 0;
menu.message(TEXT("Stopped"));
menu.back();
return FN_CANCEL;
}
示例7: shutter_removeKeyframe
volatile char shutter_removeKeyframe(char key, char first)
{
if(timer.current.Keyframes > 1)
{
timer.current.Keyframes--;
}
menu.back();
menu.select(0);
return FN_CANCEL;
}
示例8: shutter_addKeyframe
volatile char shutter_addKeyframe(char key, char first)
{
if(timer.current.Keyframes < MAX_KEYFRAMES)
{
if(timer.current.Keyframes < 1)
timer.current.Keyframes = 1;
timer.current.Key[timer.current.Keyframes] = timer.current.Key[timer.current.Keyframes - 1] + 3600;
timer.current.Bulb[timer.current.Keyframes + 1] = timer.current.Bulb[timer.current.Keyframes];
timer.current.Keyframes++;
}
menu.back();
return FN_CANCEL;
}
示例9: shutter_load
volatile char shutter_load(char key, char first)
{
static char menuSize;
static char menuSelected;
static char itemSelected;
uint8_t c;
char ch, update, menuScroll;
update = 0;
if(first)
{
menuScroll = 0;
update = 1;
}
if(key == UP_KEY && menuSelected > 0)
{
menuSelected--;
update = 1;
}
else if(key == DOWN_KEY && menuSelected < menuSize - 1)
{
menuSelected++;
update = 1;
}
if(update)
{
lcd.cls();
if(menuSelected > 2)
menuScroll = menuSelected - 2;
menuSize = 0;
char i = 0;
for(char x = 1; x < MAX_STORED; x++)
{
i++;
ch = eeprom_read_byte((uint8_t*)&stored[i - 1].Name[0]);
if(ch == 0 || ch == 255)
continue;
for(c = 0; c < MENU_NAME_LEN - 1; c++) // Write settings item text //
{
if(i >= menuScroll && i <= menuScroll + 5)
{
ch = eeprom_read_byte((uint8_t*)&stored[i - 1].Name[c]);
if(ch == 0) break;
if(ch < 'A' || ch > 'Z')
ch = ' ';
lcd.writeChar(3 + c * 6, 8 + 9 * (menuSize - menuScroll), ch);
if(menuSize == menuSelected)
itemSelected = i - 1;
}
}
menuSize++;
}
lcd.drawHighlight(2, 7 + 9 * (menuSelected - menuScroll), 81, 7 + 9 * (menuSelected - menuScroll) + 8);
menu.setTitle(TEXT("Load Saved"));
menu.setBar(TEXT("CANCEL"), TEXT("LOAD"));
lcd.drawLine(0, 3, 0, 40);
lcd.drawLine(83, 3, 83, 40);
lcd.update();
}
switch(key)
{
case FL_KEY:
case LEFT_KEY:
return FN_CANCEL;
case FR_KEY:
case RIGHT_KEY:
timer.load(itemSelected);
menu.message(TEXT("Loaded"));
menu.back();
menu.select(0);
return FN_SAVE;
}
return FN_CONTINUE;
}