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

C++ clrtoeol函数代码示例

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

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



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

示例1: do_postwar

do_postwar()
{
  int rc, in_postwar_read, in_postwar = 1;
  int openflags, newmsgs;
  struct readnewstruct rns;
  char msgbuf[80], ans[4];

  while(in_postwar) {
    bbs_set_mode(M_POSTWAR);
    rc = (GenericPost(0));
    bbs_set_mode(M_POSTWAR);
    in_postwar_read = 1;
    while(in_postwar_read) {
      move(t_lines-1,0);
      clrtoeol();
      getdata(t_lines-1, 0, "Post again, Read new posts, Exit PostWar Mode? [R]: ", 
       ans, sizeof(ans), DOECHO, 0);
        switch (*ans) {
        case 'e': case 'E': 
          in_postwar = in_postwar_read = 0;
          break;
        case 'p': case 'P':
          in_postwar_read = 0;
          break;
        default: {
          clear();
          CloseBoard();
          newmsgs = OpenBoard(&openflags, 1, NULL);
          if (newmsgs > 0) {
            rns.nummsgs = newmsgs;
            rns.numread = 0;
            rns.openflags = openflags;
            rns.dispflags = NEW_SKIP;
            rns.thread = NULL;
            bbs_enum_headers(10, 0, 1, NewPostReadfn, &rns);
          }
          else {
            sprintf(msgbuf, "No New Posts on %s\n", currboard);
            move(t_lines/2, t_columns/2-10);
            prints(msgbuf);
          }
        }
      }
    }
  }
  return rc;
}
开发者ID:catskillmarina,项目名称:ebbs-modules,代码行数:47,代码来源:postwar.c


示例2: move

 void MenuEscape::handleInput(int in) {
     const int maxUiSelection = 3;
     
     move(selection + 2, 0);
     clrtoeol();
     
     if(in == KEY_ESCAPE){
         closeThisMenu();
     } else if(in == Key::interact || in == '\n'){
         switch (selection) {
             case 0:
                 closeThisMenu();
                 break;
                 
             case 1:
                 openMenu(new MenuControls());
                 break;
                 
             case 2:
                 openMenu(new MenuSettings());
                 break;
                 
             case 3:
                 if(Settings::autoSave && menuTime > Settings::autoSaveDelay){
                     closeAllMenus();
                 } else {
                     openMenu(new MenuYesNo("Do you want to save '" + menuGame->currentWorld->name + "' ?", menuGame->saveAnswer, true));
                 }
                 break;
                 
             default:
                 break;
         }
     }else if(in == Key::uiUp){
         selection--;
         if (selection < 0) {
             selection = maxUiSelection;
         }
         
     }else if(in == Key::uiDown){
         selection++;
         if (selection > maxUiSelection) {
             selection = 0;
         }
     }
     
 }
开发者ID:nedearb,项目名称:Underneath,代码行数:47,代码来源:MenuEscape.cpp


示例3: IgnorePage

static void
IgnorePage(int infile)
{
    static time_t last;
    time_t now = time((time_t *) 0);

    if (now != last) {
	last = now;
	move(LINES - 1, 0);
	(void) standout();
	PRINTW("---line %d ...skipping", infile);
	(void) standend();
	PRINTW(" ");
	clrtoeol();
	refresh();
    }
}
开发者ID:ThomasDickey,项目名称:ded-snapshots,代码行数:17,代码来源:dedtype.c


示例4: i_memory

/*
 *  *_memory(stats) - print "Memory: " followed by the memory summary string
 */
void
i_memory(int *stats)
{
	if (screen_length > y_mem || !smart_terminal) {
		char memory_buffer[MAX_COLS];

		move(y_mem, 0);
		clrtoeol();
		addstrp("Memory: ");

		/* format and print the memory summary */
		summary_format(memory_buffer, sizeof(memory_buffer), stats,
		    memory_names);
		addstrp(memory_buffer);
		putn();
	}
}
开发者ID:UNGLinux,项目名称:Obase,代码行数:20,代码来源:display.c


示例5: i_header

void
i_header(char *text)
{
	if (header_status == Yes && (screen_length > y_header
              || !smart_terminal)) {
		if (!smart_terminal) {
			putn();
			if (fputs(text, stdout) == EOF)
				exit(1);
			putn();
		} else {
			move(y_header, 0);
			clrtoeol();
			addstrp(text);
		}
	}
}
开发者ID:UNGLinux,项目名称:Obase,代码行数:17,代码来源:display.c


示例6: prompt_char

