这篇教程C++ wscrl函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中wscrl函数的典型用法代码示例。如果您正苦于以下问题:C++ wscrl函数的具体用法?C++ wscrl怎么用?C++ wscrl使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了wscrl函数的25个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: showdiskspaceint showdiskspace(){ int dfkey; while(1) { DrawDFUI(); dfkey = getch(); switch(dfkey) { case KEY_F(2): List_DF = 0; break; case KEY_F(10): return 0; break; case KEY_DOWN: wscrl(FSPAD, 3); prefresh(FSPAD, 15, 1, 5, 3, 14, 74); break; case KEY_UP: wscrl(FSPAD, -3); prefresh(FSPAD, 15, 1, 5, 3, 14, 74); break; } } return 0; }
开发者ID:MrUNIXMan,项目名称:FreeBSD-SMIT-0.1-devel,代码行数:30,
示例2: mntlistmainint mntlistmain(){ int FS_KEY; while(1) { drawlistfs(); FS_KEY = getch(); switch(FS_KEY) { case KEY_F(2): ListFS = 0; break; case KEY_F(10): return 0; case KEY_DOWN: wscrl(FSPAD, 3); prefresh(FSPAD, 15, 1, 5, 3, 14, 74); break; case KEY_UP: wscrl(FSPAD, -3); prefresh(FSPAD, 15, 1, 5, 3, 14, 74); break; } }return 0;}
开发者ID:MrUNIXMan,项目名称:FreeBSD-SMIT-0.1-devel,代码行数:30,
示例3: winscroll/********************************************************/ * Description: scrolls window one line up or down * * Returns: none */********************************************************/void winscroll(WINS *windows, WINDOW *win, int n, int currentLine){ int row, col; /* row and col */ getyx(win, row, col); /* get cur row/col */ scrollok(windows->hex, TRUE); /* allow scrolling */ scrollok(windows->ascii, TRUE); scrollok(windows->address, TRUE); wscrl(windows->hex, n); /* scroll each win */ wscrl(windows->ascii, n); wscrl(windows->address, n); scrollok(windows->hex, FALSE); /*disable scrolling */ scrollok(windows->ascii, FALSE); scrollok(windows->address, FALSE); wmove(windows->hex, (n == 1) ? MAXY:0, 0); /* place cursor */ wmove(windows->ascii, (n == 1) ? MAXY:0, 0); wmove(windows->address, (n == 1) ? MAXY:0, 0); outline(fpIN, currentLine); /* output line */ wnoutrefresh(windows->hex); /* set win refreshes */ wnoutrefresh(windows->ascii); wnoutrefresh(windows->address); wmove(win, row, col); /* restore cursor */}
开发者ID:nilcons-contrib,项目名称:hexcurse,代码行数:34,
示例4: scrollethwinstatic void scrollethwin(struct ethtab *table, int direction, unsigned int *idx){ char sp_buf[10]; sprintf(sp_buf, "%%%dc", COLS - 2); wattrset(table->tabwin, STDATTR); if (direction == SCROLLUP) { if (table->lastvisible != table->tail) { wscrl(table->tabwin, 1); table->lastvisible = table->lastvisible->next_entry; table->firstvisible = table->firstvisible->next_entry; (*idx)++; wmove(table->tabwin, LINES - 5, 0); scrollok(table->tabwin, 0); wprintw(table->tabwin, sp_buf, ' '); scrollok(table->tabwin, 1); printethent(table, table->lastvisible, *idx); if (table->lastvisible->type == 1) printrates(table, LINES - 5, table->lastvisible); } } else { if (table->firstvisible != table->head) { wscrl(table->tabwin, -1); table->lastvisible = table->lastvisible->prev_entry; table->firstvisible = table->firstvisible->prev_entry; (*idx)--; wmove(table->tabwin, 0, 0); wprintw(table->tabwin, sp_buf, ' '); printethent(table, table->firstvisible, *idx); if (table->firstvisible->type == 1) printrates(table, 0, table->firstvisible); } }}
开发者ID:rogerhu,项目名称:dd-wrt,代码行数:35,
示例5: scrollgstatwinstatic void scrollgstatwin(struct iftab *table, int direction, unsigned int *idx){ char buf[255]; sprintf(buf, "%%%dc", COLS - 2); wattrset(table->statwin, STDATTR); if (direction == SCROLLUP) { if (table->lastvisible->next_entry != NULL) { wscrl(table->statwin, 1); table->lastvisible = table->lastvisible->next_entry; table->firstvisible = table->firstvisible->next_entry; (*idx)++; wmove(table->statwin, LINES - 5, 0); scrollok(table->statwin, 0); wprintw(table->statwin, buf, ' '); scrollok(table->statwin, 1); printifentry(table->lastvisible, table->statwin, *idx); } } else { if (table->firstvisible != table->head) { wscrl(table->statwin, -1); table->firstvisible = table->firstvisible->prev_entry; table->lastvisible = table->lastvisible->prev_entry; (*idx)--; wmove(table->statwin, 0, 0); wprintw(table->statwin, buf, ' '); printifentry(table->firstvisible, table->statwin, *idx); } }}
开发者ID:ebichu,项目名称:dd-wrt,代码行数:31,
示例6: GroupMgrint GroupMgr(){ /* User mgr Key */ if(gethostname(computer, 255) !=0 || uname(&uts) < 0) { MsgBoxError("Unable to get hostname information"); } int GroupMgrItem = 0; keypad(stdscr, TRUE); noecho(); while(1) { DrawGroupMgrScreen(GroupMgrItem); do { GRkey = getch(); switch(GRkey) { case KEY_F(2): listgrctr = 100; newgrlist = 0; break; case KEY_F(3): useradd(); break; case KEY_F(10): return 0; break;; case KEY_DOWN: wscrl(GroupPad, 3); //mvprintw(1, x/2, "Username: %s", usernames[UserNo++]); break;; case KEY_UP: wscrl(GroupPad, -3); break;; }; DrawGroupMgrScreen(GroupMgrItem); } while(GRkey != '/n'); /* Responses */ }; /*End of While */ return 0;}
开发者ID:MrUNIXMan,项目名称:FreeBSD-SMIT-0.1-devel,代码行数:55,
示例7: text_screen_scrollstatic void text_screen_scroll(struct text_screen *screen, int key){ int win_lines = getmaxy(screen->scr.sub_ncw); int win_cols = getmaxx(screen->scr.sub_ncw) - 1; int delta, len, i; if (key == KEY_UP) delta = -1; else if (key == KEY_DOWN) delta = 1; else return; if (screen->scroll_y + delta < 0) return; if (screen->scroll_y + delta + win_lines > screen->n_lines) return; screen->scroll_y += delta; wscrl(screen->scr.sub_ncw, delta); if (delta > 0) { i = screen->scroll_y + win_lines - 1; len = strncols(screen->lines[i]) > win_cols ? win_cols : -1; mvwaddnstr(screen->scr.sub_ncw, win_lines - 1, 1, screen->lines[i], len); } else if (delta < 0) { i = screen->scroll_y; len = strncols(screen->lines[i]) > win_cols ? win_cols : -1; mvwaddnstr(screen->scr.sub_ncw, 0, 1, screen->lines[i], len); } wrefresh(screen->scr.sub_ncw);}
开发者ID:sammj,项目名称:petitboot,代码行数:35,
示例8: vtScrollvoid vtScroll(VTScreenView *view, int dest_row, int src_row, int num_line) { struct virtualTerminal *vt = (struct virtualTerminal*) view->object; scrollok(vt->window, 1); wscrl(vt->window, src_row - dest_row); scrollok(vt->window, 0); //mvwprintw((WINDOW*)vt->window, 0,0, "dest: %d src: %d num_line: %d/n", dest_row, src_row, num_line);}
开发者ID:alanszlosek,项目名称:knox,代码行数:7,
示例9: print_starting_messagevoid Chat::draw(Session& sess, int num_lines, int start, int scroll) { // if current session is empty if (sess.messages.size() == 0) { print_starting_message("This is the beginning of your chat."); return; } start = std::min(start, (int)sess.messages.size() - 1); if (scroll) { wborder(win, ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '); wscrl(win, scroll); } for (int i = 0; i < abs(num_lines) && i < sess.messages.size(); i++, start++) { int dim = sess.delta - sess.scrolled_back + start; bool sender = sess.messages.at(dim).sender; auto m = sess.messages.at(dim).content; if (sender) { wattron(win, A_BOLD); } mvwprintw(win, start + 1, 1, m.c_str()); wattroff(win, A_BOLD); } draw_borders();}
开发者ID:ga2arch,项目名称:slack,代码行数:26,
示例10: wscrlvoid WindowManager::writeToDebugLog(const char* line){ if (debugLogLine == 10) wscrl(debugLog,1); else ++debugLogLine; mvwprintw(debugLog,debugLogLine-1,0,line);}
开发者ID:case93,项目名称:Chiasmus2,代码行数:8,
示例11: do_scroll/* scroll up n lines (n may be negative) */static void do_scroll(WINDOW *win, int *scroll, int n){ /* Scroll menu up */ scrollok(win, TRUE); wscrl(win, n); scrollok(win, FALSE); *scroll = *scroll + n; wrefresh(win);}
开发者ID:andy737,项目名称:firebrickRemote,代码行数:10,
示例12: WscrlvoidWscrl ( WINDOW *win, int n ){ int retval; retval = wscrl (win, n ); if ( retval == ERR ) Fatal_failure ( "wscrl/n" );}
开发者ID:kkaneda,项目名称:vm,代码行数:10,
示例13: wscrlvoid ScrollWin::scrollUp() { if (pos + height == static_cast<signed>(buffer.size()) || static_cast<signed>(buffer.size()) < height) return; wscrl(win, -1); pos++; if (static_cast<signed>(buffer.size()) - pos > height-1) { mvwprintw(win, 0, 0, "%s", buffer[buffer.size()-pos-height].c_str()); }}
开发者ID:nullren,项目名称:sillypoker,代码行数:10,
示例14: caml_curses_wscrlvalue caml_curses_wscrl(value mlwindow, value lines) { CAMLparam2(mlwindow, lines); WINDOW *window = window_of_ml(mlwindow); /* Scroll the window; lines > 0, scroll UP; lines < 0, scroll DN */ wscrl(window, Int_val(lines)); CAMLreturn(Val_unit);}
开发者ID:camlspotter,项目名称:my-ocaml-win,代码行数:11,
示例15: scrollTestvoid scrollTest(WINDOW *win){ int i, OldY;#ifndef PDCURSES int OldX;#endif werase(win); mvwaddstr(win, height - 2, 1, "The window will now scroll slowly"); box(win, ACS_VLINE, ACS_HLINE); wrefresh(win); scrollok(win, TRUE); napms(500); for (i = 1; i <= height; i++) { napms(150); scroll(win); wrefresh(win); };#ifdef PDCURSES OldY = getmaxy(win);#else getmaxyx(win, OldY, OldX);#endif mvwaddstr(win, 6, 1, "The top of the window will scroll"); wmove(win, 1, 1); wsetscrreg(win, 0, 4); box(win, ACS_VLINE, ACS_HLINE); wrefresh(win); for (i = 1; i <= 5; i++) { napms(500); scroll(win); wrefresh(win); } mvwaddstr(win, 3, 1, "The bottom of the window will scroll"); wmove(win, 8, 1); wsetscrreg(win, 5, --OldY); box(win, ACS_VLINE, ACS_HLINE); wrefresh(win); for (i = 5; i <= OldY; i++) { napms(300); wscrl(win, -1); wrefresh(win); } wsetscrreg(win, 0, OldY);}
开发者ID:Bill-Gray,项目名称:PDCurses,代码行数:53,
示例16: scrollTeststatic voidscrollTest(WINDOW *win){ int i; int half; int OldY; NCURSES_CONST char *Message = "The window will now scroll slowly"; wclear(win); OldY = getmaxy(win); half = OldY / 2; MvWAddStr(win, OldY - 2, 1, Message); wrefresh(win); scrollok(win, TRUE); for (i = 1; i <= OldY; i++) { napms(600); scroll(win); wrefresh(win); } werase(win); for (i = 1; i < OldY; i++) { MvWPrintw(win, i, 1, "Line %d", i); } MvWPrintw(win, OldY - 2, 1, "The top of the window will scroll"); wmove(win, 1, 1); wsetscrreg(win, 0, half - 1); box(win, ACS_VLINE, ACS_HLINE); wrefresh(win); for (i = 1; i <= half; i++) { napms(600); scroll(win); box(win, ACS_VLINE, ACS_HLINE); wrefresh(win); } werase(win); for (i = 1; i < OldY; i++) { MvWPrintw(win, i, 1, "Line %d", i); } MvWPrintw(win, 1, 1, "The bottom of the window will scroll"); wmove(win, OldY - 2, 1); wsetscrreg(win, half, --OldY); box(win, ACS_VLINE, ACS_HLINE); wrefresh(win); for (i = half; i <= OldY; i++) { napms(600); wscrl(win, -1); box(win, ACS_VLINE, ACS_HLINE); wrefresh(win); } wsetscrreg(win, 0, OldY);}
开发者ID:ThomasDickey,项目名称:ncurses-snapshots,代码行数:53,
示例17: lui_scroll_window/* window:scroll(nlines) if nlines > 0 scroll up nlines otherwise scroll down nlines*/int lui_scroll_window(lua_State *L){ PANEL *p; WINDOW *w; int nlines; p = check_window(L, 1); nlines = luaL_checkinteger(L, 2); w = panel_window(p); wscrl(w, nlines); wrefresh(w); return 0;}
开发者ID:Sarcasm,项目名称:luasoul,代码行数:19,
示例18: curses_printvoid curses_print(string _message){ /*int _col; int _row; getyx(stdscr,_row,_col) ; move(_row+1,0); */ wscrl(stdscr, -1); move(0, 0); printw(_message.c_str()); refresh(); /* Print it on to the real screen */ }
开发者ID:010175,项目名称:switchboard,代码行数:15,
示例19: scroll_treevoid scroll_tree(int n_lines){ int min_n_lines, max_n_lines; if ((min_n_lines = -g_list_position(lines, first_line)) > n_lines) n_lines = min_n_lines; else if ((max_n_lines = g_list_length(last_line) - 1) < n_lines) n_lines = max_n_lines; wscrl(tree_window, n_lines); if (n_lines < 0) { first_line = g_list_nth(lines, g_list_position(lines, first_line) + n_lines); update_last_line(); print_lines(first_line, g_list_nth(first_line, -n_lines), FALSE); } else if (n_lines > 0) { first_line = g_list_nth(first_line, n_lines); update_last_line(); print_lines(g_list_nth(lines, g_list_position(lines, last_line) - n_lines), last_line, TRUE); }}
开发者ID:Harvie,项目名称:Programs,代码行数:21,
示例20: Q_UNUSEDvoid NYView::guiScroll(int dx, int dy){ Q_UNUSED(dx); //TODO if(dy >= getLinesVisible()) { guiPaintEvent(YSelection(YInterval(YCursor(0, 0), YCursor(getColumnsVisible() - 1, getLinesVisible() - 1)))); } else { scrollok(editor, true); wscrl(editor, dy); scrollok(editor, false); int top = 0; int n = qAbs(dy); if(dy > 0) { /* redraw the new bottom */ top += getLinesVisible() - n; } guiPaintEvent(YSelection(YInterval(YCursor(0, top), YCursor(getColumnsVisible() - 1, top + n - 1)))); }}
开发者ID:sandsmark,项目名称:yzis,代码行数:21,
示例21: move_viewstatic void move_view(struct view *view, int lines){ /* The rendering expects the new offset. */ view->offset += lines; assert(0 <= view->offset && view->offset < view->lines); assert(lines); int line = lines > 0 ? view->height - lines : 0; int end = line + (lines > 0 ? lines : -lines); wscrl(view->win, lines); for (; line < end; line++) { if (!view->render(view, line)) break; } /* Move current line into the view. */ if (view->lineno < view->offset) { view->lineno = view->offset; view->render(view, 0); } else if (view->lineno >= view->offset + view->height) { view->lineno = view->offset + view->height - 1; view->render(view, view->lineno - view->offset); } assert(view->offset <= view->lineno && view->lineno < view->lines); redrawwin(view->win); wrefresh(view->win); update_title_win(view);}
开发者ID:lexuszhi1990,项目名称:hen,代码行数:39,
示例22: wscrl_cmdstatic TACommandVerdict wscrl_cmd(TAThread thread, TAInputStream stream){ WINDOW* win; int n; int res; // Prepare win = readPointer(&stream); n = readInt(&stream); START_TARGET_OPERATION(thread); // Execute res = wscrl(win, n); END_TARGET_OPERATION(thread); // Response writeInt(thread, res); sendResponse(thread); return taDefaultVerdict;}
开发者ID:levenkov,项目名称:olver,代码行数:23,
示例23: dialog_checklist//.........这里部分代码省略......... print_item(list, i, i == choice); } print_arrows(dialog, choice, item_count(), scroll, box_y, box_x + check_x + 5, list_height); print_buttons(dialog, height, width, 0); wnoutrefresh(dialog); wnoutrefresh(list); doupdate(); while (key != KEY_ESC) { key = wgetch(dialog); for (i = 0; i < max_choice; i++) { item_set(i + scroll); if (toupper(key) == toupper(item_str()[0])) break; } if (i < max_choice || key == KEY_UP || key == KEY_DOWN || key == '+' || key == '-') { if (key == KEY_UP || key == '-') { if (!choice) { if (!scroll) continue; /* */ if (list_height > 1) { /* */ item_set(scroll); print_item(list, 0, FALSE); scrollok(list, TRUE); wscrl(list, -1); scrollok(list, FALSE); } scroll--; item_set(scroll); print_item(list, 0, TRUE); print_arrows(dialog, choice, item_count(), scroll, box_y, box_x + check_x + 5, list_height); wnoutrefresh(dialog); wrefresh(list); continue; /* */ } else i = choice - 1; } else if (key == KEY_DOWN || key == '+') { if (choice == max_choice - 1) { if (scroll + choice >= item_count() - 1) continue; /* */ if (list_height > 1) { /* */ item_set(scroll + max_choice - 1); print_item(list, max_choice - 1, FALSE); scrollok(list, TRUE); wscrl(list, 1); scrollok(list, FALSE); } scroll++; item_set(scroll + max_choice - 1); print_item(list, max_choice - 1, TRUE);
开发者ID:romanbb,项目名称:android_kernel_lge_d851,代码行数:67,
示例24: dialog_checklist//.........这里部分代码省略......... key == '/r') && onlist)) { /* if moving from buttons to the list, reset and redraw buttons */ if (!onlist) { onlist = 1; button = 0; if (ditems && result) { print_button(dialog, ditems[CANCEL_BUTTON].prompt, y, x + strlen(ditems[OK_BUTTON].prompt) + 5, ditems[CANCEL_BUTTON].checked ? ditems[CANCEL_BUTTON].checked(&ditems[CANCEL_BUTTON]) : button); print_button(dialog, ditems[OK_BUTTON].prompt, y, x, ditems[OK_BUTTON].checked ? ditems[OK_BUTTON].checked(&ditems[OK_BUTTON]) : !button); } else { print_button(dialog, "Cancel", y, x + 14, button); print_button(dialog, " OK ", y, x, !button); } wmove(list, choice, check_x+1); wnoutrefresh(dialog); wrefresh(list); } if (key >= '1' && key <= MIN('9', '0'+max_choice)) i = key - '1'; else if (KEY_IS_UP(key)) { if (!choice) { if (scroll) { /* Scroll list down */ getyx(dialog, cur_y, cur_x); /* Save cursor position */ if (list_height > 1) { /* De-highlight current first item before scrolling down */ print_item(list, items[scroll * 3], items[scroll * 3 + 1], status[scroll], 0, FALSE, DREF(ditems, scroll), list_width, item_x, check_x); scrollok(list, TRUE); wscrl(list, -1); scrollok(list, FALSE); } scroll--; print_item(list, items[scroll*3], items[scroll*3 + 1], status[scroll], 0, TRUE, DREF(ditems, scroll), list_width, item_x, check_x); print_arrows(dialog, scroll, list_height, item_no, box_x, box_y, check_x + 4, cur_x, cur_y); wmove(list, choice, check_x+1); wnoutrefresh(dialog); wrefresh(list); } continue; /* wait for another key press */ } else i = choice - 1; } else if (KEY_IS_DOWN(key)) { if (choice == max_choice - 1) { if (scroll + choice < item_no - 1) { /* Scroll list up */ getyx(dialog, cur_y, cur_x); /* Save cursor position */ if (list_height > 1) { /* De-highlight current last item before scrolling up */ print_item(list, items[(scroll + max_choice - 1) * 3], items[(scroll + max_choice - 1) * 3 + 1], status[scroll + max_choice - 1], max_choice - 1, FALSE, DREF(ditems, scroll + max_choice - 1), list_width, item_x, check_x); scrollok(list, TRUE); scroll(list); scrollok(list, FALSE); } scroll++; print_item(list, items[(scroll + max_choice - 1) * 3],
开发者ID:edgar-pek,项目名称:PerspicuOS,代码行数:67,
示例25: dialog_textbox//.........这里部分代码省略......... dlg_mouse_mkbigregion(0, 0, PAGE_LENGTH + 2, width, KEY_MAX, 1, 1, 1 /* lines */ ); dlg_draw_box2(dialog, 0, 0, height, width, dialog_attr, border_attr, border2_attr); dlg_draw_bottom_box2(dialog, border_attr, border2_attr, dialog_attr); dlg_draw_title(dialog, title); dlg_draw_buttons(dialog, PAGE_LENGTH + 2, 0, obj.buttons, button, FALSE, width); (void) wnoutrefresh(dialog); getyx(dialog, cur_y, cur_x); /* Save cursor position */ dlg_attr_clear(obj.text, PAGE_LENGTH, PAGE_WIDTH, dialog_attr); while (result == DLG_EXIT_UNKNOWN) { /* * Update the screen according to whether we shifted up/down by a line * or not. */ if (moved) { if (next < 0) { (void) scrollok(obj.text, TRUE); (void) scroll(obj.text); /* Scroll text region up one line */ (void) scrollok(obj.text, FALSE); print_line(&obj, PAGE_LENGTH - 1, PAGE_WIDTH); (void) wnoutrefresh(obj.text); } else if (next > 0) { /* * We don't call print_page() here but use scrolling to ensure * faster screen update. However, 'end_reached' and * 'page_length' should still be updated, and 'in_buf' should * point to start of next page. This is done by calling * get_line() in the following 'for' loop. */ (void) scrollok(obj.text, TRUE); (void) wscrl(obj.text, -1); /* Scroll text region down one line */ (void) scrollok(obj.text, FALSE); obj.page_length = 0; passed_end = 0; for (i = 0; i < PAGE_LENGTH; i++) { if (!i) { print_line(&obj, 0, PAGE_WIDTH); /* print first line of page */ (void) wnoutrefresh(obj.text); } else (void) get_line(&obj); /* Called to update 'end_reached' and 'in_buf' */ if (!passed_end) obj.page_length++; if (obj.end_reached && !passed_end) passed_end = 1; } } else { print_page(&obj, PAGE_LENGTH, PAGE_WIDTH); } print_position(&obj, dialog, height, width); (void) wmove(dialog, cur_y, cur_x); /* Restore cursor position */ wrefresh(dialog); } moved = FALSE; /* assume we'll not move */ next = 0; /* ...but not scroll by a line */ key = dlg_mouse_wgetch(dialog, &fkey); if (dlg_result_key(key, fkey, &result)) break; if (!fkey && (code = dlg_char_to_button(key, obj.buttons)) >= 0) { result = dlg_ok_buttoncode(code); break; }
开发者ID:0mp,项目名称:freebsd,代码行数:67,
注:本文中的wscrl函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ wsect函数代码示例 C++ wsa_strerror函数代码示例 |