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

C++ clear_line函数代码示例

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

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



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

示例1: show_flag_status

static void show_flag_status(void)
{
	int keypress;
	int flag_val;

	clear_line();
	bb_putchar('_');
	keypress = less_getch(1);

	switch (keypress) {
	case 'M':
		flag_val = option_mask32 & FLAG_M;
		break;
	case 'm':
		flag_val = option_mask32 & FLAG_m;
		break;
	case '~':
		flag_val = option_mask32 & FLAG_TILDE;
		break;
	case 'N':
		flag_val = option_mask32 & FLAG_N;
		break;
	case 'E':
		flag_val = option_mask32 & FLAG_E;
		break;
	default:
		flag_val = 0;
		break;
	}

	clear_line();
	printf(HIGHLIGHT"The status of the flag is: %u"NORMAL, flag_val != 0);
}
开发者ID:Cheezzolo123,项目名称:MonteDroid,代码行数:33,代码来源:less.c


示例2: add_mark

static void add_mark(void)
{
	int letter;
	int mark_line;

	clear_line();
	printf("Mark: ");
	letter = tless_getch();

	if (isalpha(letter)) {
		mark_line = line_pos;

		/* If we exceed 15 marks, start overwriting previous ones */
		if (num_marks == 14)
			num_marks = 0;

		mark_lines[num_marks][0] = letter;
		mark_lines[num_marks][1] = line_pos;
		num_marks++;
	}
	else {
		clear_line();
		printf("%s%s%s", HIGHLIGHT, "Invalid mark letter", NORMAL);
	}
}
开发者ID:alhazred,项目名称:busybox-solaris,代码行数:25,代码来源:less.c


示例3: set_cursor_pos

//--------------------------------------------------------------
//record_floor_reqs() -- get requests from riders outside car
void building::record_floor_reqs()
   {
   char ch = 'x';             //utility char for input
   char ustring[BUF_LENGTH];  //utility string for input
   int iFloor;                //floor from which request made
   char chDirection;          //'u' or 'd' for up or down
   
   set_cursor_pos(1,22);      //bottom of screen
   cout << "Press [Enter] to call an elevator: ";
   if( !kbhit() )             //wait for keypress (must be CR)
      return;
   cin.ignore(10, '\n');
   if(ch=='\x1B')             //if escape key, end program
      exit(0);
   set_cursor_pos(1,22); clear_line();  //clear old text
   set_cursor_pos(1,22);      //bottom of screen
   cout << "Enter the floor you're on: ";
   cin.get(ustring, BUF_LENGTH);        //get floor
   cin.ignore(10, '\n');      //eat chars, including newline
   iFloor = atoi(ustring);    //convert to integer

   cout << "Enter direction you want to go (u or d): ";
   cin.get(chDirection);      //(avoid multiple linefeeds)
   cin.ignore(10, '\n');      //eat chars, including newline

   if(chDirection=='u' || chDirection=='U')
      floor_request[UP][iFloor-1] = true;  //up floor request
   if(chDirection=='d' || chDirection=='D')
      floor_request[DN][iFloor-1] = true;  //down floor request
   set_cursor_pos(1,22); clear_line();     //clear old text
   set_cursor_pos(1,23); clear_line();
   set_cursor_pos(1,24); clear_line();
   }  //end record_floor_reqs()
开发者ID:rajat1293,项目名称:ALL_PROGRAMS,代码行数:35,代码来源:Elev.cpp


示例4: h_search

static el_status_t h_search(void)
{
    static int Searching;
    const char *old_prompt;
    const char *(*move)(void);
    const char *p;

    if (Searching)
        return el_ring_bell();
    Searching = 1;

    clear_line();
    old_prompt = rl_prompt;
    rl_prompt = "Search: ";
    tty_puts(rl_prompt);
    move = Repeat == NO_ARG ? prev_hist : next_hist;
    p = editinput();
    rl_prompt = old_prompt;
    Searching = 0;
    tty_puts(rl_prompt);
    if (p == NULL && el_intr_pending > 0) {
        el_intr_pending = 0;
        clear_line();
        return redisplay();
    }
    p = search_hist(p, move);
    clear_line();
    if (p == NULL) {
        el_ring_bell();
        return redisplay();
    }
    return do_insert_hist(p);
}
开发者ID:jakubpawlo,项目名称:editline,代码行数:33,代码来源:editline.c


