当前位置: 首页>>代码示例>>C++>>正文


C++ draw_menu函数代码示例

本文整理汇总了C++中draw_menu函数的典型用法代码示例。如果您正苦于以下问题:C++ draw_menu函数的具体用法?C++ draw_menu怎么用?C++ draw_menu使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了draw_menu函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: s_ctk_draw_menus

/*-----------------------------------------------------------------------------------*/
static void
s_ctk_draw_menus(struct ctk_menus *menus)
{
  struct ctk_menu *m;
  
  /* Draw menus */
  hires_color(ctk_hires_theme.menucolor); 
  hires_gotoxy(0, 0);
  hires_revers(0);
  ctk_hires_cputc(' ');
  for(m = menus->menus->next; m != NULL; m = m->next) {
    if(m != menus->open) {
      ctk_hires_cputsn(m->title, m->titlelen);
      ctk_hires_cputc(' ');
    } else {     
      draw_menu(m);
    }
  }
  ctk_hires_cclear(SCREEN_WIDTH - hires_wherex() -
		      strlen(menus->desktopmenu->title) - 1);
  
  /* Draw desktopmenu */  
  if(menus->desktopmenu != menus->open) {
    ctk_hires_cputsn(menus->desktopmenu->title,
			menus->desktopmenu->titlelen);
    ctk_hires_cputc(' ');
  } else {
    draw_menu(menus->desktopmenu);
  }

}
开发者ID:ZhepingYang,项目名称:contiki-1.x,代码行数:32,代码来源:ctk-hires-service.c

示例2: menu_over

int				menu_over(t_game *g)
{
	int		key;

	init_display();
	wrefresh(stdscr);
	g->display_choose = 0;
	draw_menu(g);
	while ((key = getch()))
	{
		if (key == 10 && g->display_choose == 0)
		{
			retry(g);
			ft_init_map(g);
			return (endwin(), 1);
		}
		if (key == 10 && g->display_choose == 1)
			menu_hightscores(g);
		if (key == 10 && g->display_choose == 2)
			return (endwin(), 0);
		func_choose(g, key);
		draw_menu(g);
	}
	return (1);
}
开发者ID:MickaelBlet,项目名称:42_Rush,代码行数:25,代码来源:menu_over.c

示例3: search_menu_list

int
search_menu_list(const char *pattern, menu_info *m)
{
	int save = 0;
	int i;

	if(pattern != NULL)
	{
		m->regexp = strdup(pattern);
		if(search_menu(m, m->pos) != 0)
		{
			draw_menu(m);
			move_to_menu_pos(m->pos, m);
			return 1;
		}
		draw_menu(m);
	}

	for(i = 0; i < search_repeat; i++)
		switch(m->match_dir)
		{
			case NONE:
				save = search_menu_forwards(m, m->pos + 1);
				break;
			case UP:
				save = search_menu_backwards(m, m->pos - 1);
				break;
			case DOWN:
				save = search_menu_forwards(m, m->pos + 1);
				break;
			default:
				break;
		}
	return save;
}
开发者ID:ackeack,项目名称:workenv,代码行数:35,代码来源:menu.c

示例4: ctk_draw_menus

/*-----------------------------------------------------------------------------------*/
void
ctk_draw_menus(struct ctk_menus *menus)
{
  struct ctk_menu *m;

  /* Draw menus */
  (void)textcolor(MENUCOLOR);
  gotoxy(0, 0);
  revers(1);
  cputc(' ');
  for(m = menus->menus->next; m != NULL; m = m->next) {
    draw_menu(m, m == menus->open);
  }

  /* Draw desktopmenu */
  if(wherex() + strlen(menus->desktopmenu->title) + 1 >= sizex) {
    gotoxy(sizex - (unsigned char)strlen(menus->desktopmenu->title) - 1, 0);
  } else {
    cclear(sizex - wherex() -
	   (unsigned char)strlen(menus->desktopmenu->title) - 1);
  }
  draw_menu(menus->desktopmenu, menus->desktopmenu == menus->open);

  revers(0);
}
开发者ID:Inscribe,项目名称:msp430xf1611,代码行数:26,代码来源:ctk-conio.c

示例5: execute_file_menu

