summaryrefslogtreecommitdiff
path: root/pause.c
diff options
context:
space:
mode:
Diffstat (limited to 'pause.c')
-rw-r--r--pause.c32
1 files changed, 21 insertions, 11 deletions
diff --git a/pause.c b/pause.c
index acca9b786026..eeff0fe7be72 100644
--- a/pause.c
+++ b/pause.c
@@ -1,9 +1,9 @@
/*
- * $Id: pause.c,v 1.36 2012/07/03 00:01:59 tom Exp $
+ * $Id: pause.c,v 1.39 2018/06/19 22:57:01 tom Exp $
*
* pause.c -- implements the pause dialog
*
- * Copyright 2004-2011,2012 Thomas E. Dickey
+ * Copyright 2004-2012,2018 Thomas E. Dickey
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License, version 2.1
@@ -76,22 +76,28 @@ dialog_pause(const char *title,
int result = DLG_EXIT_UNKNOWN;
int button_high = (have_buttons ? BTN_HIGH : MARGIN);
int gauge_y;
- char *prompt = dlg_strclone(cprompt);
+ char *prompt;
int save_timeout = dialog_vars.timeout_secs;
- curs_set(0);
+ DLG_TRACE(("# pause args:\n"));
+ DLG_TRACE2S("title", title);
+ DLG_TRACE2S("message", cprompt);
+ DLG_TRACE2N("height", height);
+ DLG_TRACE2N("width", width);
+ DLG_TRACE2N("seconds", seconds);
- dlg_tab_correct_str(prompt);
+ curs_set(0);
dialog_vars.timeout_secs = 0;
seconds_orig = (seconds > 0) ? seconds : 1;
#ifdef KEY_RESIZE
retry:
- height = old_height;
- width = old_width;
#endif
+ prompt = dlg_strclone(cprompt);
+ dlg_tab_correct_str(prompt);
+
if (have_buttons) {
dlg_auto_size(title, prompt, &height, &width,
MIN_HIGH,
@@ -125,7 +131,7 @@ dialog_pause(const char *title,
dlg_draw_title(dialog, title);
dlg_draw_helpline(dialog, FALSE);
- (void) wattrset(dialog, dialog_attr);
+ dlg_attrset(dialog, dialog_attr);
dlg_print_autowrap(dialog, prompt, height, width);
dlg_draw_box2(dialog,
@@ -141,7 +147,7 @@ dialog_pause(const char *title,
* attribute.
*/
(void) wmove(dialog, gauge_y + MARGIN, 4);
- (void) wattrset(dialog, title_attr);
+ dlg_attrset(dialog, title_attr);
for (i = 0; i < (width - 2 * (3 + MARGIN)); i++)
(void) waddch(dialog, ' ');
@@ -156,9 +162,9 @@ dialog_pause(const char *title,
*/
x = (seconds * (width - 2 * (3 + MARGIN))) / seconds_orig;
if ((title_attr & A_REVERSE) != 0) {
- wattroff(dialog, A_REVERSE);
+ dlg_attroff(dialog, A_REVERSE);
} else {
- (void) wattrset(dialog, A_REVERSE);
+ dlg_attrset(dialog, A_REVERSE);
}
(void) wmove(dialog, gauge_y + MARGIN, 4);
for (i = 0; i < x; i++) {
@@ -196,8 +202,12 @@ dialog_pause(const char *title,
switch (key) {
#ifdef KEY_RESIZE
case KEY_RESIZE:
+ dlg_will_resize(dialog);
dlg_clear(); /* fill the background */
dlg_del_window(dialog); /* delete this window */
+ height = old_height;
+ width = old_width;
+ free(prompt);
refresh(); /* get it all onto the terminal */
goto retry;
#endif