示例5: move_cursor_to_start_of_prompt

void
move_cursor_to_start_of_prompt(int erase)
{
  int termwidth = winsize.ws_col;
  int promptlen_on_screen, number_of_lines_in_prompt, curpos, count;
  int cooked = (saved_rl_state.cooked_prompt != NULL);
  
  DPRINTF2(DEBUG_READLINE,"prompt_is_still_uncooked: %d, impatient_prompt: %d", prompt_is_still_uncooked, impatient_prompt);
  if (prompt_is_still_uncooked && ! impatient_prompt)
    return; /* @@@ is this necessary ?*/

	
  promptlen_on_screen =  colourless_strlen_unmarked(saved_rl_state.cooked_prompt ? saved_rl_state.cooked_prompt : saved_rl_state.raw_prompt, termwidth);
  curpos = (within_line_edit ? 1 : 0); /* if the user has pressed a key the cursor will be 1 past the current prompt */
  assert(termwidth > 0); 
  number_of_lines_in_prompt = 1 +  ((promptlen_on_screen + curpos -1) / termwidth); /* integer arithmetic! (e.g. 171/80 = 2) */
  cr(); 
  for (count = 0; count < number_of_lines_in_prompt -1; count++) {
    if (erase)
      clear_line();
    curs_up();
  } 
  clear_line();
  DPRINTF4(DEBUG_READLINE,"moved cursor up %d lines (erase = %d, len=%d, cooked=%d)", number_of_lines_in_prompt - 1, erase, promptlen_on_screen, cooked); 
}       
开发者ID:bobbyzhu,项目名称:rlwrap,代码行数:25,代码来源:readline.c


示例6: show_flag_status

static void show_flag_status(void)
{
	int keypress;
	int flag_val;

	clear_line();
	putchar('_');
	keypress = tless_getch();

	switch (keypress) {
		case 'M':
			flag_val = flags & FLAG_M;
			break;
		case 'm':
			flag_val = flags & FLAG_m;
			break;
		case '~':
			flag_val = flags & FLAG_TILDE;
			break;
		case 'N':
			flag_val = flags & FLAG_N;
			break;
		case 'E':
			flag_val = flags & FLAG_E;
			break;
		default:
			flag_val = 0;
			break;
	}

	clear_line();
	printf("%s%s%i%s", HIGHLIGHT, "The status of the flag is: ", flag_val != 0, NORMAL);
}
开发者ID:alhazred,项目名称:busybox-solaris,代码行数:33,代码来源:less.c


示例7: init_display_buffer

void init_display_buffer(ui_context * ctx)
{
	int i;
	font_type * font;

	font = font_list[ctx->font_id];

	ctx->screen_txt_xsize = ctx->SCREEN_XRESOL / font->char_x_size;
	ctx->screen_txt_ysize = (ctx->SCREEN_YRESOL / font->char_y_size);

	ctx->NUMBER_OF_ENTRIES_ON_DISPLAY = ctx->screen_txt_ysize - 2;          // (Display size minus top + bottom)
	ctx->NUMBER_OF_FILE_ON_DISPLAY = ctx->NUMBER_OF_ENTRIES_ON_DISPLAY - 1; // (Display size minus top + bottom + tittle)

	chg_video_conf(ctx);

	// Clear all lines.
	for(i=0;i<ctx->screen_txt_ysize;i++)
	{
		clear_line(ctx, i, 0 );
	}

	// Footprint : Current software / firmware version and title
	clear_line(ctx, ctx->screen_txt_ysize - 1, INVERTED);

	hxc_printf(ctx,LEFT_ALIGNED | INVERTED,0, ctx->screen_txt_ysize - 1,"FW %s",ctx->FIRMWAREVERSION);
	hxc_print(ctx,CENTER_ALIGNED | INVERTED,0,ctx->screen_txt_ysize - 1,(char*)title_msg);
	hxc_print(ctx,RIGHT_ALIGNED | INVERTED,0,ctx->screen_txt_ysize - 1,(char*)copyright_msg);

	// Top header : current folder path
	clear_line(ctx, 0, INVERTED);
	hxc_print(ctx,LEFT_ALIGNED|INVERTED,0,0, (char*)cur_folder_msg);
}
开发者ID:jfdelnero,项目名称:HXCFE_file_selector,代码行数:32,代码来源:gui_utils.c