void execute_file_menu(int choice,const char * choice_name, char * folder){
    char file[strlen(choice_name)];
    char folder_complet[strlen(folder)+strlen(file)+1];
    
    strcpy(file, choice_name);
    
    strcpy(folder_complet, folder);
    strcat(folder_complet, file);
    
    
    if(exists(folder_complet) == 1){
         
         mvprintw(LINES-2, 0, "                                                        ");
         mvprintw(LINES-1, 0, "%s                                                                ", folder_complet);
         display_execution(6, mem, taille_mem, reg, taille_reg, 1, 2, 3);
        
    }
    else if(exists(folder_complet) == 2){
        strcat(folder_complet, "/");
        int i;
        char ** files = list_file(folder_complet, &i);
        mvprintw(LINES-1, 0, "Dossier:  %s                                                        ", folder_complet);
        draw_menu(files, execute_file_menu, folder_complet, i);
    }
    else{
        mvprintw(LINES-1, 0, "Une erreur s'est produite lors de l'ouverture du fichier. Retour à ./");
        int i;
        char ** files = list_file("", &i);
        draw_menu(files, execute_file_menu, "", i);
    }

}
开发者ID:yoda1490,项目名称:procsi_emul,代码行数:32,代码来源:interface.c

示例6: draw_menu

void PlayerMenu::draw(bool left_side, const Scene& scene, SDL_Renderer* renderer)
{
	if (left_side)
	{
		draw_menu(left_side_, renderer);
	}
	else
	{
		draw_menu(right_side_, renderer);
	}
}
开发者ID:0n0dera,项目名称:RedEmblem,代码行数:11,代码来源:player_menu.cpp

示例7: menu_draw_row_callback

static void menu_draw_row_callback(GContext *ctx, const Layer *cell_layer, MenuIndex *cell_index, void *data) {
  if (cell_index->row == GAME_INDEX) {
    draw_menu(ctx, cell_layer, "Play", game_icon);
  } else if (cell_index->row == INSTRUCTION_INDEX) {
    draw_menu(ctx, cell_layer, "Instructions", NULL);
  } else if (cell_index->row == SETTINGS_INDEX) {
    draw_menu(ctx, cell_layer, "Settings", NULL);
  } else if (cell_index->row == ABOUT_INDEX) {
    draw_menu(ctx, cell_layer, "About", NULL);
  }
}
开发者ID:runnersaw,项目名称:pebble-chess,代码行数:11,代码来源:instructionHandler.c

示例8: init_gui

int init_gui()
{	WIN win;
	int ch;
        int i;
        char ** files;

	initscr();			/* Start curses mode 		*/
	start_color();			/* Start the color functionality */
	cbreak();			/* Line buffering disabled, Pass on
					 * everty thing to me 		*/
	keypad(stdscr, TRUE);		/* I need that nifty F1 	*/
	noecho();
	init_pair(1, COLOR_CYAN, COLOR_BLACK);
        init_pair(2, COLOR_GREEN, COLOR_BLACK);

	/* Initialize the window parameters */
	init_win_params(&win);
	print_win_params(&win);

	attron(COLOR_PAIR(1));
        printw("F2: Ouvrir un fichier");
        printw("\t F3: Lancer l'émulation");
	printw("\t F5: Quitter");
        attron(A_BOLD);
        attron(COLOR_PAIR(2));
        char chaine[]="Welcome to ProcSI emulator";
        mvprintw((LINES/2) -3,(COLS-strlen(chaine))/2,chaine);
        attroff(A_BOLD);
	refresh();
	attroff(COLOR_PAIR(1));
	
	create_box(&win, TRUE);
        draw_menu(choices, execute_main_menu, "", 3);
        
	while((ch = getch()) != KEY_F(5))
	{
            switch(ch)
	    {	case KEY_F(5):
                        mvprintw(LINES-2, 0, "Exiting...");
                        endwin();			/* End curses mode		  */
                        exit(0);
            
                case KEY_F(2):
                        files = list_file("", &i);
                        draw_menu(files, execute_file_menu, "", i);
            }
            
	}
	endwin();			/* End curses mode		  */
	return 0;
}
开发者ID:yoda1490,项目名称:procsi_emul,代码行数:51,代码来源:interface.c

示例9: main

int main(void)
{

	char menu[ROW][COL]={"Enter Data","Linear Search","Binary Search","Find Biggest",
			 "Find Smallest","Find 2nd Biggest","Find 2nd Smallest","Selection Sort","bubble_sort",
			 "insertion_sort","Free Data","Exit"};
	char ch;
	int choice,flag;


	flag=0;
	choice=0;
	init_menu();

	do
	{
		draw_menu(20,8,choice,menu);
		ch=getch();
		choice=check_hotkeys(ch);
		flag=menu_body(ch,choice);

	}while(flag!=1);

	return(0);

}
开发者ID:modyskyline,项目名称:Data-structure,代码行数:26,代码来源:main.c

示例10: main

