• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ draw_border函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: newwin

void input_context::display_help()
{
    // Shamelessly stolen from help.cpp
    WINDOW *w_help = newwin(FULL_SCREEN_HEIGHT - 2, FULL_SCREEN_WIDTH - 2,
                            1 + (int)((TERMY > FULL_SCREEN_HEIGHT) ? (TERMY - FULL_SCREEN_HEIGHT) / 2 : 0),
                            1 + (int)((TERMX > FULL_SCREEN_WIDTH) ? (TERMX - FULL_SCREEN_WIDTH) / 2 : 0));

    werase(w_help);

    // Draw win header and borders
    draw_border(w_help, c_white);
    mvwprintz(w_help, 0, (FULL_SCREEN_WIDTH - utf8_width(_("Keybindings"))) / 2 - 1,
              c_ltred, " %s ", _("Keybindings"));
    mvwprintz(w_help, 1, 51, c_ltred, _("Unbound keys"));
    mvwprintz(w_help, 2, 51, c_ltgreen, _("Keybinding active only"));
    mvwprintz(w_help, 3, 51, c_ltgreen, _("on this screen"));
    mvwprintz(w_help, 4, 51, c_ltgray, _("Keybinding active globally"));

    // Clear the lines. Don't touch borders
    for (int i = 1; i < FULL_SCREEN_HEIGHT - 3; i++) {
        mvwprintz(w_help, i, 1, c_black, "                                               ");
    }

    for (int i = 0; i < registered_actions.size(); i++) {
        const std::string &action_id = registered_actions[i];
        if(action_id == "ANY_INPUT") {
            continue;
        }

        bool overwrite_default;
        const std::vector<input_event> &input_events = inp_mngr.get_input_for_action(action_id, category,
                &overwrite_default);

        nc_color col = input_events.size() ? c_white : c_ltred;
        mvwprintz(w_help, i, 3, col, "%s: ", inp_mngr.get_action_name(action_id).c_str());

        if (!input_events.size()) {
            mvwprintz(w_help, i, 30, c_ltred, _("Unbound!"));
        } else {
            // The color depends on whether this input draws from context-local or from
            // default settings. Default will be ltgray, overwrite will be ltgreen.
            col = overwrite_default ? c_ltgreen : c_ltgray;

            mvwprintz(w_help, i, 30, col, "%s", get_desc(action_id).c_str());
        }
    }
    wrefresh(w_help);
    refresh();

    long ch = getch();
    while (ch != 'q' && ch != 'Q' && ch != KEY_ESCAPE) {
        ch = getch();
    };

    werase(w_help);
    wrefresh(w_help);
    delwin(w_help);
}
开发者ID:jglazer75,项目名称:Cataclysm-DDA,代码行数:58,代码来源:input.cpp


示例2: play_game

int play_game(){
  draw_border();
  update_position();
  draw_snake();


  usleep(get_speed());
  return 1;
}
开发者ID:abimaelmartell,项目名称:snake,代码行数:9,代码来源:engine.c


示例3: run_arrange_hook

void run_arrange_hook(void)
{
    SCM arrange_hook_sym = scm_from_locale_symbol("arrange-hook");
    if (scm_defined_p(arrange_hook_sym, SCM_UNDEFINED) == SCM_BOOL_T) {
        scm_c_eval_string("(arrange-hook)");
    }
    else {
        fallback_arrange();
    }
    client_t *focus_client = get_focus_client();
    if (focus_client) {
        draw_border(focus_client);
    }
    else if (client_list) {
        set_focus_client(client_list);
        draw_border(client_list);
    }
}
开发者ID:brandoninvergo,项目名称:nwm,代码行数:18,代码来源:nwm.c


示例4: splash_screen