示例8: find_command

static int find_command(char *line, int curr_index, int forward)
{
	int	res, cmd_ind, len, ind, c, line_size;
	char	str[READ_BUF_SIZE];
	char	text[READ_BUF_SIZE];

	len = strlen(line) + strlen(Title);
	clear_line(len, len);
	if (forward) {
		if (curr_index == current_hist_ind) {
			printf("%c", BELL_KEY);
			return(curr_index);
		}
	} else {
		if (curr_index <= 0) {
			printf("%c", BELL_KEY);
			return(0);
		}
	};
	memset(text, 0, READ_BUF_SIZE);
	len = 0;
	ind = 0;
	cmd_ind = curr_index;
	for (;;) {
		line_size = ind + strlen(History[cmd_ind]);
		if (forward)
			res = find_cmd_by_text(text, cmd_ind, 1);
		else
			res = find_cmd_by_text(text, cmd_ind, 0);
		if (res != -1)
			cmd_ind = res;
		else
			printf("%c", BELL_KEY);
		if (forward)
			snprintf(str, READ_BUF_SIZE,
				"(i-search)`%s': ", text);
		else
			snprintf(str, READ_BUF_SIZE,
				"(revers-i-search)`%s': ", text);
		clear_line(ind, line_size);
		ind = print_str_by_index(str, 0, -1);
		print_str_by_index(History[cmd_ind], 0, 0);
		c = getchar();
		if (c == BACKSP_KEY) {
			len--;
			if (len < 0) len = 0;
			text[len] = 0;
		} else if ((c < ' ') || (c > 'z')) {
			ungetc(c, stdin);
			break;
		};
		text[len++] = c;
		if (len >= READ_BUF_SIZE) break;
	};
	res = ind + strlen(History[cmd_ind]);
	clear_line(ind, res);
	return(cmd_ind);
}
开发者ID:openhpi1,项目名称:openhpitest,代码行数:58,代码来源:inputcmd.c


示例9: exception_handler

void exception_handler(int vec_no, int err_code, int eip, int cs, int eflags)
{
  char *err_msg[] = {
                      "#DE: Dvivde Error", 
		      "#DB: RESERVED",
		      "-- : NMI Interrupt", 
		      "#BP: Breakppoint",
		      "#OF: Overflow",
		      "#BR: BOUND Range Exceeded",
		      "#UD: Invalid Opcode (Undefined Opcode)",
		      "#NM: Device Not Available (No Math Coprocessor)",
		      "#DF: Double Fault",
		      "   : Coprocessor Segment Overrun (reserved)",
		      "#TS: Invalid TSS",
		      "#NP: Segment Not Present",
		      "#SS: Stack-Segment Fault",
		      "#GP: General Protection",
		      "#PF: Page Fault",
		      "-- : (Intel reserved. Do not use.)",
		      "#MF: x87 FPU Floating-Point Error (Math Fault)",
		      "#AC: Alignment Check",
		      "#MC: Machine Check",
		      "#XF: SIMD Floating-Point Exceprion"
                    };
  //clear();
  s32_print("exception_handler", (u8*)(0xb8000+160*24));

  u8 str[12]="";
  u8 *str_ptr = str;

  clear_line(0);
  clear_line(1);
  clear_line(2);
  clear_line(3);
  clear_line(23);

  s32_print(err_msg[vec_no], (u8*)(0xb8000+160*23));
  str_ptr = s32_itoa(eflags, str_ptr, 16);
  s32_print("eflags", (u8*)(0xb8000+160*0));
  s32_print(str_ptr, (u8*)(0xb8000+160*1));

  str_ptr = s32_itoa(cs, str_ptr, 16);
  s32_print("cs", (u8*)(0xb8000+160*2));
  s32_print(str_ptr, (u8*)(0xb8000+160*3));
  
  str_ptr = s32_itoa(eip, str_ptr, 16);
  clear_line(4);
  s32_print("eip", (u8*)(0xb8000+160*4));
  clear_line(5);
  s32_print(str_ptr, (u8*)(0xb8000+160*5));

  if (err_code != 0xffffffff)
  {
    str_ptr = s32_itoa(err_code, str_ptr, 16);
    clear_line(6);
    s32_print("err_code", (u8*)(0xb8000+160*6));
    clear_line(7);
    s32_print(str_ptr, (u8*)(0xb8000+160*7));
  }
}
开发者ID:benwei,项目名称:simple_os,代码行数:60,代码来源:start.c


