summaryrefslogtreecommitdiffstats
path: root/contrib/dialog/inputbox.c
diff options
context:
space:
mode:
authornwhitehorn <nwhitehorn@FreeBSD.org>2012-10-21 18:25:12 +0000
committernwhitehorn <nwhitehorn@FreeBSD.org>2012-10-21 18:25:12 +0000
commit59ae05f843643afc6998fcc4b2b415d89a8635ee (patch)
tree74dabcbe10843be3b85112de4524f2abb8e4112f /contrib/dialog/inputbox.c
parent2ad040bf3f552fc8b740e79fe6db1bf91414d583 (diff)
parenta94245b3d36b447d1f761028da7e072210e64b43 (diff)
downloadFreeBSD-src-59ae05f843643afc6998fcc4b2b415d89a8635ee.zip
FreeBSD-src-59ae05f843643afc6998fcc4b2b415d89a8635ee.tar.gz
Update dialog to 20120706: includes minor useability enhancements and
fixes for warnings encountered with clang.
Diffstat (limited to 'contrib/dialog/inputbox.c')
-rw-r--r--contrib/dialog/inputbox.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/contrib/dialog/inputbox.c b/contrib/dialog/inputbox.c
index 14e2c28..9d2eec2 100644
--- a/contrib/dialog/inputbox.c
+++ b/contrib/dialog/inputbox.c
@@ -1,9 +1,9 @@
/*
- * $Id: inputbox.c,v 1.67 2011/06/29 09:48:34 tom Exp $
+ * $Id: inputbox.c,v 1.74 2012/07/01 18:13:40 Zoltan.Kelemen Exp $
*
* inputbox.c -- implements the input box
*
- * Copyright 2000-2010,2011 Thomas E. Dickey
+ * Copyright 2000-2011,2012 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
@@ -90,7 +90,7 @@ dialog_inputbox(const char *title, const char *cprompt, int height, int width,
retry:
#endif
show_buttons = TRUE;
- state = dialog_vars.defaultno ? dlg_defaultno_button() : sTEXT;
+ state = dialog_vars.default_button >= 0 ? dlg_default_button() : sTEXT;
first = (state == sTEXT);
key = fkey = 0;
@@ -116,27 +116,29 @@ dialog_inputbox(const char *title, const char *cprompt, int height, int width,
dlg_mouse_setbase(xorg, yorg);
- dlg_draw_box(dialog, 0, 0, height, width, dialog_attr, border_attr);
- dlg_draw_bottom_box(dialog);
+ 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);
- wattrset(dialog, dialog_attr);
+ (void) wattrset(dialog, dialog_attr);
dlg_draw_helpline(dialog, FALSE);
dlg_print_autowrap(dialog, prompt, height, width);
/* Draw the input field box */
box_width = width - 6;
getyx(dialog, y, x);
+ (void) x;
box_y = y + 2;
box_x = (width - box_width) / 2;
dlg_mouse_mkregion(y + 1, box_x - 1, 3, box_width + 2, 'i');
dlg_draw_box(dialog, y + 1, box_x - 1, 3, box_width + 2,
- border_attr, dialog_attr);
+ border_attr, border2_attr);
/* Make a window for the input-field, to associate bindings */
editor = dlg_sub_window(dialog, 1, box_width, yorg + box_y, xorg + box_x);
- dlg_register_window(editor, "inputbox", binding2);
+ dlg_register_window(editor, "inputbox2", binding2);
+ dlg_trace_win(dialog);
while (result == DLG_EXIT_UNKNOWN) {
int edit = 0;
OpenPOWER on IntegriCloud