//-----------Splash screens------------//
void splash_screen (int screen_type)
{
    switch (screen_type)
    {
    case 1 :
        draw_border(26,3,53,7,1);
        gotoxy(31,5);
        textcolor(12);
        cprintf("Welcome ");
        textcolor(7);
        cout<<adm[1].adm_name.first_name;
        break;
    case 2 :
        draw_border(26,3,53,7,1);
        gotoxy(31,5);
        textcolor(12);
        cprintf("Welcome ");
        textcolor(7);
        cout<<apt[acc_no].apt_name.first_name;
        break;
    case 3 :
        draw_border(26,3,53,7,1);
        gotoxy(31,5);
        textcolor(12);
        cprintf("Welcome ");
        textcolor(7);
        cout<<emp[acc_no].emp_name.first_name;
        break;
    case 4 : {
        clrscr();
        draw_border(16,7,63,16,1);
        gotoxy(19,10);
        textcolor(12);
        cprintf("Thank you for using Intellisoft Job Portal");
        gotoxy(24,12);
        textcolor(7);
        cprintf("Developed by Aniruddha Mysore");
        gotoxy(26,13);
        cprintf("Class 11-B | Roll No. 28");
        delay(2000);
        exit(0);
    }
    }
}
开发者ID:AniMysore74,项目名称:computer-class,代码行数:45,代码来源:Portal.CPP


示例5: hide

void live_view::show(const int x, const int y)
{
    if (!enabled || w_live_view == NULL) {
        return;
    }

    bool did_hide = hide(false); // Clear window if it's visible

    if (!g->u.sees(x, y)) {
        if (did_hide) {
            wrefresh(w_live_view);
        }
        return;
    }

    map &m = g->m;
    mvwprintz(w_live_view, 0, START_COLUMN, c_white, "< ");
    wprintz(w_live_view, c_green, _("Mouse View"));
    wprintz(w_live_view, c_white, " >");
    int line = START_LINE;

    g->print_all_tile_info(x, y, w_live_view, START_COLUMN, line, true);

    if (m.can_put_items(x, y) && m.sees_some_items(x, y, g->u)) {
        if(g->u.has_effect("blind")) {
            mvwprintz(w_live_view, line++, START_COLUMN, c_yellow,
                      _("There's something here, but you can't see what it is."));
        } else {
            print_items(m.i_at(x, y), line);
        }
    }

#if (defined TILES || defined SDLTILES || defined _WIN32 || defined WINDOWS)
    // Because of the way the status UI is done, the live view window must
    // be tall enough to clear the entire height of the viewport below the
    // status bar. This hack allows the border around the live view box to
    // be drawn only as big as it needs to be, while still leaving the
    // window tall enough. Won't work for ncurses in Linux, but that doesn't
    // currently support the mouse. If and when it does, there'll need to
    // be a different code path here that works for ncurses.
    int full_height = w_live_view->height;
    if (line < w_live_view->height - 1) {
        w_live_view->height = (line > 11) ? line : 11;
    }
    last_height = w_live_view->height;
#endif

    draw_border(w_live_view);

#if (defined TILES || defined SDLTILES || defined _WIN32 || defined WINDOWS)
    w_live_view->height = full_height;
#endif

    inuse = true;
    wrefresh(w_live_view);
}
开发者ID:Antistar,项目名称:Cataclysm-DDA,代码行数:56,代码来源:live_view.cpp


示例6: draw_border

void snake_game::print_header(WINDOW *w_snake, bool show_shortcut)
{
    draw_border(w_snake);
    if (show_shortcut) {
        std::string shortcut = _("<q>uit");
        shortcut_print(w_snake, 0, FULL_SCREEN_WIDTH - utf8_width(shortcut.c_str()) - 2,
                       c_white, c_ltgreen, shortcut);
    }
    center_print(w_snake, 0, c_white, _("S N A K E"));
}
开发者ID:Agnososyk,项目名称:Cataclysm-DDA,代码行数:10,代码来源:iuse_software_snake.cpp


示例7: draw_border