示例10: display_selection_altaccum

// *************************************************************************************************
// @fn          display_selection_altaccum
// @brief       Display altitude accumulator ON or OFF
// @param       u8 segments			where to display, usually LCD_SEG_L2_4_0
//				u32 index			0 = OFF, 1 = ON
//				u8 digits			Not used
//				u8 blanks			Not used
// @return      none
// *************************************************************************************************
void display_selection_altaccum (u8 segments, u32 index, u8 digits, u8 blanks)
{
    if (index) {
        clear_line(LINE2);
        display_chars(segments, (u8*)" ON  ", SEG_ON_BLINK_ON);		// display "ON" on bottom line
    }
    else {
        clear_line(LINE2);
        display_chars(segments, (u8*)" OFF ", SEG_ON_BLINK_ON);		// display "OFF" on bottom line
    }
}
开发者ID:ngerstle,项目名称:OpenChronos,代码行数:20,代码来源:altitude.c


示例11: display_update

// *************************************************************************************************
// @fn          display_update
// @brief       Process display flags and call LCD update routines.
// @param       none
// @return      none
// *************************************************************************************************
void display_update(void)
{
    unsigned char line;
    unsigned char string[8];

    // ---------------------------------------------------------------------
    // Call Line1 display function
    if (display.flag.full_update || display.flag.line1_full_update)
    {
        clear_line(LINE1);
        fptr_lcd_function_line1(LINE1, DISPLAY_LINE_UPDATE_FULL);
    } else if (ptrMenu_L1->display_update())
    {
        // Update line1 only when new data is available
        fptr_lcd_function_line1(LINE1, DISPLAY_LINE_UPDATE_PARTIAL);
    }

    // ---------------------------------------------------------------------
    // If message text should be displayed on Line2, skip normal update
    if (message.flag.show)
    {
        line = LINE2;

        // Select message to display
        if (message.flag.type_locked)
            memcpy(string, "  LO?T", 6);
        else if (message.flag.type_unlocked)
            memcpy(string, "  OPEN", 6);

        // Clear previous content
        clear_line(line);
        fptr_lcd_function_line2(line, DISPLAY_LINE_CLEAR);

        // Next second tick erases message and repaints original screen content
        message.all_flags = 0;
        message.flag.erase = 1;
    }
    // ---------------------------------------------------------------------
    // Call Line2 display function
    else if (display.flag.full_update || display.flag.line2_full_update)
    {
        clear_line(LINE2);
        fptr_lcd_function_line2(LINE2, DISPLAY_LINE_UPDATE_FULL);
    } else if (ptrMenu_L2->display_update() && !message.all_flags)
    {
        // Update line2 only when new data is available
        fptr_lcd_function_line2(LINE2, DISPLAY_LINE_UPDATE_PARTIAL);
    }

    // Clear display flag
    display.all_flags = 0;
}
开发者ID:darkdanito,项目名称:ICT2104-Embedded_Programming-SIT_UP,代码行数:58,代码来源:main.c