/* "valid" string.                                              */
wchar_t
prompt_char(int row, int col, const char *promptstr, const char *valid)
{
	wchar_t *w_prompt, *w_valid=NULL, ch;
   
	int code;

	w_prompt = mbstowcs_alloc(promptstr);

	/* if w_promptstr == NULL ?? .... */

	/* Print the prompt.                                        */
	mvaddwstr(row, col, w_prompt);
	clrtoeol();
	refresh();

    if ( valid  != NULL ) {
            w_valid  = mbstowcs_alloc(valid);
    }
	/* Read characters...                                       */
	while ((code = get_wch(&ch)) != ERR) {
		/* If it's not a valid one, beep and get another one.   */
		/* if (index(valid, c) == NULL) { */
        if ( valid  != NULL ) {
		    if (wcsrchr(w_valid, ch) == NULL) {	/* CHANGED !! */
			    beep();
			    continue;
		    }

		    /* Add the character to the screen, and return it.      */
		    AddCh((chtype) ch);
		    refresh();
        }
		goto _exit;
	}
 _exit:
	free(w_prompt);
	refresh();
    if (valid != NULL ) {
	    free(w_valid);
        w_valid= NULL ;
        return (ch);		/* to avoid compiler warning */
    } else {
        return '\0' ;
   }
}
开发者ID:McUsr,项目名称:Index-2.0,代码行数:47,代码来源:screen.c


示例7: getyx

// print updated interactive control value
void
Responder::print_interactive_msg(std::string msg)
{
    if(msg != "")
    {
        // move cursor back to beginning of line
        int y, x;
        getyx(_window, y, x);
        if (x > 0)
        {
            move(y, 0);
            clrtoeol();
        }
        print_msg(msg);
        move(y, 0);
    }
}
开发者ID:211217613,项目名称:uhd,代码行数:18,代码来源:Responder.cpp


示例8: doendgameoutput

/* Draw the board, the help, and the two wordlists at the end of a
 * round. Returns zero if the end of screen was reached before the end
 * of the wordlist.
 */
int doendgameoutput(int y, int x, int offset, int highlighted)
{
    int f = TRUE;

    drawgridletters(highlighted);
    movetowords(TRUE);
    listwords("Your words:", getfound(), 0);
    if (!ego)
	f = listwords("Other words that were present:", getfindable(), offset);
    move(y, x);
    if (!offset && f)
	addline("^D: quit  &: new game  ?: find word");
    else
	addline("^D: quit  &: new game  ?: find word  -+: scroll");
    clrtoeol();
    return f;
}
开发者ID:BR903,项目名称:boggle,代码行数:21,代码来源:output.c


示例9: ifcmd

int
ifcmd(const char *cmd, const char *args)
{
	int scale;

	if (prefix(cmd, "scale")) {
		if ((scale = get_scale(args)) != -1)
			curscale = scale;
		else {
			move(CMDLINE, 0);
			clrtoeol();
			addstr("what scale? ");
			addstr(get_helplist());
		} 
	}
	return (1);
}
开发者ID:grayshadow212,项目名称:usr.src,代码行数:17,代码来源:ifcmds.c


示例10: attrset

void WDL_CursesEditor::draw_message(const char *str)
{
  int l=strlen(str);
  if (l > COLS-2) l=COLS-2;
  if (str[0]) 
  {
    attrset(m_color_message);
    bkgdset(m_color_message);
  }
  mvaddnstr(LINES-(m_bottom_margin>1?2:1),0,str,l);
  clrtoeol();
  if (str[0])
  {
    attrset(0);
    bkgdset(0);
  }
}
开发者ID:0x4d52,项目名称:wdl-ol,代码行数:17,代码来源:curses_editor.cpp


示例11: get_line

/*
 * get_line:
 *      Reads the next line up to '\n' or EOF.  Multiple spaces are
 *	compressed to one space; a space is inserted before a ','
 */
char *
get_line(void)
{
	size_t pos;
	int c, oy, ox;
	WINDOW *oscr;

	oscr = stdscr;
	stdscr = Msgwin;
	getyx(stdscr, oy, ox);
	refresh();
	/* loop reading in the string, and put it in a temporary buffer */
	for (pos = 0; (c = readchar()) != '\n'; clrtoeol(), refresh()) {
		if (c == -1)
			continue;
		if (c == ' ' && (pos == 0 || linebuf[pos - 1] == ' '))
			continue;
		if (c == erasechar()) {
			if (pos > 0) {
				int i;
				pos--;
				for (i = strlen(unctrl(linebuf[pos])); i; i--)
					addch('\b');
			}
			continue;
		}
		if (c == killchar()) {
			pos = 0;
			move(oy, ox);
			continue;
		}
		if (pos >= LINESIZE - 1 || !(isalnum(c) || c == ' ')) {
			beep();
			continue;
		}
		if (islower(c))
			c = toupper(c);
		linebuf[pos++] = c;
		addstr(unctrl(c));
		Mpos++;
	}
	while (pos < sizeof(linebuf))
		linebuf[pos++] = '\0';
	stdscr = oscr;
	return (linebuf);
}
开发者ID:lattera,项目名称:openbsd,代码行数:51,代码来源:io.c