//---------------------------------------------------------------------------------------
void GmoBox::on_draw(Drawer* pDrawer, RenderOptions& opt)
{
    draw_border(pDrawer, opt);
    draw_shapes(pDrawer, opt);

    //draw contained boxes
    std::vector<GmoBox*>::iterator it;
    for (it=m_childBoxes.begin(); it != m_childBoxes.end(); ++it)
        (*it)->on_draw(pDrawer, opt);
}
开发者ID:lenmus,项目名称:lenmus,代码行数:11,代码来源:lomse_gm_basic.cpp


示例8: update_frame

void
update_frame(const GameState *game)
{
    init_video_buffer();

    // Draw puzzle
    int nr_block = game->nr_block_h * game->nr_block_v;
    for (int i = 0; i < nr_block; i++) {
        int block_index = game->block[i];
        // Draw a block
        int scr_x = (i % game->nr_block_h) * game->block_w;
        int scr_y = (i / game->nr_block_h) * game->block_h;
        int pic_x = (block_index % game->nr_block_h) * game->block_w;
        int pic_y = (block_index / game->nr_block_h) * game->block_h;
        for (int off_y = 0; off_y < game->block_h; off_y++) {
            for (int off_x = 0; off_x < game->block_w; off_x++) {
                draw_pixel(scr_x + off_x, scr_y + off_y,
                        get_color(game->image, pic_x + off_x, pic_y + off_y, game->image_w, game->image_h));
            }
        }
    }

    // Draw frame
    for (int i = 0; i < game->nr_block_h + 1; i++) {
        int scr_x = i * game->block_w;
        draw_column(scr_x, 0, 6, get_scr_h(), 0);
    }
    for (int i = 0; i < game->nr_block_v + 1; i++) {
        int scr_y = i * game->block_h;
        draw_row(0, scr_y, 6, get_scr_w(), 0);
    }

    draw_border(game->block_x * game->block_w, game->block_y * game->block_h,
                game->block_w, game->block_h, 3, 0x000000ff);

    if (game->select == 1) {
        draw_border(game->select_block_x * game->block_w, game->select_block_y * game->block_h,
                    game->block_w, game->block_h, 3, 0x00ff0000);
    }

    update_screen();
}
开发者ID:Wonicon,项目名称:scratch-os,代码行数:42,代码来源:game.c


示例9: string_input_popup

std::string string_input_popup(std::string title, int width, std::string input, std::string desc,
                               std::string identifier, int max_length, bool only_digits )
{
    nc_color title_color = c_ltred;
    nc_color desc_color = c_green;

    std::vector<std::string> descformatted;

    int titlesize = utf8_width(title.c_str());
    int startx = titlesize + 2;
    if ( max_length == 0 ) {
        max_length = width;
    }
    int w_height = 3;
    int iPopupWidth = (width == 0) ? FULL_SCREEN_WIDTH : width + titlesize + 4;
    if (iPopupWidth > FULL_SCREEN_WIDTH) {
        iPopupWidth = FULL_SCREEN_WIDTH;
    }
    if ( desc.size() > 0 ) {
        int twidth = utf8_width(desc.c_str());
        if ( twidth > iPopupWidth - 4 ) {
            twidth = iPopupWidth - 4;
        }
        descformatted = foldstring(desc, twidth);
        w_height += descformatted.size();
    }
    int starty = 1 + descformatted.size();

    if ( max_length == 0 ) {
        max_length = 1024;
    }
    int w_y = (TERMY - w_height) / 2;
    int w_x = ((TERMX > iPopupWidth) ? (TERMX - iPopupWidth) / 2 : 0);
    WINDOW *w = newwin(w_height, iPopupWidth, w_y,
                       ((TERMX > iPopupWidth) ? (TERMX - iPopupWidth) / 2 : 0));

    draw_border(w);

    int endx = iPopupWidth - 3;

    for( size_t i = 0; i < descformatted.size(); ++i ) {
        mvwprintz(w, 1 + i, 1, desc_color, "%s", descformatted[i].c_str() );
    }
    mvwprintz(w, starty, 1, title_color, "%s", title.c_str() );
    long key = 0;
    int pos = -1;
    std::string ret = string_input_win(w, input, max_length, startx, starty, endx, true, key, pos,
                                       identifier, w_x, w_y, true, only_digits);
    werase(w);
    wrefresh(w);
    delwin(w);
    refresh();
    return ret;
}
开发者ID:ramza500,项目名称:Cataclysm-DDA,代码行数:54,代码来源:output.cpp


