本文整理汇总了C++中display_menu函数的典型用法代码示例。如果您正苦于以下问题:C++ display_menu函数的具体用法?C++ display_menu怎么用?C++ display_menu使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了display_menu函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: main
int main (void) {
int command;
display_menu ();
printf("Enter a command from above menu:");
scanf("%d", &command);
switch (command) {
case 0:
display_menu ();
break;
case 1:
copy ();
display_menu ();
break;
case -1:
return 0;
default:
printf("Invalid choice\n");
break;
}
printf("\n");
printf("\n");
return 0;
}
开发者ID:kushalkoolwal,项目名称:c_programs,代码行数:26,代码来源:unix_utils.c
示例2: dma_callback
/**
* \brief DMA callback function for transfer complete.
*/
static void dma_callback(struct dma_resource* const resource)
{
transfer_is_done = true;
dma_break++;
if (true == is_scrolling) {
/* Used for automatically exit implementation */
if ((dma_block_count * 4) <= dma_break) {
dma_break = 0;
/* Stop Automated character mode */
xpro_lcd_automated_char_stop();
printf("Exits from scrolling mode.\n\n\r");
display_menu();
}
}
if (true == is_bitmapping) {
/* Used for automatically exit implementation */
if ((bitmapping_repeat_count) <= dma_break) {
dma_break = 0;
/* Stop Automated bit mode */
xpro_lcd_automated_bit_stop();
printf("Exits from Bit mapping mode.\n\n\r");
display_menu();
}
}
}
开发者ID:thegeek82000,项目名称:asf,代码行数:29,代码来源:main.c
示例3: main
/**
* \brief Application entry point for SPI example.
*
* \return Unused (ANSI-C compatibility).
*/
int main(void)
{
uint8_t uc_key;
/* Initialize the SAM system. */
sysclk_init();
board_init();
/* Initialize the console UART. */
configure_console();
/* Output example information. */
puts(STRING_HEADER);
/* Configure SPI interrupts for slave only. */
NVIC_ClearPendingIRQ(SPI_IRQn);
NVIC_DisableIRQ(SPI_IRQn);
NVIC_SetPriority(SPI_IRQn, 0);
NVIC_EnableIRQ(SPI_IRQn);
spi_slave_initialize();
spi_xdmac_configure(SPI0);
/* Display menu. */
display_menu();
while (1) {
scanf("%c", (char *)&uc_key);
switch (uc_key) {
case 'h':
display_menu();
break;
case 't':
spi_disable_xdmac();
NVIC_ClearPendingIRQ(SPI_IRQn);
NVIC_DisableIRQ(SPI_IRQn);
NVIC_SetPriority(SPI_IRQn, 0);
NVIC_EnableIRQ(SPI_IRQn);
spi_master_go();
break;
default:
/* Set configuration #n. */
if ((uc_key >= '0')
&& (uc_key <= ('0' + NUM_SPCK_CONFIGURATIONS - 1))) {
spi_set_clock_configuration(uc_key - '0');
}
break;
}
}
}
开发者ID:thegeek82000,项目名称:asf,代码行数:58,代码来源:spi_xdmac_example.c
示例4: switch
void STLMoblet::keyPressEvent(int keyCode)
{
switch(keyCode)
{
case MAK_BACK:
maExit(0);
break;
case MAK_0:
STL_containers();
display_menu();
break;
case MAK_1:
functors_explained();
STL_functors();
display_menu();
break;
case MAK_2:
pointer_adapters_explained();
STL_adaptors();
display_menu();
break;
case MAK_3:
predicates_explained();
display_menu();
break;
case MAK_4:
STL_algorithms();
display_menu();
break;
case MAK_5:
STL_string();
display_menu();
break;
case MAK_6:
aux_functions();
display_menu();
break;
case MAK_7:
STL_auto_ptr();
display_menu();
break;
case MAK_8:
STL_pair();
display_menu();
break;
case MAK_9:
STL_iterators();
display_menu();
break;
}
}
开发者ID:Felard,项目名称:MoSync,代码行数:52,代码来源:STLMoblet.cpp
示例5: main
/**
* \brief The main function.
*/
int main(void)
{
uint8_t key;
/* Initialize the SAM system */
sysclk_init();
board_init();
/* Initialize the console */
configure_console();
/* Output example information */
printf("-- AES Example --\r\n");
printf("-- %s\n\r", BOARD_NAME);
printf("-- Compiled: %s %s --\n\r", __DATE__, __TIME__);
/* Enable the AES module. */
aes_get_config_defaults(&g_aes_cfg);
aes_init(AES, &g_aes_cfg);
aes_enable();
/* Enable AES interrupt. */
aes_enable_interrupt(AES, AES_INTERRUPT_DATA_READY);
/* Display menu */
display_menu();
while (1) {
scanf("%c", (char *)&key);
switch (key) {
case 'h':
display_menu();
break;
case 'e':
printf("GCM mode encryption test.\r\n");
gcm_mode_encryption_test();
break;
case 'd':
printf("GCM mode decryption test.\r\n");
gcm_mode_decryption_test();
break;
default:
break;
}
}
}
开发者ID:thegeek82000,项目名称:asf,代码行数:53,代码来源:gcm_example.c
示例6: main_platform
void main_platform() {
if(button_read_button(&down_btn)) {
if(is_view(gfx_mono_active_menu)) {
if(gfx_mono_active_menu != NO_GPS_VIEW) {
display_next_view();
}
}
// If it's not a view then the down button should be used for menu navigation.
else {
gfx_mono_menu_process_key(&menu_list[gfx_mono_active_menu-(VIEW_MAX_INDEX+1)], GFX_MONO_MENU_KEYCODE_DOWN);
ssd1306_write_display();
}
}
if(button_read_button(&select_btn)) {
if(is_view(gfx_mono_active_menu)) {
ssd1306_clear_display();
display_menu(MAIN_MENU);
}
else {
volatile uint8_t menuChoice = gfx_mono_menu_process_key(&menu_list[gfx_mono_active_menu-(VIEW_MAX_INDEX+1)], GFX_MONO_MENU_KEYCODE_ENTER);
menu_link menu = menu_list[gfx_mono_active_menu-(VIEW_MAX_INDEX+1)].element_links[menuChoice];
// TODO: Skriv om snyggare :)
if(menu == EXIT_MENU) {
menu_list[gfx_mono_active_menu-(VIEW_MAX_INDEX+1)].current_page = 0;
menu_list[gfx_mono_active_menu-(VIEW_MAX_INDEX+1)].current_selection = 0;
if(is_view(menu_list[gfx_mono_active_menu-(VIEW_MAX_INDEX+1)].parent)) {
display_view(menu_list[gfx_mono_active_menu-(VIEW_MAX_INDEX+1)].parent);
}
else {
menu = menu_list[gfx_mono_active_menu-(VIEW_MAX_INDEX+1)].parent;
display_menu(menu);
}
}
else {
display_menu(menu);
}
}
}
}
开发者ID:skrutt,项目名称:longboard,代码行数:48,代码来源:bike.c
示例7: process_input
static Uint8 process_input(SDL_Scancode const *s, t_menuentries *item)
{
t_menuentries old_item;
old_item = *item;
*item += (*s == get_input(UP_INP)->code && *item != START_MEN) ? -1 : 0;
*item += (*s == get_input(DOWN_INP)->code && *item != SCORE_MEN) ? 1 : 0;
if (*s == get_input(RETURN_INP)->code)
{
play_sfx(get_common_sfx(BLIPCANCEL_SFX));
set_launcher(&space_destroy);
}
else if (*s == get_input(START_INP)->code)
{
if (entries[*item].enabled)
{
play_sfx(get_common_sfx(BLIPOK_SFX));
set_launcher(entries[*item].callback);
}
}
if (*item != old_item)
{
display_menu();
play_sfx(get_common_sfx(BLIPSEL_SFX));
return (1);
}
return (0);
}
开发者ID:d0nn13,项目名称:MASHUG,代码行数:28,代码来源:menu.c
示例8: set_afec_resolution
/**
* \brief Set AFEC resolution mode.
*/
static void set_afec_resolution(void)
{
uint8_t uc_key;
uint8_t uc_done = 0;
display_menu();
while (!uc_done) {
while (uart_read(CONF_UART, &uc_key));
switch (uc_key) {
case 'n':
g_max_digital = MAX_DIGITAL_12_BIT;
afec_set_resolution(AFEC0, AFEC_12_BITS);
puts(" Set Resolution to Normal \n\r");
break;
case 'e':
g_max_digital = MAX_DIGITAL_12_BIT * 16;
afec_set_resolution(AFEC0, AFEC_16_BITS);
puts(" Set Resolution to Enhanced \n\r");
break;
case 'q':
uc_done = 1;
puts(" Quit Configuration \n\r");
break;
default:
break;
}
}
}
开发者ID:thegeek82000,项目名称:asf,代码行数:33,代码来源:afec_example2.c
示例9: show_bmarks_menu
int
show_bmarks_menu(FileView *view, const char tags[], int go_on_single_match)
{
static menu_info m;
init_menu_info(&m, strdup("Bookmarks"), strdup("No bookmarks found"));
m.execute_handler = &execute_bmarks_cb;
m.key_handler = &bmarks_khandler;
if(is_null_or_empty(tags))
{
bmarks_list(&bmarks_cb, &m);
}
else
{
bmarks_find(tags, &bmarks_cb, &m);
}
if(go_on_single_match && m.len == 1)
{
goto_selected_file(view, m.items[m.pos], 0);
reset_popup_menu(&m);
return curr_stats.save_msg;
}
return display_menu(&m, view);
}
开发者ID:dennishamester,项目名称:vifm,代码行数:26,代码来源:bmarks_menu.c
示例10: show_volumes_menu
int
show_volumes_menu(FileView *view)
{
TCHAR c;
TCHAR vol_name[MAX_PATH];
TCHAR file_buf[MAX_PATH];
static menu_info m;
init_menu_info(&m, VOLUMES, strdup("No volumes mounted"));
m.title = strdup(" Mounted Volumes ");
for(c = TEXT('a'); c < TEXT('z'); c++)
{
if(drive_exists(c))
{
TCHAR drive[] = TEXT("?:\\");
drive[0] = c;
if(GetVolumeInformation(drive, vol_name, MAX_PATH, NULL, NULL, NULL,
file_buf, MAX_PATH))
{
char item_buf[MAX_PATH + 5];
snprintf(item_buf, sizeof(item_buf), "%s %s ", drive, vol_name);
m.len = add_to_string_array(&m.items, m.len, 1, item_buf);
}
}
}
return display_menu(&m, view);
}
开发者ID:ackeack,项目名称:workenv,代码行数:29,代码来源:volumes_menu.c
示例11: inheritance_menu
static void inheritance_menu(ostream &out, istream &in)
{
int choice ;
static FrInheritanceType types[] =
{ NoInherit, InheritSimple,
InheritDFS, InheritBFS,
InheritLocalDFS,
} ;
static const char *type_name[] = { "None", "Simple", "DFS", "BFS",
"Local-DFS"
} ;
out << "Select inheritance type (currently "
<< type_name[get_inheritance_type()] << "):" << endl ;
choice = display_menu(out,in,false,lengthof(types),
0,
"\t1. None\n"
"\t2. Simple IS-A lookup\n"
"\t3. Full Depth-First Search\n"
"\t4. Breadth-First Search\n"
"\t5. Per-slot inheritance, then full DFS\n"
) ;
set_inheritance_type(types[choice-1]) ;
return ;
}
开发者ID:tripleee,项目名称:la-strings,代码行数:25,代码来源:testfp.C
示例12: main_menu
void main_menu() {
int selected_menu_entry;
do {
selected_menu_entry = display_menu();
if(selected_menu_entry == 1) {
// run the game
run();
} else if(selected_menu_entry == 2) {
// display the highscores
show_highscores();
} else if(selected_menu_entry == 3) {
// display a dialog which explains the controls of the game
display_controls();
} else if(selected_menu_entry == 4) {
// display a dialog which explains the elements of the game
display_help();
} else if(selected_menu_entry == 5) {
// clear highscores
if(clear_score_dialog() == 1) {
clear_highscore();
}
}
// leave if the menu entry "exit" is chosen
} while(selected_menu_entry != 6);
}
开发者ID:oamldev,项目名称:msnake_oaml,代码行数:25,代码来源:main.c
示例13: menu_run
/**
* \brief Read user input and execute menu selection
*/
void menu_run(void)
{
static unsigned int value = 0;
int c = uart_getchar();
if ((c >= '0') && (c <= '9')) {
value *= 10;
value += c - '0';
uart_putchar(c);
} else if ((c == '\n') || (c == '\r')) {
if ((value > 0) && (value <= _current_menu_size)) {
/* Invoke the callback */
if (_current_menu[value - 1].handler != NULL) {
uart_puts("\n");
if (_current_menu[value - 1].handler() != 0) {
uart_puts("\nError\n");
}
}
} else {
uart_puts("\nInvalid selection\n");
}
display_menu();
value = 0;
} else {
/* Not a valid character */
}
}
开发者ID:emcute0319,项目名称:msp430_launchpad,代码行数:31,代码来源:menu.c
示例14: main
//---------main-------------------
int main(){
char end;
int operation;
do{
display_menu();
scanf("%d",&operation);
switch(operation){
case 1 :
display_list();
break;
case 2 :
push();
break;
case 3 :
pop();
break;
default :
printf("Error : Wronge number entered.\n");
break;
}
printf("\n\nDo you want to end program? Enter 'y' or 'n' : ");
end=getche();
printf("\n\n");
}while(end!='y');
}
开发者ID:h4s33b,项目名称:os_simulations,代码行数:29,代码来源:stack.cpp
示例15: main
/*
* The hash table is to keep track of leaves which have already been displayed
* to the user.
*/
int main(int argc, char **argv)
{
int i;
/* Initialize space for blacklist hash table */
if(hcreate(10000)==0) {
fputs("Cannot create hash table.\n",stderr);
return(EX_UNAVAILABLE);
}
i=0;
do {
if(read_pkglist(i++))
break;
if(display_menu())
break;
if(remove_packages())
break;
free_menu();
} while(keep_going());
hdestroy();
fputs("\nProgram Terminated Successfully\n",stderr);
return(0);
}
开发者ID:freenas,项目名称:ports,代码行数:29,代码来源:pkg_cleanup.c
示例16: load_gui
void load_gui(SDL_Surface *sdl_screen) {
static Uint8 *keystate;
int play = 0;
if(load_bmp("fonts/gui_font.bmp") == -1) {
printf("Loading bmp font error\n");
}
bg_color = SDL_MapRGB(sdl_screen->format, 255, 255, 255);
display_menu(sdl_screen);
cursor_pos = 0;
while (!play) {
SDL_PumpEvents();
keystate = SDL_GetKeyState(NULL);
if(keystate[SDLK_UP]) {
move_cursor(sdl_screen, UP);
}
if(keystate[SDLK_DOWN]) {
if(strcmp(selected_game, "") == 0 && cursor_pos < 2) move_cursor(sdl_screen, DOWN);
else if (strcmp(selected_game, "") != 0 && cursor_pos < 3) move_cursor(sdl_screen, DOWN);
}
if(keystate[SDLK_RETURN]) play = menu_action(sdl_screen);
if(keystate[SDLK_ESCAPE]) break;
SDL_Flip(sdl_screen);
SDL_Delay(100);
}
}
开发者ID:joakim-d,项目名称:GroBoy,代码行数:27,代码来源:menu.c
示例17: menu_action
int menu_action(SDL_Surface *sdl_screen) {
char destination[0xFFFF];
int action;
action = (strcmp(selected_game, "") != 0)? cursor_pos: cursor_pos + 1;
if(action == 0) {
return 1;
}
if(action == 1) {
if(getcwd(cwd, sizeof(cwd)) != NULL) {
navigate(sdl_screen, cwd, destination);
while(strcmp(destination, "") != 0 && strcmp(destination + strlen(destination) - 3, ".gb") != 0) {
strcpy(cwd, destination);
navigate(sdl_screen, cwd, destination);
}
if(strcmp(destination + strlen(destination) - 3, ".gb") == 0) {
strcpy(selected_game,destination);
}
cursor_pos = 0;
display_menu(sdl_screen);
}
else {
printf("Error when getting current directory\n");
}
}
else if(action == 2) {
keyboard_conf(sdl_screen);
}
/*else if(action == 3){
joystick_conf(sdl_screen);
}*/
else if(action == 3) {
exit(1);
}
return 0;
}
开发者ID:joakim-d,项目名称:GroBoy,代码行数:35,代码来源:menu.c
示例18: popup
int popup( char* menu[], char* keys, int count, int x, int y, int border )
/*弹出式菜单的显示*/
{
register int i, len;
int endx, endy, choice;
unsigned int *p;
if((x>24)||(x<0)||(y>79)||(y<0))
{
printf("范围错");
return -2;
}
len = 0;
for( i = 0; i < count; i++ )
if( strlen( menu[i]) > len ) len = strlen( menu[i] );
endy = len + 2 + y;
endx = count + 1 + x;
if((endx+1>24)||(endy+1>79))
{
printf("菜单不匹配");
return -2;
}
p = (unsigned int *) malloc((endx-x+1)*(endy-y+1));
if( !p ) exit(1);
save_video( x, endx + 1, y, endy+1, p );
if( border ) disp_box( y, x, endy, endx, YELLOW );
display_menu( menu, x + 1, y + 1, count );
choice = get_resp( x + 1, y, count, menu, keys );
restore_video( x, endx + 1, y, endy + 2, (unsigned char* ) p);
free( p );
return choice;
}
开发者ID:13436120,项目名称:Cgames,代码行数:31,代码来源:163.C
示例19: main
int main(int argc, char *argv[])
{
MemoryManagement manager;
char choice;
while(1){
display_menu();
std::cout << "What do you want?" << std::endl;
choice = getchar();
switch(choice) {
case '1':manager.SetMemSize();system("clear");break;
case '2':manager.SetAlgorithm();manager.flag = 1;system("clear");break;
case '3':manager.NewProcess();manager.flag = 1;system("clear");break;
case '4':manager.KillProcess();manager.flag = 1;system("clear");break;
case '5':manager.DisplayMemoryUsage();manager.flag = 1;break;
case '0':exit(1);break;
default:break;
}
/*
std::cout << "Manager Size:" << manager.mem_size << std::endl;
std::cout << "Manager Algorithm:" << manager.ma_algorith << std::endl;
std::cout << "Manager Pid:" << manager.pid << std::endl;
std::cout << "Manager flag:" << manager.flag << std::endl;
*/
}
return EXIT_SUCCESS;
}
开发者ID:lilinhan,项目名称:code,代码行数:26,代码来源:MemoryMain.cpp
示例20: display_menu
// Disp a specific screen
void DisplayManager::display() {
lcd.clear(); lcd.setCursor(0, 0);
if (display_mode == -2) {
display_menu();
return;
}
switch (display_mode) {
case DATETIME:
display_datetime();
break;
case POSITION:
display_position();
break;
case ALTITUDE:
display_altitude();
break;
case BATTERYM:
display_battery();
break;
default:
lcd.print(satellites);
lcd.setCursor(0, 1);
lcd.print(iterations);
return;
}
}
开发者ID:Darkin47,项目名称:GPS-IF23-UTT,代码行数:33,代码来源:DisplayManager.cpp
注:本文中的display_menu函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论