示例12: drawpos

void drawpos()
{
	file_t *file;
	
	file = files[current];
	
	attron(COLOR_PAIR(3));
	attron(A_BOLD);
	
	mvprintw(0, 55, "C: %d  L: %d/%d (%d%%)",
		file->cursor_x+1, file->cursor_y+1,
		file->line_count, file->cursor_y*100/file->line_count);
	clrtoeol();
	
	attron(COLOR_PAIR(2));
	attroff(A_BOLD);
}
开发者ID:BackupTheBerlios,项目名称:yaed,代码行数:17,代码来源:yaed.c


示例13: main

int main() {
	WINDOW *menu_win;
	int highlight = 1;
	int choice = 0;
	int c;

	initscr();
	clear();
	noecho();
	cbreak();
	startx = (80 - WIDTH) / 2;
	starty = (24 - HEIGHT) / 2;

	menu_win = newwin(HEIGHT, WIDTH, starty, startx);
	keypad(menu_win, TRUE);
	mvprintw(0, 0, "Use arrow keys to go up and down, Press enter to select a choice");
	refresh();
	print_menu(menu_win, highlight);
	while (1) {
		c = wgetch(menu_win);
		switch(c) {
			case KEY_UP:
				if (highlight == 1) highlight = n_choices;
				else --highlight;
				break;
			case KEY_DOWN:
				if (highlight == n_choices) highlight = 1;
				else ++highlight;
				break;
			case 10:
				choice = highlight;
				break;
			default:
				mvprintw(24, 0, "Character pressed is = %3d Hopefully it can be...", c);
				refresh();
				break;
		}
		print_menu(menu_win, highlight);
		if (choice != 0) break;
	}
	mvprintw(23, 0, "You chose choice %d width choice string %s\n", choice, choices[choice - 1]);
	clrtoeol();
	refresh();
	endwin();
	return 0;
}
开发者ID:firisu,项目名称:sandbox,代码行数:46,代码来源:example10.c


示例14: main

int main() {
    int rows;
    int cols;
    char input[5];
    int tall;
    int wide;


    initscr(); //initalize ncurses

    getmaxyx(stdscr, rows, cols); //get size of screen

    //Move to position, and print
    mvprintw(2, 3, "Enter the height: ");
    getstr(input); //get string from user, store in input
    tall = (int)strtol(input, NULL, 10);
    move(2,0); //move to beginning of line
    clrtoeol(); //clear line


    mvprintw(2, 3, "Enter the width: ");
    getstr(input);
    wide = (int)strtol(input, NULL, 10);

    erase(); //clear entire screen

    printRec(2,3,tall,wide);
    getch();
    printRec(6,7,tall,wide);
    getch();
    printRec(12,23,tall,wide);
    getch();

    /* Pause for input.
       This really does nothing. It's just hear so you can see the screen
       before the program exits. Hit any key to continue*/
    printMsg("End of program. Push any key to quit.");
    getch();


    /* Important. Don't forget to do this: */
    endwin(); //deinitalize ncurses

    return 0;
}
开发者ID:TrapLordSean242,项目名称:CIS2500_WorkingDirectory,代码行数:45,代码来源:pracurses.c


示例15: init

void init(mcu_t* const state)
{
	uint8_t size_ok = 0;
	initscr();
	cbreak();
	noecho();
	keypad(stdscr, TRUE);
	curs_set(0);
	while(!size_ok)
	{
		getmaxyx(stdscr, message_y, message_x);
		if(message_y < 40 || message_x < 80)
		{
			clear();
			mvprintw(message_y - 1, 0, "Please increase your terminal window size to accommodate the UI.");
			refresh();
			getch();
		}
		else
			size_ok = 1;
	}
	sfr_x = 0;
	sfr_y = 0;
	gpram_x = 26;
	gpram_y = 15;
	misc_x = 0;
	misc_y = 15;
	message_x = 0;
	move(message_y, message_x);
	clrtoeol();
	refresh();
	message_y -= 1;
	sfr_draw();
	gpram_draw();
	misc_draw();
	mvprintw(message_y, message_x, "Welcome to MULE. Press ESC followed by r to run, or : to enter a command.");
	refresh();

	while(getch() != 27)
		;	

	get_cmd(state);
	
	return;
}	
开发者ID:stefannikolicns,项目名称:MULE,代码行数:45,代码来源:ui.c


示例16: getguess

/*
 * getguess:
 *	Get another guess
 */