示例10: popup

long popup(const std::string &text, PopupFlags flags)
{
    int width = 0;
    int height = 2;
    std::vector<std::string> folded = foldstring(text, FULL_SCREEN_WIDTH - 2);
    height += folded.size();
    for( size_t i = 0; i < folded.size(); ++i ) {
        int cw = utf8_width(folded[i].c_str());
        if(cw > width) {
            width = cw;
        }
    }
    width += 2;
    WINDOW *w;
    if ((flags & PF_FULLSCREEN) != 0) {
        w = newwin(FULL_SCREEN_HEIGHT, FULL_SCREEN_WIDTH,
                        (TERMY > FULL_SCREEN_HEIGHT) ? (TERMY - FULL_SCREEN_HEIGHT) / 2 : 0,
                        (TERMX > FULL_SCREEN_WIDTH) ? (TERMX - FULL_SCREEN_WIDTH) / 2 : 0);
    } else if ((flags & PF_ON_TOP) == 0) {
        if (height > FULL_SCREEN_HEIGHT) {
            height = FULL_SCREEN_HEIGHT;
        }
        w = newwin(height, width, (TERMY - (height + 1)) / 2,
                       (TERMX > width) ? (TERMX - width) / 2 : 0);
    } else {
        w = newwin(height, width, 0, (TERMX > width) ? (TERMX - width) / 2 : 0);
    }
    draw_border(w);

    for( size_t i = 0; i < folded.size(); ++i ) {
        mvwprintz(w, i + 1, 1, c_white, "%s", folded[i].c_str());
    }

    long ch = 0;
    // Don't wait if not required.
    while((flags & PF_NO_WAIT) == 0) {
        wrefresh(w);
        ch = getch();
        if ((flags & PF_GET_KEY) != 0) {
            // return the first key that got pressed.
            werase(w);
            break;
        }
        if (ch == ' ' || ch == '\n' || ch == KEY_ESCAPE) {
            // The usuall "escape menu/window" keys.
            werase(w);
            break;
        }
    }
    wrefresh(w);
    delwin(w);
    refresh();
    return ch;
}
开发者ID:ramza500,项目名称:Cataclysm-DDA,代码行数:54,代码来源:output.cpp


示例11: edit_apl_profile

//---------Edit Applicant Profile----------//
void edit_apl_profile()
{
    int i = acc_no;
    char choice;
    clrscr;
    gotoxy(28,10);
    textcolor(12);
    cprintf("What would you like to edit? ");
    textcolor(7);
    cout<<"\n\t\t\t\t[1] Name\n\t\t\t\t[2] Industry\n\t\t\t\t[3] Username";
    draw_border(25,8,59,16,0);
    gotoxy(28,15);
    cin>>choice;
    clrscr();
    switch (choice)
    {
    case '1' : {
        gotoxy(24,11);
        cout<<"Please enter your first name : ";
        cin>>apt[i].apt_name.first_name;
        cin.ignore();
        gotoxy(24,12);
        cout<<"Please enter your last name : ";
        cin>>apt[i].apt_name.last_name;
        cin.ignore();
        break;
    }
    case '2' : {
        gotoxy(27,11);
        cout<<"Industry 1 : ";
        cin>>apt[i].industry[1];
        cin.ignore();
        gotoxy(27,12);
        cout<<"Industry 2 : ";
        cin>>apt[i].industry[2];
        gotoxy(27,13);
        cin.ignore();
        cout<<"Industry 3 : ";
        cin>>apt[i].industry[3];
        cin.ignore();
        break;
    }
    case '3' : {
        gotoxy(28,12);
        cout<<"Username : ";
        cin>>apt[i].username;
        cin.ignore();
        break;
    }
    default :
        error(1);
    }
}
开发者ID:AniMysore74,项目名称:computer-class,代码行数:54,代码来源:Portal.CPP


