Deleted Added
full compact
arrows.c (251843) arrows.c (255852)
1/*
1/*
2 * $Id: arrows.c,v 1.50 2013/05/24 00:05:21 tom Exp $
2 * $Id: arrows.c,v 1.51 2013/09/02 15:10:09 tom Exp $
3 *
4 * arrows.c -- draw arrows to indicate end-of-range for lists
5 *
6 * Copyright 2000-2012,2013 Thomas E. Dickey
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU Lesser General Public License, version 2.1
10 * as published by the Free Software Foundation.

--- 58 unchanged lines hidden (view full) ---

69 */
70void
71dlg_draw_helpline(WINDOW *win, bool decorations)
72{
73 int cur_x, cur_y;
74 int bottom;
75
76 if (dialog_vars.help_line != 0
3 *
4 * arrows.c -- draw arrows to indicate end-of-range for lists
5 *
6 * Copyright 2000-2012,2013 Thomas E. Dickey
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU Lesser General Public License, version 2.1
10 * as published by the Free Software Foundation.

--- 58 unchanged lines hidden (view full) ---

69 */
70void
71dlg_draw_helpline(WINDOW *win, bool decorations)
72{
73 int cur_x, cur_y;
74 int bottom;
75
76 if (dialog_vars.help_line != 0
77 && dialog_vars.help_line[0] != 0
77 && (bottom = getmaxy(win) - 1) > 0) {
78 chtype attr = A_NORMAL;
78 && (bottom = getmaxy(win) - 1) > 0) {
79 chtype attr = A_NORMAL;
79 const int *cols = dlg_index_columns(dialog_vars.help_line);
80 int cols = dlg_count_columns(dialog_vars.help_line);
80 int other = decorations ? (ON_LEFT + ON_RIGHT) : 0;
81 int avail = (getmaxx(win) - other - 2);
82 int limit = dlg_count_real_columns(dialog_vars.help_line) + 2;
83
84 if (limit < avail) {
85 getyx(win, cur_y, cur_x);
86 other = decorations ? ON_LEFT : 0;
87 (void) wmove(win, bottom, other + (avail - limit) / 2);
88 waddch(win, '[');
81 int other = decorations ? (ON_LEFT + ON_RIGHT) : 0;
82 int avail = (getmaxx(win) - other - 2);
83 int limit = dlg_count_real_columns(dialog_vars.help_line) + 2;
84
85 if (limit < avail) {
86 getyx(win, cur_y, cur_x);
87 other = decorations ? ON_LEFT : 0;
88 (void) wmove(win, bottom, other + (avail - limit) / 2);
89 waddch(win, '[');
89 dlg_print_text(win, dialog_vars.help_line, cols[limit], &attr);
90 dlg_print_text(win, dialog_vars.help_line, cols, &attr);
90 waddch(win, ']');
91 wmove(win, cur_y, cur_x);
92 }
93 }
94}
95
96void
97dlg_draw_arrows2(WINDOW *win,

--- 177 unchanged lines hidden ---
91 waddch(win, ']');
92 wmove(win, cur_y, cur_x);
93 }
94 }
95}
96
97void
98dlg_draw_arrows2(WINDOW *win,

--- 177 unchanged lines hidden ---