int mvvline_set(int y, int x, const cchar_t *wch, int n) { PDC_LOG(("mvvline_set() - called\n")); if (move(y, x) == ERR) return ERR; return wvline_set(stdscr, wch, n); }
int mvwvline_set(WINDOW *win, int y, int x, const cchar_t *wch, int n) { PDC_LOG(("mvwvline_set() - called\n")); if (wmove(win, y, x) == ERR) return ERR; return wvline_set(win, wch, n); }
int wvline(WINDOW *w, chtype v, int n) { int code; cchar_t cc; (void) __m_chtype_cc(v, &cc); code = wvline_set(w, &cc, n); return (code); }
int vline_set(const cchar_t *wch, int n) { PDC_LOG(("vline_set() - called\n")); return wvline_set(stdscr, wch, n); }
void dlg_draw_scrollbar(WINDOW *win, long first_data, long this_data, long next_data, long total_data, int left, int right, int top, int bottom, chtype attr, chtype borderattr) { char buffer[80]; int percent; int len; int oldy, oldx; chtype save = dlg_get_attrs(win); int top_arrow = (first_data != 0); int bottom_arrow = (next_data < total_data); getyx(win, oldy, oldx); dlg_draw_helpline(win, TRUE); if (bottom_arrow || top_arrow || dialog_state.use_scrollbar) { percent = (!total_data ? 100 : (int) ((next_data * 100) / total_data)); if (percent < 0) percent = 0; else if (percent > 100) percent = 100; (void) wattrset(win, position_indicator_attr); (void) sprintf(buffer, "%d%%", percent); (void) wmove(win, bottom, right - 7); (void) waddstr(win, buffer); if ((len = dlg_count_columns(buffer)) < 4) { (void) wattrset(win, border_attr); whline(win, dlg_boxchar(ACS_HLINE), 4 - len); } } #define BARSIZE(num) (int) (0.5 + (double) ((all_high * (int) (num)) / (double) total_data)) #define ORDSIZE(num) (int) ((double) ((all_high * (int) (num)) / (double) all_diff)) if (dialog_state.use_scrollbar) { int all_high = (bottom - top - 1); this_data = MAX(0, this_data); if (total_data > 0 && all_high > 0) { int all_diff = (int) (total_data + 1); int bar_diff = (int) (next_data + 1 - this_data); int bar_high; int bar_y; bar_high = ORDSIZE(bar_diff); if (bar_high <= 0) bar_high = 1; if (bar_high < all_high) { int bar_last = BARSIZE(next_data); wmove(win, top + 1, right); (void) wattrset(win, save); wvline(win, ACS_VLINE | A_REVERSE, all_high); bar_y = ORDSIZE(this_data); if (bar_y >= bar_last && bar_y > 0) bar_y = bar_last - 1; if (bar_last - bar_y > bar_high && bar_high > 1) ++bar_y; bar_last = MIN(bar_last, all_high); wmove(win, top + 1 + bar_y, right); (void) wattrset(win, position_indicator_attr); wattron(win, A_REVERSE); #if defined(WACS_BLOCK) && defined(NCURSES_VERSION) && defined(USE_WIDE_CURSES) wvline_set(win, WACS_BLOCK, bar_last - bar_y); #else wvline(win, ACS_BLOCK, bar_last - bar_y); #endif } } } dlg_draw_arrows2(win, top_arrow, bottom_arrow, left + ARROWS_COL, top, bottom, attr, borderattr); (void) wattrset(win, save); wmove(win, oldy, oldx); }
NCURSES_EXPORT(int) (vline_set) (const cchar_t * a1, int z) { T((T_CALLED("vline_set(%p,%d)"), (const void *)a1, z)); returnCode(wvline_set(stdscr,a1,z)); }
NCURSES_EXPORT(int) (mvwvline_set) (WINDOW * a1, int a2, int a3, const cchar_t * a4, int z) { T((T_CALLED("mvwvline_set(%p,%d,%d,%p,%d)"), (const void *)a1, a2, a3, (const void *)a4, z)); returnCode((wmove(a1,a2,a3) == (-1) ? (-1) : wvline_set(a1,a4,z))); }
NCURSES_EXPORT(int) (mvvline_set) (int a1, int a2, const cchar_t * a3, int z) { T((T_CALLED("mvvline_set(%d,%d,%p,%d)"), a1, a2, (const void *)a3, z)); returnCode((wmove(stdscr,a1,a2) == (-1) ? (-1) : wvline_set(stdscr,a3,z))); }