示例12: start_graph

void	start_graph(void)
{
	initscr();
	raw();
	color_init();
	curs_set(0);
	cbreak();
	noecho();
	nodelay(stdscr, TRUE);
	scrollok(stdscr, TRUE);
	draw_border();
}
开发者ID:mklon,项目名称:Corewar,代码行数:12,代码来源:v_first.c


示例13: wclear

void	Ncurses::display(std::list<t_snake> snake, const t_food food)
{
  wclear(_game);
  draw_border();
  for_each(snake.begin(), snake.end(), bind1st(std::mem_fun(&Ncurses::snake_body), this));
  snake_head(snake.begin()->x, snake.begin()->y);
  wattron(_game, COLOR_PAIR(1));
  mvwprintw(_game, food.y + 1, food.x + 1, "@");
  wattroff(_game, COLOR_PAIR(1));
  speedup(snake.begin()->x, snake.begin()->y, food.x, food.y);
  wrefresh(_game);
}
开发者ID:adrijere,项目名称:cpp_nibbler,代码行数:12,代码来源:init_ncurses.cpp


示例14: credential_input

//---------Password Check----------//
int credential_input (int acc)
{
    int i,j;
    char u[20],p[20];
    draw_border(23,8,59,14,0);
    gotoxy(26,10);
    cout<<"Enter username : ";
    textcolor(7);
    gotoxy(45,10);
    cin>>u;
    cin.ignore();
    gotoxy(26,12);
    textcolor(8);
    cout<<"Enter password : ";
    textcolor(7);
    for(j=0; p[j-1]!='\r'&&j!=18; j++)
    {
        p[j]=getch();
        cout<<"*";
    }
    p[j-1]='\0';
    if (acc ==1)
        for(i=0; i<5; i++)
        {
            if(strcmp(u,adm[0].username)==0 && strcmp(p,adm[0].password)==0)
            {
                clrscr();
                return 1;
            }
        }
    else if (acc==2)
        for(i=0; i<20 ; i++)
        {
            if(strcmp(u,apt[i].username)==0 && strcmp(p,apt[i].password)==0)
            {
                clrscr();
                acc_no=i;
                return 2;
            }
        }
    else if (acc==3)
        for(i=0; i<10 ; i++)
        {
            if(strcmp(u,emp[i].username)==0 && strcmp(p,emp[i].password)==0)
            {
                clrscr();
                acc_no=i;
                return 3;
            }
        }
    return 0;
}
开发者ID:AniMysore74,项目名称:computer-class,代码行数:53,代码来源:Portal.CPP


示例15: lem_redraw

static void lem_redraw(dcpu *dcpu) {
  draw_border();
  if (term.vram) {
    // don't perform the indirection outside the loop. vid ram can be mapped
    // toward the high end of the range, in which case we need to be careful
    // that it wraps around to the start.
    u16 addr = term.vram;
    for (u16 i = 0; i < SCR_HEIGHT; i++) 
      for (u16 j = 0; j < SCR_WIDTH; j++)
        draw(dcpu->ram[addr++], i, j);
  }
  wrefresh(term.vidwin);
}
开发者ID:MostAwesomeDude,项目名称:dcpu,代码行数:13,代码来源:terminal.c


示例16: redraw_game