示例12: CaenVmeIrqCheck

void CaenVmeIrqCheck(int32_t BHandle, man_par_t *man)
{
    CVErrorCodes        ret ;

    con_printf(" CHECK IRQ\n");

    CAENVME_IRQCheck(BHandle,&man->irqstat);            // Check IRQ Status

    con_printf(" IRQ status: %02X\n",man->irqstat);
    con_printf(" Interrupt Level to Acknowledge (0 to exit) : ");  // Get the int level   
    con_scanf("%x",&man->level); 

    if (man->level == 0)
    {
        clear_line(Y_COMM);
        clear_line(Y_COMM+1);
        clear_line(Y_COMM+2);
        return ;
    }

    con_printf_xy(X_COMM,Y_COMM+2," Waiting for interrupt ... Press any key to stop.");

    while (!(man->irqstat & (1<<(man->level-1))) && !con_kbhit())   // Check Int loop
        CAENVME_IRQCheck(BHandle,&man->irqstat);

    gotoxy(X_COMM,Y_COMM) ;

    if(man->irqstat & (1<<(man->level-1)))
    {

        ret = CAENVME_IACKCycle(BHandle,man->level,&man->data,man->dtsize);
 
        switch (ret)
        {
        case cvSuccess   : con_printf(" Cycle completed normally\n");                                                       
            con_printf(" Int. Ack. on IRQ%d: StatusID = %0X",man->level,man->data);
            break ;
        case cvBusError  : con_printf(" Bus Error !!!");
            break ;                                
        case cvCommError : con_printf(" Communication Error !!!");
            break ;
        default          : con_printf(" Unknown Error !!!");
            break ;


        }
    }
    else
        con_printf(" Interrupt request IRQ%d not active",man->level);
     
}
开发者ID:bianle,项目名称:daq,代码行数:51,代码来源:CAENVMEDemoVme.c


示例13: update_display

void update_display(void) {
  void (*display_handler)(char*,char*) = state_handlers[state].display;
  char line_1[17];
  char line_2[17];
  
  clear_line(line_1);
  clear_line(line_2);
  
  if (display_handler == NULL) return;
  
  display_handler(line_1, line_2);
  display_line(LCD_LINE_1, line_1);
  display_line(LCD_LINE_2, line_2);
}
开发者ID:iWuzHere,项目名称:SYSC2003-project,代码行数:14,代码来源:assign65.c


示例14: menu_import

/*ARGSUSED*/
int
menu_import(WINDOW *win, node_t *current, node_t *list)
{
    char inv_path[MAXPATHLEN];
    struct stat s;
    char *fstabname;
    data_t *d;

    for(;;) {
	inv_path[0] = '\0';

	if(get_string(win, "Path to inventory to be imported: ", inv_path, MAXPATHLEN) == ERR) {
	    put_error("Error: invalid input");
	    continue;
	}
	if(strlen(inv_path) == 0) {
	    clear_line(stdscr, LINES - 1);
	    return BOOL_FALSE;
	}
	if(stat(inv_path, &s) < 0 || !S_ISDIR(s.st_mode)) {
	    put_error("Error: invalid path");
	    continue;
	}
	clear_line(stdscr, LINES - 1);

	fstabname = GetFstabFullPath(inv_path);
	if(fstabname == NULL) {
	    put_footer("internal memory error: import inventory", ALIGN_LEFT);
	    exit(1);
	}

	while(current->next != NULL) {
	    current = current->next;
	}
	generate_fstab_menu(inv_path, current, 0, fstabname);
	free(fstabname);

	while(current->next != NULL) {
	    current = current->next;
	    d = current->data;
	    d->text[1] = 'I';
	    d->imported = BOOL_TRUE;
	}
	redraw_screen = BOOL_TRUE;
	break;
    }

    return BOOL_FALSE;
}
开发者ID:jkkm,项目名称:xfsdump,代码行数:50,代码来源:cmenu.c


