本文整理汇总了C++中DisplayMenu函数的典型用法代码示例。如果您正苦于以下问题:C++ DisplayMenu函数的具体用法?C++ DisplayMenu怎么用?C++ DisplayMenu使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了DisplayMenu函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main() {
person persona[MAX_PERSON];
int num = 0, choice = 1;
DisplayMenu();
while (choice != 0)
{
cout << endl << "Enter command: ";
cin >> choice;
while (cin.fail()) {
cout << "Invalid input, enter number 0-7:";
cin.clear();
cin.ignore(256, '\n');
cin >> choice;
}
if (choice == 0) {
cout << "Goodbye" << endl;
return 0;
}
if (choice == 1) DisplayMenu();
if (choice == 2) AddPerson(persona, &num);
if (choice == 3) PrintPerson(persona, num);
if (choice == 4) PrintAllPersons(persona, num);
if (choice == 5) DeletePerson(persona, &num);
if (choice == 6) ExportToFile(persona, num);
if (choice == 7) ImportFromFile(persona, &num);
}
return 0;
}
示例2: main
/**
* \brief Application entry point for UART example.
*
* \return Unused (ANSI-C compatibility).
*/
extern int main(void)
{
uint8_t ucKey;
/* Disable watchdog */
WDT_Disable(WDT);
/* Output example information */
printf("-- UART Example %s --\n\r", SOFTPACK_VERSION);
printf("-- %s\n\r", BOARD_NAME);
printf("-- Compiled: %s %s With %s--\n\r", __DATE__, __TIME__, COMPILER_NAME);
/* Enable I and D cache */
SCB_EnableICache();
SCB_EnableDCache();
/* Display menu */
DisplayMenu();
while (1) {
ucKey = DBG_GetChar();
switch (ucKey) {
case 'h':
DisplayMenu();
break;
case 'i':
case 'I':
printf("\n\rSending Tx Buffer.. \n\r");
UartTransfer();
break;
case 'd':
case 'D':
memset(pRxBuffer,'X' ,30);
pRxBuffer[28] = '\n';
pRxBuffer[29] = '\r';
printf("\n\rRx Buffer before transfer is \n\r");
puts((char*)pRxBuffer);
_UartdConfigLB();
UARTD_EnableRxChannels(&Uartd, &UartRx);
UARTD_EnableTxChannels(&Uartd, &UartTx);
UARTD_RcvData(&Uartd);
UARTD_SendData(&Uartd);
printf("\n\rRx Buffer after transfer is \n\r");
while (Uartd.pRxChannel->sempaphore == 0);
puts((char*)pRxBuffer);
UARTD_DisableRxChannels(&Uartd, &UartRx);
UARTD_DisableTxChannels(&Uartd, &UartTx);
break;
default :
break;
}
}
}
示例3: main
/**
* \brief Application entry point for spi_slave example.
*
* \return Unused (ANSI-C compatibility).
*/
extern int main( void )
{
uint8_t ucKey ;
/* Disable watchdog */
WDT_Disable( WDT ) ;
/* Output example information */
printf( "-- spi slave example %s --\n\r", SOFTPACK_VERSION ) ;
printf( "-- %s\n\r", BOARD_NAME ) ;
printf( "-- Compiled: %s %s --\n\r", __DATE__, __TIME__ ) ;
/* Configure PIO Pins for SPI */
PIO_Configure( pSpiPins, PIO_LISTSIZE( pSpiPins ) ) ;
/* Configure SPI interrupts for Slave only*/
NVIC_DisableIRQ( SPI_IRQn ) ;
NVIC_ClearPendingIRQ( SPI_IRQn ) ;
NVIC_SetPriority( SPI_IRQn, 0 ) ;
NVIC_EnableIRQ( SPI_IRQn ) ;
SpiSlaveInitialize() ;
/* Display menu */
DisplayMenu() ;
while ( 1 )
{
ucKey = UART_GetChar() ;
switch ( ucKey )
{
case 'h' :
DisplayMenu() ;
break ;
case 't' :
SpiMasterGo() ;
break ;
default :
/* Set configuration #n */
if ( (ucKey >= '0') && (ucKey <= ('0' + NUM_SPCK_CONFIGURATIONS - 1)) )
{
SetClockConfiguration( ucKey - '0' ) ;
}
break ;
}
}
}
示例4: main
int main(int argc,char *argv[])
{
/* Initialize PSP */
pl_psp_init("cache0:/GENPlusVITA/");
pl_snd_init(SOUND_SAMPLES, 1);
pspCtrlInit();
pspVideoInit();
/* Initialize callbacks */
pl_psp_register_callback(PSP_EXIT_CALLBACK,
ExitCallback,
NULL);
pl_psp_start_callback_thread();
/* Start emulation */
InitMenu();
DisplayMenu();
TrashMenu();
/* Release PSP resources */
pl_snd_shutdown();
pspVideoShutdown();
pl_psp_shutdown();
return(0);
}
示例5: Alarm_Adjust
/*******************************************************************************
* Function Name : Alarm_Adjust
* Description : Adjusts an alarm event to occurs within the current day.
* Input : None
* Output : None
* Return : None
*******************************************************************************/
void Alarm_Adjust(void)
{
/* Disable the JoyStick interrupts */
IntExtOnOffConfig(DISABLE);
while(ReadKey() != NOKEY)
{
}
RCC_AHBPeriphClockCmd(RCC_AHBPeriph_FSMC, ENABLE);
/* Clear the LCD screen */
LCD_Clear(White);
LCD_SetDisplayWindow(160, 223, 128, 128);
LCD_NORDisplay(ALARM_ICON);
RCC_AHBPeriphClockCmd(RCC_AHBPeriph_FSMC, ENABLE);
/* Disable LCD Window mode */
LCD_WindowModeDisable();
Alarm_PreAdjust();
/* Clear the LCD */
LCD_Clear(White);
/* Display the menu */
DisplayMenu();
/* Enable the JoyStick interrupts */
IntExtOnOffConfig(ENABLE);
}
示例6: main
int main(int argc, char *argv[])
{
srand (time(NULL));
// Analyse des arguments et chargement des API
S_AIFunctions aiFunctions[2];
InitAIStruct(aiFunctions);
E_GameMode gameMode = ParseArgs(argc, argv, aiFunctions);
if (gameMode == ERROR)
return EXIT_FAILURE;
// Chargement de la fenetre
SDL_Surface *window = NULL;
SDL_Surface *icon = NULL;
if (!InitWindow(&window, &icon))
return EXIT_FAILURE;
// Affichage du menu
DisplayMenu(window, gameMode, aiFunctions);
// Liberation des ressources
FreeWindow(icon);
FreeAIStruct(aiFunctions);
return EXIT_SUCCESS;
}
示例7: main
int main(int argc, char **argv)
{
/* Initialize PSP */
pl_psp_init("ux0:/data/NeopopVITA/");
pl_snd_init(512,1);
pspCtrlInit();
pspVideoInit();
// show_splash();
#ifdef PSP_DEBUG
FILE *debug = fopen("message.txt", "w");
fclose(debug);
#endif
/* Initialize callbacks */
pl_psp_register_callback(PSP_EXIT_CALLBACK, ExitCallback, NULL);
pl_psp_start_callback_thread();
/* Show the menu */
if (InitMenu())
{
DisplayMenu();
TrashMenu();
}
/* Release PSP resources */
pl_snd_shutdown();
pspVideoShutdown();
pl_psp_shutdown();
return(0);
}
示例8: DisplayMenu
void cSatipMenuInfo::Display(void)
{
cOsdMenu::Display();
DisplayMenu()->SetText(textM, true);
if (*textM)
cStatus::MsgOsdTextItem(textM);
}
示例9: main
/***
* Main entrypoint of the emulator
*/
int main()
{
// first, initialize Vita2D
printf("Starting CATSFC-libretro-VITA");
vita2d_init_advanced(8 * 1024 * 1024);
// do some setup
setup_input();
setup_callbacks();
setup_audio();
pl_psp_init("ux0:/data/CATSFC-libretro-VITA/");
// get the game ready
if (InitMenu())
{
DisplayMenu();
TrashMenu();
}
// once emulation is complete, shut down and exit
vita_cleanup();
sceKernelExitProcess(0);
return 0;
}
示例10: SAssignNew
void APacmanMainMenuHUD::PostInitializeComponents()
{
Super::PostInitializeComponents();
SAssignNew(MainMenuWidget, SPacmanMainMenuWidget).HUD(this);
DisplayMenu(MainMenuWidget.ToSharedRef());
}
示例11: Mass_Storage_Start
/*******************************************************************************
* Function Name : Mass_Storage_Start
* Description : Starts the mass storage demo.
* Input : None
* Output : None
* Return : None
*******************************************************************************/
void Mass_Storage_Start (void)
{
/* Disble the JoyStick interrupts */
IntExtOnOffConfig(DISABLE);
/* Clear the LCD screen */
LCD_Clear(White);
LCD_SetDisplayWindow(160, 223, 128, 128);
LCD_DrawBMP(0x00647C00);
/* Disable LCD Window mode */
LCD_WindowModeDisable();
/* Set the Back Color */
LCD_SetBackColor(Blue);
/* Set the Text Color */
LCD_SetTextColor(White);
if(MSD_Init() != 0x00)
{
LCD_DisplayStringLine(Line8, " No MSD Card Present");
LCD_DisplayStringLine(Line9, " To exit Press SEL ");
/* Loop until SEL key pressed */
while(ReadKey() != SEL)
{
}
}
else
{
Get_Medium_Characteristics();
/* Display the " Plug the USB " message */
LCD_DisplayStringLine(Line8, " Plug the USB Cable ");
LCD_DisplayStringLine(Line9, "Exit: Push JoyStick");
/* Intialize the USB cell */
USB_Init();
LCD_ClearLine(Line9);
/* Display the "To stop Press SEL" message */
LCD_DisplayStringLine(Line8, " To stop Press SEL ");
/* Loop until SEL key pressed */
while(ReadKey() != SEL)
{
}
PowerOff();
}
LCD_Clear(White);
DisplayMenu();
IntExtOnOffConfig(ENABLE);
/* Flush SPI1 Data Register */
SPI_I2S_ReceiveData(SPI1);
}
示例12: MenuSelection
void MenuSelection() {
DisplayMenu();
GetSelection();
if (selection != 5)
ImplementSelection();
}
示例13: assert
void TopMenu::OnMenuSelect2(IBaseMenu *menu, int client, unsigned int item, unsigned int item_on_page)
{
const char *item_name = menu->GetItemInfo(item, NULL);
if (!item_name)
{
return;
}
topmenu_object_t *obj;
topmenu_player_t *pClient = &m_clients[client];
if (!m_ObjLookup.retrieve(item_name, &obj))
return;
/* We now have the object... what do we do with it? */
if (obj->type == TopMenuObject_Category)
{
/* If it's a category, the user wants to view it.. */
assert(obj->cat_id < m_Categories.size());
assert(m_Categories[obj->cat_id]->obj == obj);
pClient->last_root_pos = item_on_page;
if (!DisplayCategory(client, obj->cat_id, MENU_TIME_FOREVER, false))
{
/* If we can't display the category, re-display the root menu.
* This code should be dead as of bug 3256, which disables categories
* that cannot be displayed.
*/
DisplayMenu(client, MENU_TIME_FOREVER, TopMenuPosition_LastRoot);
}
}
else
{
pClient->last_position = item_on_page;
/* Re-check access in case this user had their credentials revoked */
if (obj->cmdname[0] != '\0' && !adminsys->CheckAccess(client, obj->cmdname, obj->flags, false))
{
DisplayMenu(client, 0, TopMenuPosition_LastCategory);
return;
}
/* Pass the information on to the callback */
obj->callbacks->OnTopMenuSelectOption(this, client, obj->object_id);
}
}
示例14: main
int main(void)
{
unsigned int switchPressed;
debug_init(SOFTWARE_NAME);
PIO_InitializeInterrupts(AT91C_AIC_PRIOR_LOWEST);
switches_init();
char_display_init();
LED_Configure(0);
LED_Configure(1);
if (! BCAN_Init(1000, 0, NULL)) {
printf("INIT FAIL");
LED_Set(1);
return 1;
}
printf("INIT OK\n\r");
LED_Set(0);
BCAN_InitMailboxRegisters( 0, 1, 0x0, (0x5AC << 18), AT91C_CAN_MOT_TX, 0x0);
while(1) {
DisplayMenu();
switchPressed = -1;
while (switchPressed == -1) {
if (switches_pressed(0)) {
TRACE_INFO("Switch 0 is pressed\n\r");
switchPressed = 0;
} else if (switches_pressed(1)) {
TRACE_INFO("Switch 1 is pressed\n\r");
switchPressed = 1;
} else if (switches_pressed(2)) {
TRACE_INFO("Switch 2 is pressed\n\r");
switchPressed = 2;
} else if (switches_pressed(3)) {
TRACE_INFO("Switch 3 is pressed\n\r");
switchPressed = 3;
} else {
//TRACE_INFO("No Switch is pressed\n\r");
}
char_display_tick();
for (volatile unsigned int i = 0xFF; i > 0; i--) ;
}
unsigned int result = -1;
while (result != CAN_STATUS_SUCCESS) {
result = BCAN_Write(0, 1, 0, switchPressed, 0x1);
}
char_display_number(switchPressed);
}
return 0;
}
示例15: SetScanType
void MythBDPlayer::DisplayPauseFrame(void)
{
if (player_ctx->buffer->IsBD() &&
player_ctx->buffer->BD()->IsInStillFrame())
{
SetScanType(kScan_Progressive);
}
DisplayMenu();
MythPlayer::DisplayPauseFrame();
}