// redraw the whole screen
void redraw_game(GAME *game) {
  // redraw the main window (containg the border and stuff)
  clear();
  draw_border(game);
  redrawwin(stdscr);
  refresh();
  
  // redraw the fruits
  redraw_fruits(&game->fruits);

  // redraw the snake
  redraw_snake(&game->snake);
}
开发者ID:posva,项目名称:msnake,代码行数:14,代码来源:game.c


示例17: render

static void render(void) {
  mdarea_t *lv;
  draw_border();
  for (lv = world.hvarea; lv; lv = lv->next) {
    draw_varea(lv);
  }
  for (lv = world.hvarea; lv; lv = lv->next) {
    mdnode_t *ln;
    for (ln = lv->hnode; ln; ln = ln->next) {
      draw_node(ln);
    }
  }
}
开发者ID:huxingyi,项目名称:moving-dots,代码行数:13,代码来源:map-demo.c


示例18: draw_stats

void draw_stats(frame *frm, FILE *urandom){ //TODO expand draw_stats
    WINDOW *w_stats;
    PANEL *p_stats;
    int size_x=30, size_y=10;
    w_stats = newwin(size_y, size_x,
                     (frm->centerY)-(size_y/2),
                     (frm->centerX)-(size_x/2));
    wclear(w_stats);
    draw_border(w_stats);
    p_stats = new_panel(w_stats);
    update_panels(); //order
    doupdate(); //show
    do_exit(urandom);
}
开发者ID:bong0,项目名称:school,代码行数:14,代码来源:main.cpp


示例19: button_draw

void button_draw(int x1,int y1,int x2,int y2,OBJREC *o)
  {
  CTL3D x;
  char w;

  bar(x1,y1,x2,y2);
  highlight(&x,o->color);
  w=*(char *)o->data;
  x.bsize=2-w;
  x.ctldef=(w<<1)+w;
  draw_border(x1+2,y1+2,x2-x1-4,y2-y1-4,&x);
  set_aligned_position(((x1+x2)>>1)+(w<<1),((y1+y2)>>1)+(w<<1),1,1,(char *)o->userptr);
  outtext((char *)o->userptr);
  }
开发者ID:svn2github,项目名称:Brany_Skeldalu,代码行数:14,代码来源:basicobj.c


示例20: gg_dialog_render

/** @brief Renders a dialog.
 *
 *	Renders a dialog in a specific style and at a specific position.
 *
 *	@param menu The dialog to render.
 *	@param style The style to render in.
 *	@param pos The position to render at.
 */
void gg_dialog_render(gg_dialog_t *dialog, int active)
{
	gg_dialog_style_t *style = &dialog->style;
	gg_widget_t *child = gg_bin_get_child(GG_BIN(dialog));
	int size = 0;
	gg_rect_t area;

	int xmin, xmax, ymin, ymax;

	if (dialog->flags & GG_DIALOG_HIDDEN)
		return;

	gg_dialog_get_screen_pos(dialog, &xmin, &ymin);

	xmax = (xmin + dialog->width);
	ymax = (ymin + dialog->height);

	/* Draw the 'fade' */
	gg_system_draw_filled_rect(0, 0, 640, 480, &style->fade_col);

	if (style->textured)
		gg_system_get_image_size(style->border.image[0], &size, NULL);

	xmin += size;
	xmax -= size;
	ymin += size;
	ymax -= size;

	area.x = xmin;
	area.y = ymin;
	area.width = xmax - xmin;
	area.height = ymax - ymin;

	if (dialog_in_trans)
		area.height *= dialog_get_transition();

	if (style->textured)
		draw_border(style->border.image, dialog->title, active, area, size);

	xmin += style->hor_pad;
	xmax -= style->hor_pad;
	ymin += style->vert_pad;
	ymax -= style->vert_pad;

	if (!dialog_in_trans)
		child->render(child, xmin, ymin, active);

	dialog_get_transition();
}
开发者ID:konker,项目名称:dreamchess,代码行数:57,代码来源:dialog.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ draw_box函数代码示例发布时间:2022-05-30
下一篇:
C++ draw_background_locked函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap