本文整理汇总了C++中wscrl函数的典型用法代码示例。如果您正苦于以下问题:C++ wscrl函数的具体用法?C++ wscrl怎么用?C++ wscrl使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wscrl函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: showdiskspace
int 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;
}
示例2: mntlistmain
int 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;
}
示例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 */
}
示例4: scrollethwin
static 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);
}
}
}
示例5: scrollgstatwin
static 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);
}
}
}
示例6: GroupMgr
int 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;
}
示例7: text_screen_scroll
static 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);
}
示例8: vtScroll
void 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);
}
示例9: print_starting_message
void 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();
}
示例10: wscrl
void WindowManager::writeToDebugLog(const char* line)
{
if (debugLogLine == 10)
wscrl(debugLog,1);
else
++debugLogLine;
mvwprintw(debugLog,debugLogLine-1,0,line);
}
示例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);
}
示例12: Wscrl
void
Wscrl ( WINDOW *win, int n )
{
int retval;
retval = wscrl (win, n );
if ( retval == ERR )
Fatal_failure ( "wscrl\n" );
}
示例13: wscrl
void 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());
}
}
示例14: caml_curses_wscrl
value 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);
}
示例15: scrollTest
void 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);
}