int main(void)
{
    sys_setup_keys();
    u8g_setup();

    menu_redraw_required = 1;
    for(;;)
    {

        sys_debounce_key();

        if (  menu_redraw_required != 0 )
        {
            u8g_FirstPage(&u8g);
            do
            {
                draw_menu();

            } while ( u8g_NextPage(&u8g) );
            menu_redraw_required = 0;
        }

        update_menu();
    }
}
开发者ID:korytov,项目名称:bone,代码行数:25,代码来源:menu.c

示例11: menu_firms

int menu_firms()
{
    char firms[MAX_OPTIONS][_MAX_LFN + 1], dirpath[] = PATH_FIRMWARE_DIR;

    int pathlen = strlen(dirpath);
    int count = find_file_pattern(firms, dirpath, pathlen, MAX_OPTIONS, "firmware*.bin");

    if (!count) {
        draw_loading("Failed to load FIRM", "Make sure the encrypted FIRM is\n  located in the firmware directory");
        return 1;
    }

    char *options[count];
    for (int x = 0; x <= count; x++) options[x] = firms[x];

    int result = draw_menu("Select firmware", 0, count, options);
    if (result == -1) return 0;

    memcpy(config->firm_path, firms[result], _MAX_LFN + 1);

    reload_native_firm();
    load_cakes_info(PATH_PATCHES);

    return 0;
}
开发者ID:dark-samus,项目名称:CakesForeveryWan,代码行数:25,代码来源:main.c

示例12: goto_options_menu

struct optionsinfo goto_options_menu(BITMAP *scrbuffer, DATAFILE *main_data,
                                     DATAFILE *plane_data, struct optionsinfo options,
                                     struct menuinfo options_menu,
                                     struct menuinfo stats_menu)
{
// function controls the options menu

    options_menu.highlight = 0;
    do {
        // reset the selection
        options_menu.selection = -1;

        // draw the options screen
        draw_menu(scrbuffer, main_data, options_menu, options_menu.row, options_menu.col);
        textout_centre_ex(scrbuffer, main_data[FONTLARGE].dat, "Options",
                          SCREEN_W/2, TITLE_ROW*8, GREY+15, -1);
        blit(scrbuffer, screen, 0, 0, 0, 0, SCREEN_W, SCREEN_H);

        options_menu = move_menu_cursor(options_menu);

        if (options_menu.selection == 0) {
            // go to the stats menu
            options = goto_stats_menu(scrbuffer, main_data, plane_data, options, stats_menu);
            options_menu.highlight = 0;
        }

    } while (options_menu.selection != options_menu.num_of_options - 1);

    return(options);
}
开发者ID:puyo,项目名称:dogfight,代码行数:30,代码来源:menus.c

示例13: menu_main

void menu_main()
{
    while (1) {
        char *options[] = {"Boot CFW",
                           "Select Patches",
                           "More options...",
                           "Version info",
                           "Power off"};
        int result = draw_menu("CakesFW " CAKES_VERSION, 0, sizeof(options) / sizeof(char *), options);

        switch (result) {
            case 0:
                save_config();
                boot_cfw();
                break;
            case 1:
                menu_select_patches();
                break;
            case 2:
                menu_more();
                break;
            case 3:
                version_info();
                break;
            case 4:
                i2cWriteRegister(I2C_DEV_MCU, 0x20, 1);
                while(1);  // Won't break out of this one >:D
        }
    }
}
开发者ID:dark-samus,项目名称:CakesForeveryWan,代码行数:30,代码来源:main.c

示例14: draw_table

void draw_table(void) 
{
        // give us a green table
        printf(NORMAL);
        printf(CLEAR_SCREEN);

        // Title
        printf(MOVE_TOP_LEFT);
        printf(RED);
        printf("                                B L A C K J A C K\n");

        // menu
        draw_menu();

        // Headings
        printf(BLUE);
        printf("\033[%d;%dH", DEALER_ROW, DEALER_COL);
        printf("Dealer");
        printf("\033[%d;%dH", DEALER_ROW+1, DEALER_COL);
        printf("------");
        printf("\033[%d;%dH", PLAYER_ROW, PLAYER_COL);
        printf("You");
        printf("\033[%d;%dH", PLAYER_ROW+1, PLAYER_COL);
        printf("---");

        // wins, losses
        draw_stats();

        printf(MOVE_TOP_LEFT);
} // draw_table()
开发者ID:eegeek1986,项目名称:CS3040,代码行数:30,代码来源:table.c

示例15: update_menu

void
update_menu(void)
{
	draw_menu(menu);
	move_to_menu_pos(menu->pos, menu);
	wrefresh(menu_win);
}
开发者ID:cfillion,项目名称:vifm,代码行数:7,代码来源:menu.c


注:本文中的draw_menu函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。