示例15: chg_dir

void
chg_dir()
{
	extern int fd;
	WINDOW *ch_win, *newwin();
	char *ans, *dir, *expand(), *cwd, *getcwd(), cwdbuf[200];
	char *get_str();

	cwd = getcwd(cwdbuf, 200);

	ch_win = newwin(6, 70, 5, 5);

	mvwprintw(ch_win, 2, 4, "Current directory: %s", cwd);
	mvwaddstr(ch_win, 3, 4, "New directory: ");
	box(ch_win, VERT, HORZ);

	mvwattrstr(ch_win, 0, 3, A_BOLD, " Change directory ");
	wmove(ch_win, 3, 19);
	wrefresh(ch_win);
					/* get the answer */
	while ((ans = get_str(ch_win, 80, "", " \t\n")) != NULL) {
					/* a CR means no change */
		if (*ans == '\0')
			break;
					/* expand the input */
		dir = expand(ans);
					/* if you have search permission */
		if (!access(dir, 1)) {
			if (!chdir(dir))
				break;
		}
		beep();
		mvwattrstr(ch_win, 4, 15, A_BOLD, "No such directory or no access permission");
		wrefresh(ch_win);
		wait_key(ch_win, 3);
					/* clean up the mess */
		clear_line(ch_win, 3, 19, TRUE);
		clear_line(ch_win, 4, 14, TRUE);
		wmove(ch_win, 3, 19);
		wrefresh(ch_win);
	}
	if (fd == -1) {
		werase(ch_win);
		wrefresh(ch_win);
	}
	delwin(ch_win);
	return;
}
开发者ID:LambdaCalculus379,项目名称:SLS-1.02,代码行数:48,代码来源:chg_dir.c


示例16: oMemBuff

//-----------------------------------------------------------------------------
void graphics::show_time(const tm* lcTime, int line_no)
{
	const int SIZE = 50;
	int length;
	int xCo;
	char memBuff[SIZE];
	ostrstream oMemBuff(memBuff, SIZE);
	oMemBuff << dayOfWeek[lcTime->tm_wday] << ", " << lcTime->tm_mday << ' '
		<< months[lcTime->tm_mon] << ' ' << lcTime->tm_year + 1900 << ". ";
	if(lcTime->tm_hour < 10)
		oMemBuff << '0' << lcTime->tm_hour << " : ";
	else
		oMemBuff << lcTime->tm_hour << " : ";
	if(lcTime->tm_min < 10)
		oMemBuff << '0' << lcTime->tm_min << " : ";
	else
		oMemBuff << lcTime->tm_min << " : ";
	if(lcTime->tm_sec < 10)
		oMemBuff << '0' << lcTime->tm_sec;
	else
		oMemBuff << lcTime->tm_sec;
	oMemBuff << '\0';
	length = strlen(memBuff);
	xCo = (console_size.X - length) / 2;
	set_cursor_pos(1, line_no);
	clear_line();
	set_cursor_pos(xCo, line_no);
	cout << memBuff;
}
开发者ID:skandhurkat,项目名称:Just-For-Fun,代码行数:30,代码来源:msConGra.cpp


示例17: distrib_buttons

int		distrib_buttons(int i, char **result, char *buffer, int *v)
{
	if (buffer[0] == 10)
		return (-2);
	else if (buffer[0] == 27 && buffer[1] == 91)
		i = distrib_arrow(i, result, buffer, v);
	else if (buffer[0] == 127)
		*result = del_c(*result, &i);
	else if (buffer[0] == 9 && *result && i == ft_strlen(*result))
		i = distrib_tab(i, result);
	else if (buffer[0] == 12)
		clear_and_prompt();
	else if (buffer[0] == 1)
		i = ctrl_a(i, result);
	else if (buffer[0] == 5)
		i = ctrl_k(i, result);
	else if (buffer[0] == 21)
	{
		clear_line(i + 1, ft_strlen(*result));
		*result = NULL;
		i = 0;
	}
	else if (buffer[0] == 4)
		ft_exit(NULL);
	else
		ft_putstr(tgetstr("le", NULL));
	return (i);
}
开发者ID:Fusiow,项目名称:msh,代码行数:28,代码来源:read.c


