本文整理汇总了C++中MENU::select方法的典型用法代码示例。如果您正苦于以下问题:C++ MENU::select方法的具体用法?C++ MENU::select怎么用?C++ MENU::select使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MENU
的用法示例。
在下文中一共展示了MENU::select方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: runHandler
volatile char runHandler(char key, char first)
{
static char pressed;
if(first)
{
pressed = key;
key = 0;
}
if(pressed == FR_KEY)
{
menu.message(TEXT("Timer Started"));
timer.begin();
menu.spawn((void*)timerStatus);
return FN_JUMP;
}
menu.push();
menu.select(0);
menu.init((menu_item*)menu_options);
lcd.update();
return FN_CANCEL;
}
示例2: 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;
}
示例3: 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;
}