本文整理汇总了C++中MENU::setTitle方法的典型用法代码示例。如果您正苦于以下问题:C++ MENU::setTitle方法的具体用法?C++ MENU::setTitle怎么用?C++ MENU::setTitle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MENU
的用法示例。
在下文中一共展示了MENU::setTitle方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: viewSeconds
volatile char viewSeconds(char key, char first)
{
if(first)
{
lcd.cls();
lcd.writeString(1, 18, TEXT("Clock:"));
menu.setTitle(TEXT("Clock"));
menu.setBar(TEXT("TARE"), TEXT("RETURN"));
}
lcd.eraseBox(36, 18, 83, 18 + 8);
/*char x =*/ lcd.writeNumber(83, 18, clock.Seconds(), 'F', 'R');
lcd.update();
switch(key)
{
case FL_KEY:
clock.tare();
break;
case FR_KEY:
return FN_CANCEL;
}
return FN_CONTINUE;
}
示例2: lighteningTrigger
volatile char lighteningTrigger(char key, char first)
{
if(first)
{
sleepOk = 0;
hardware_lightening_enable();
lcd.cls();
menu.setTitle(TEXT("Lightening"));
lcd.writeString(25, 20, TEXT("READY"));
menu.setBar(TEXT("RETURN"), TEXT("CALIBRATE"));
lcd.update();
}
if(key == FL_KEY || key == LEFT_KEY)
{
sleepOk = 1;
hardware_lightening_disable();
return FN_CANCEL;
}
if(key == FR_KEY)
{
menu.message(TEXT("Calibrating"));
hardware_lightening_disable();
}
return FN_CONTINUE;
}
示例3: IRremote
volatile char IRremote(char key, char first)
{
if(first)
{
lcd.cls();
menu.setTitle(TEXT("IR Remote"));
menu.setBar(TEXT("Delayed"), TEXT("Trigger"));
lcd.update();
}
switch(key)
{
case FL_KEY:
ir.shutterDelayed();
break;
case FR_KEY:
ir.shutterNow();
break;
case LEFT_KEY:
return FN_CANCEL;
}
return FN_CONTINUE;
}
示例4: timerStatus
volatile char timerStatus(char key, char first)
{
static uint8_t counter;
if(first)
{
counter = 0;
}
if(counter++ > 3)
{
counter = 0;
lcd.cls();
displayTimerStatus(0);
menu.setTitle(TEXT("Running"));
menu.setBar(TEXT(""), TEXT("STOP"));
lcd.update();
}
if(!timer.running) return FN_CANCEL;
if(key == FR_KEY)
{
menu.push();
menu.spawn((void*)timerStop);
return FN_JUMP;
}
return FN_CONTINUE;
}
示例5: factoryReset
volatile char factoryReset(char key, char first)
{
if(first)
{
lcd.cls();
lcd.writeString(14, 12, TEXT("Reset all"));
lcd.writeString(14, 22, TEXT("settings?"));
menu.setTitle(TEXT("Reset"));
menu.setBar(TEXT("CANCEL"), TEXT("RESET"));
lcd.update();
}
switch(key)
{
case FL_KEY:
return FN_CANCEL;
case FR_KEY:
settings_default();
menu.message(TEXT("Factory Reset"));
return FN_CANCEL;
}
return FN_CONTINUE;
}
示例6: sysStatus
volatile char sysStatus(char key, char first)
{
char* text;
if(first)
{
}
lcd.cls();
text = getChargingStatus();
char l = lcd.measureStringTiny(text);
lcd.writeStringTiny(80 - l, 6 + SY, text);
lcd.writeStringTiny(3, 6 + SY, TEXT("USB:"));
char buf[6];
uint16_t val;
val = (uint16_t)battery_percent;
int_to_str(val, buf);
text = buf;
l = lcd.measureStringTiny(text);
lcd.writeStringTiny(80 - l, 12 + SY, text);
lcd.writeStringTiny(3, 12 + SY, TEXT("Battery:"));
val = hardware_freeMemory();
int_to_str(val, buf);
text = buf;
l = lcd.measureStringTiny(text);
lcd.writeStringTiny(80 - l, 18 + SY, text);
lcd.writeStringTiny(3, 18 + SY, TEXT("Free RAM:"));
val = clock.seconds;
int_to_str(val, buf);
text = buf;
l = lcd.measureStringTiny(text);
lcd.writeStringTiny(80 - l, 24 + SY, text);
lcd.writeStringTiny(3, 24 + SY, TEXT("Clock s:"));
val = clock.ms;
int_to_str(val, buf);
text = buf;
l = lcd.measureStringTiny(text);
lcd.writeStringTiny(80 - l, 30 + SY, text);
lcd.writeStringTiny(3, 30 + SY, TEXT("Clock ms:"));
menu.setTitle(TEXT("Sys Status"));
menu.setBar(TEXT("RETURN"), BLANK_STR);
lcd.update();
_delay_ms(10);
if(key == FL_KEY || key == LEFT_KEY)
return FN_CANCEL;
return FN_CONTINUE;
}
示例7: timerStatusRemote
volatile char timerStatusRemote(char key, char first)
{
static uint32_t startTime = 0;
static uint8_t toggle = 0;
if(first)
{
startTime = 0;
}
if(clock.Ms() > startTime + 100)
{
startTime = clock.Ms();
lcd.cls();
if(toggle == 0)
remote.request(REMOTE_BATTERY);
else if(toggle == 1)
remote.send(REMOTE_BATTERY, REMOTE_TYPE_NOTIFY_SET);
else if(toggle == 2)
remote.request(REMOTE_START);
else
remote.request(REMOTE_STATUS);
if(++toggle >= 10) toggle = 2;
displayTimerStatus(1);
menu.setTitle(TEXT("Remote"));
if(remote.running)
menu.setBar(TEXT("RETURN"), TEXT("STOP"));
else
menu.setBar(TEXT("RETURN"), BLANK_STR);
lcd.update();
}
if(!remote.connected) return FN_CANCEL;
switch(key)
{
case FR_KEY:
remote.set(REMOTE_STOP);
break;
case FL_KEY:
case LEFT_KEY:
remote.send(REMOTE_BATTERY, REMOTE_TYPE_NOTIFY_UNSET);
toggle = 0;
return FN_CANCEL;
}
return FN_CONTINUE;
}
示例8: cableReleaseRemote
volatile char cableReleaseRemote(char key, char first)
{
static char status; //, cable;
if(first)
{
status = 0;
lcd.cls();
menu.setTitle(TEXT("BT Cable Remote"));
menu.setBar(TEXT("Bulb"), TEXT("Photo"));
lcd.update();
remote.set(REMOTE_BULB_END);
}
if(key == FL_KEY)
{
if(status != 1)
{
status = 1;
lcd.eraseBox(8, 18, 8 + 6 * 11, 26);
lcd.writeString(8, 18, TEXT("(BULB OPEN)"));
remote.set(REMOTE_BULB_START);
lcd.update();
} else
{
status = 0;
lcd.eraseBox(8, 18, 8 + 6 * 11, 26);
remote.set(REMOTE_BULB_END);
lcd.update();
}
}
else if(key == FR_KEY && status != 1)
{
status = 0;
lcd.eraseBox(8, 18, 8 + 6 * 11, 26);
remote.set(REMOTE_CAPTURE);
lcd.update();
}
else if(key != 0)
{
status = 0;
lcd.eraseBox(8, 18, 8 + 6 * 11, 26);
remote.set(REMOTE_BULB_END);
lcd.update();
}
if(key == LEFT_KEY || !remote.connected)
{
remote.set(REMOTE_BULB_END);
return FN_CANCEL;
}
return FN_CONTINUE;
}
示例9: firmwareUpdated
volatile char firmwareUpdated(char key, char first)
{
if(first)
{
uint8_t l, c;
char* text;
char buf[6];
lcd.cls();
menu.setTitle(TEXT("FIRMWARE"));
lcd.writeStringTiny(13, 10, TEXT("Successfully"));
lcd.writeStringTiny(25, 16, TEXT("Updated"));
lcd.writeStringTiny(8, 28, TEXT("Version:"));
uint32_t version = VERSION;
l = 0;
while(version)
{
c = (char)(version % 10);
buf[0] = ((char)(c + '0'));
buf[1] = 0;
text = buf;
l += lcd.measureStringTiny(text) + 1;
lcd.writeStringTiny(75 - l, 28, text);
version -= (uint32_t)c;
version /= 10;
}
menu.setBar(TEXT("RETURN"), BLANK_STR);
lcd.update();
}
switch(key)
{
case FL_KEY:
case LEFT_KEY:
return FN_CANCEL;
}
return FN_CONTINUE;
}
示例10: notYet
volatile char notYet(char key, char first)
{
if(first)
{
lcd.cls();
lcd.writeString(3, 7, TEXT("Sorry, this "));
lcd.writeString(3, 15, TEXT("feature has "));
lcd.writeString(3, 23, TEXT("not yet been "));
lcd.writeString(3, 31, TEXT("implemented "));
menu.setTitle(TEXT("Not Yet"));
menu.setBar(TEXT("RETURN"), BLANK_STR);
lcd.update();
}
if(key)
return FN_CANCEL;
return FN_CONTINUE;
}
示例11: memoryFree
volatile char memoryFree(char key, char first)
{
if(first)
{
unsigned int mem = hardware_freeMemory();
lcd.cls();
lcd.writeString(1, 18, TEXT("Free RAM:"));
/*char x =*/lcd.writeNumber(55, 18, mem, 'U', 'L');
//lcd.writeString(55 + x * 6, 18, TEXT("b"));
menu.setTitle(TEXT("Memory"));
menu.setBar(TEXT("RETURN"), BLANK_STR);
lcd.update();
}
if(key == FL_KEY)
return FN_CANCEL;
return FN_CONTINUE;
}
示例12: lightMeter
volatile char lightMeter(char key, char first)
{
static char held = 0;
if(first)
{
lcd.backlight(0);
hardware_flashlight(0);
}
if(!held)
{
lcd.cls();
menu.setTitle(TEXT("Light Meter"));
if(key == FR_KEY)
{
held = 1;
menu.setBar(TEXT("RETURN"), TEXT("RUN"));
}
else
{
menu.setBar(TEXT("RETURN"), TEXT("PAUSE"));
}
char buf[6] , l;
uint16_t val;
char* text;
val = (uint16_t)hardware_readLight(0);
int_to_str(val, buf);
text = buf;
l = lcd.measureStringTiny(text);
lcd.writeStringTiny(80 - l, 12 + SY, text);
lcd.writeStringTiny(3, 12 + SY, TEXT("Level 1:"));
val = (uint16_t)hardware_readLight(1);
int_to_str(val, buf);
text = buf;
l = lcd.measureStringTiny(text);
lcd.writeStringTiny(80 - l, 18 + SY, text);
lcd.writeStringTiny(3, 18 + SY, TEXT("Level 2:"));
val = (uint16_t)hardware_readLight(2);
int_to_str(val, buf);
text = buf;
l = lcd.measureStringTiny(text);
lcd.writeStringTiny(80 - l, 24 + SY, text);
lcd.writeStringTiny(3, 24 + SY, TEXT("Level 3:"));
lcd.update();
_delay_ms(10);
}
else
{
if(key == FR_KEY)
held = 0;
}
if(key == FL_KEY)
{
lcd.backlight(255);
return FN_CANCEL;
}
return FN_CONTINUE;
}
示例13: sysInfo
volatile char sysInfo(char key, char first)
{
if(first)
{
lcd.cls();
char l;
char* text;
char buf[6];
uint16_t val;
// Lines (Y) = 6, 12, 18, 24, 30
val = (uint16_t)bt.version();
text = TEXT("TLP01");
l = lcd.measureStringTiny(text);
lcd.writeStringTiny(80 - l, 6 + SY, text);
lcd.writeStringTiny(3, 6 + SY, TEXT("Model:"));
if(val > 1)
text = TEXT("BTLE");
else
text = TEXT("KS99");
l = lcd.measureStringTiny(text);
lcd.writeStringTiny(80 - l, 12 + SY, text);
lcd.writeStringTiny(3, 12 + SY, TEXT("Edition:"));
lcd.writeStringTiny(3, 18 + SY, TEXT("Firmware:"));
uint32_t version = VERSION;
char c;
l = 0;
while(version)
{
c = (char)(version % 10);
buf[0] = ((char)(c + '0'));
buf[1] = 0;
text = buf;
l += lcd.measureStringTiny(text) + 1;
lcd.writeStringTiny(80 - l, 18 + SY, text);
version -= (uint32_t)c;
version /= 10;
}
if(val > 1)
{
int_to_str(val, buf);
text = buf;
l = lcd.measureStringTiny(text);
lcd.writeStringTiny(80 - l, 30 + SY, text);
lcd.writeStringTiny(3, 30 + SY, TEXT("BT FW Version:"));
}
menu.setTitle(TEXT("System Info"));
menu.setBar(TEXT("RETURN"), BLANK_STR);
lcd.update();
}
if(key == FL_KEY || key == LEFT_KEY)
return FN_CANCEL;
return FN_CONTINUE;
}
示例14: btConnect
volatile char btConnect(char key, char first)
{
static uint8_t sfirst = 1;
uint8_t i;
static uint8_t menuSize;
static uint8_t menuSelected;
uint8_t c;
uint8_t update, menuScroll;
update = 0;
if(sfirst)
{
menuScroll = 0;
menuSelected = 0;
sfirst = 0;
update = 1;
if(bt.state != BT_ST_CONNECTED)
{
bt.advertise();
bt.scan();
}
}
switch(key)
{
case LEFT_KEY:
case FL_KEY:
sfirst = 1;
if(bt.state != BT_ST_CONNECTED) bt.sleep();
return FN_CANCEL;
case FR_KEY:
if(bt.state == BT_ST_CONNECTED)
{
bt.disconnect();
}
else
{
bt.connect(bt.device[menuSelected].addr);
}
break;
}
update = 1;
switch(bt.event)
{
case BT_EVENT_DISCOVERY:
debug(STR("dicovery!\r\n"));
break;
case BT_EVENT_SCAN_COMPLETE:
debug(STR("done!\r\n"));
if(bt.state != BT_ST_CONNECTED) bt.scan();
break;
case BT_EVENT_DISCONNECT:
bt.scan();
break;
default:
update = 0;
}
bt.event = BT_EVENT_NULL; // clear event so we don't process it twice
if(first)
{
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(bt.state == BT_ST_CONNECTED)
{
menu.setTitle(TEXT("Connect"));
lcd.writeStringTiny(18, 20, TEXT("Connected!"));
menu.setBar(TEXT("RETURN"), TEXT("DISCONNECT"));
}
else
{
if(menuSelected > 2)
menuScroll = menuSelected - 2;
menuSize = 0;
for(i = 0; i < bt.devices; i++)
{
if(i >= menuScroll && i <= menuScroll + 4)
{
//.........这里部分代码省略.........
示例15: usbPlug
volatile char usbPlug(char key, char first)
{
static char connected = 0;
if(first || (PTP_Connected != connected) || (PTP_Ready))
{
connected = PTP_Connected;
char exp_name[7];
if(PTP_Connected)
{
if(PTP_Ready)
{
lcd.cls();
lcd.writeString(3, 7, PTP_CameraModel);
if(camera.shutterName(exp_name, camera.shutter))
{
lcd.writeString(3, 15, exp_name);
}
if(camera.apertureName(exp_name, camera.aperture))
{
lcd.writeString(3, 23, TEXT("f"));
lcd.writeString(3+6, 23, exp_name);
}
if(camera.isoName(exp_name, camera.iso))
{
lcd.writeString(3, 31, TEXT("ISO"));
lcd.writeString(3+24, 31, exp_name);
}
menu.setTitle(TEXT("Camera Info"));
menu.setBar(TEXT("RETURN"), TEXT("PHOTO"));
lcd.update();
connectUSBcamera = 1;
}
else
{
lcd.cls();
lcd.writeString(3, 7, TEXT(" Connected! "));
lcd.writeString(3, 15, TEXT(" Retrieving "));
lcd.writeString(3, 23, TEXT(" Device "));
lcd.writeString(3, 31, TEXT(" Info... "));
menu.setTitle(TEXT("Camera Info"));
menu.setBar(TEXT("RETURN"), BLANK_STR);
lcd.update();
connectUSBcamera = 1;
}
}
else
{
lcd.cls();
lcd.writeString(3, 7, TEXT("Plug camera "));
lcd.writeString(3, 15, TEXT("into left USB"));
lcd.writeString(3, 23, TEXT("port... "));
lcd.writeString(3, 31, TEXT(" "));
menu.setTitle(TEXT("Connect USB"));
menu.setBar(TEXT("CANCEL"), BLANK_STR);
lcd.update();
connectUSBcamera = 1;
}
}
if(key == FL_KEY || key == LEFT_KEY)
{
if(!PTP_Connected)
connectUSBcamera = 0;
return FN_CANCEL;
}
else if(key == FR_KEY)
{
if(PTP_Ready) camera.capture();
}
else if(key == UP_KEY)
{
if(PTP_Ready) camera.isoUp(camera.iso);
}
else if(key == DOWN_KEY)
{
if(PTP_Ready) camera.isoDown(camera.iso);
}
return FN_CONTINUE;
}