示例18: buffer_line

static void buffer_line(int linenum)
{
	int i;
	past_eof = 0;

	if (linenum < 0 || linenum > num_flines) {
		clear_line();
		printf("%s%s%i%s", HIGHLIGHT, "Cannot seek to line number ", linenum + 1, NORMAL);
	}
	else if (linenum < (num_flines - height - 2)) {
		for (i = 0; i < (height - 1); i++) {
			free(buffer[i]);
			buffer[i] = bb_xstrdup(flines[linenum + i]);
		}
		line_pos = linenum;
		buffer_print();
	}
	else {
		for (i = 0; i < (height - 1); i++) {
			free(buffer[i]);
			if (linenum + i < num_flines + 2)
				buffer[i] = bb_xstrdup(flines[linenum + i]);
			else
				buffer[i] = bb_xstrdup((flags & FLAG_TILDE) ? "\n" : "~\n");
		}
		line_pos = linenum;
		/* Set past_eof so buffer_down and buffer_up act differently */
		past_eof = 1;
		buffer_print();
	}
}
开发者ID:alhazred,项目名称:busybox-solaris,代码行数:31,代码来源:less.c


示例19: draw_keybindings

void
draw_keybindings(PANEL *panel, const char *keybindings[], int count)
{
    int height, width, key, xpos = 0;

    // Get window available space
    WINDOW *win = panel_window(panel);
    getmaxyx(win, height, width);

    // Reverse colors on monochrome terminals
    if (!has_colors())
        wattron(win, A_REVERSE);

    // Write a line all the footer width
    wattron(win, COLOR_PAIR(CP_DEF_ON_CYAN));
    clear_line(win, height - 1);

    // Draw keys and their actions
    for (key = 0; key < count; key += 2) {
        wattron(win, A_BOLD | COLOR_PAIR(CP_WHITE_ON_CYAN));
        mvwprintw(win, height - 1, xpos, "%-*s", strlen(keybindings[key]) + 1, keybindings[key]);
        xpos += strlen(keybindings[key]) + 1;
        wattroff(win, A_BOLD | COLOR_PAIR(CP_WHITE_ON_CYAN));
        wattron(win, COLOR_PAIR(CP_BLACK_ON_CYAN));
        mvwprintw(win, height - 1, xpos, "%-*s", strlen(keybindings[key + 1]) + 1,
                  keybindings[key + 1]);
        wattroff(win, COLOR_PAIR(CP_BLACK_ON_CYAN));
        xpos += strlen(keybindings[key + 1]) + 3;
    }

    // Disable reverse mode in all cases
    wattroff(win, A_REVERSE);
}
开发者ID:erhuabushuo,项目名称:sngrep,代码行数:33,代码来源:ui_manager.c


示例20: update_schedule

u8 update_schedule()
{
	update_schedule_time();
	clear_line(LINE2);
	if(sSchedule.state == SCHEDULE_ENABLED)
	{
		if(sSchedule.currentlyShown == PERIOD)
		{
			display_chars(LCD_SEG_L2_4_0, sSchedule.period, SEG_ON);
		}
		else if(sSchedule.currentlyShown == TIME)
		{
			display_chars(LCD_SEG_L2_3_0, itoa(sSchedule.end, 4, 0), SEG_ON);
			display_symbol(LCD_SEG_L2_COL0, SEG_ON);
		}
	}
	else if (sSchedule.state == SCHEDULE_DISABLED)
	{
		display_chars(LCD_SEG_L2_4_0, sSchedule.period, SEG_ON);
	}
	/*else if (sSchedule.state == SCHEDULE_NONE)
	{
		if (is_schedule())
		{
			menu_skip_next(LINE2);
		}
	}*/
	return 1;
}
开发者ID:lieb005,项目名称:My_Stuff,代码行数:29,代码来源:schedule.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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