void
getguess(void)
{
	int i;
	int ch, uch;
	bool correct;

	leaveok(stdscr, FALSE);
	for (;;) {
		move(PROMPTY, PROMPTX + sizeof("Guess: "));
		refresh();
		ch = readch();
		if (isalpha(ch)) {
			if (isupper(ch))
				ch = tolower(ch);
			if (Guessed[ch - 'a'])
				mvprintw(MESGY, MESGX, "Already guessed '%c'", ch);
			else
				break;
		}
		else if (ch == CTRL('D'))
			die(0);
		else
			mvprintw(MESGY, MESGX, "Not a valid guess: '%s'",
				unctrl(ch));
	}
	leaveok(stdscr, TRUE);
	move(MESGY, MESGX);
	clrtoeol();

	Guessed[ch - 'a'] = TRUE;
	correct = FALSE;
	uch = toupper(ch);
	for (i = 0; Word[i] != '\0'; i++) {
		if (Word[i] == ch) {
			Known[i] = ch;
			correct = TRUE;
		} else if (Word[i] == uch) {
			Known[i] = uch;
			correct = TRUE;
		}
	}
	if (!correct)
		Errors++;
}
开发者ID:AhmadTux,项目名称:DragonFlyBSD,代码行数:49,代码来源:getguess.c


示例17: get_line

/*
 * get_line:
 *      Reads the next line up to '\n' or EOF.  Multiple spaces are
 *	compressed to one space; a space is inserted before a ','
 */
char *
get_line(void)
{
	size_t pos;
	int c, oy, ox;
	WINDOW *oscr;

	oscr = stdscr;
	stdscr = Msgwin;
	getyx(stdscr, oy, ox);
	refresh();
	/* loop reading in the string, and put it in a temporary buffer */
	for (pos = 0; (c = readchar()) != '\n'; clrtoeol(), refresh()) {
			if (c == erasechar()) {	/* process erase character */
				if (pos > 0) {
					int i;

					pos--;
					for (i = strlen(unctrl(linebuf[pos])); i; i--)
						addch('\b');
				}
				continue;
			} else
				if (c == killchar()) {	/* process kill
							 * character */
					pos = 0;
					move(oy, ox);
					continue;
				} else
					if (pos == 0 && c == ' ')
						continue;
		if (pos >= LINESIZE - 1 || !(isprint(c) || c == ' '))
			putchar(CTRL('G'));
		else {
			if (islower(c))
				c = toupper(c);
			linebuf[pos++] = c;
			addstr(unctrl(c));
			Mpos++;
		}
	}
	linebuf[pos] = '\0';
	stdscr = oscr;
	return (linebuf);
}
开发者ID:ajinkya93,项目名称:netbsd-src,代码行数:50,代码来源:io.c


示例18: snprintf

void WDL_CursesEditor::draw_status_state()
{
  // always show this? if (m_bottom_margin>0)
  {
    char statusstr[512];
    snprintf(statusstr,sizeof(statusstr),"Line %d/%d, Col %d [%s%s]%s",m_curs_y+1,m_text.GetSize(),m_curs_x,s_overwrite?"OVR":"INS","",m_clean_undopos == m_undoStack_pos ? "" :"M");


    attrset(m_color_statustext);
    bkgdset(m_color_statustext);
 
    mvaddstr(LINES-1,COLS-28,statusstr);
    clrtoeol();

    attrset(0);
    bkgdset(0);
  }
}
开发者ID:0x4d52,项目名称:wdl-ol,代码行数:18,代码来源:curses_editor.cpp


示例19: i_process

void
i_process(int line, char *thisline, int hl)
{
	/* make sure we are on the correct line */
	move(y_procs + line, 0);

	/* truncate the line to conform to our current screen width */
	thisline[display_width] = '\0';

	/* write the line out */
	if (hl && smart_terminal)
		standoutp();
	addstrp(thisline);
	if (hl && smart_terminal)
		standendp();
	putn();
	clrtoeol();
}
开发者ID:UNGLinux,项目名称:Obase,代码行数:18,代码来源:display.c


示例20: press

void press (void)
{
    int c;
    extern int showansi;
    int tmpansi;

    tmpansi = showansi;
    showansi = 1;
    saveline (t_lines-1, 0);
    move (t_lines-1, 0);
    clrtoeol ();
    prints ("[37;40m[0m                               [33m°´ÈÎÒâ¼ü¼ÌÐø ...[37;40m[0m");
    refresh ();
    read (0, &c, sizeof (int));
    move (t_lines-1, 0);
    saveline (t_lines-1, 1);
    showansi = tmpansi;
}
开发者ID:madoldman,项目名称:inankai_bbs,代码行数:18,代码来源:five.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ clust2sect函数代码示例发布时间:2022-05-30
下一篇:
C++ clrtobot函数代码示例发布时间: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