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


C++ clrtoeol函数代码示例

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


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


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