diff options
author | nwhitehorn <nwhitehorn@FreeBSD.org> | 2012-10-21 18:18:09 +0000 |
---|---|---|
committer | nwhitehorn <nwhitehorn@FreeBSD.org> | 2012-10-21 18:18:09 +0000 |
commit | a94245b3d36b447d1f761028da7e072210e64b43 (patch) | |
tree | 7533a68fe403654b5f1626734c2336dc7128d3bb /inputbox.c | |
parent | 94f19e002939203294adf4d18b410183682bd2de (diff) | |
download | FreeBSD-src-a94245b3d36b447d1f761028da7e072210e64b43.zip FreeBSD-src-a94245b3d36b447d1f761028da7e072210e64b43.tar.gz |
Import dialog-1.1-20120706
Diffstat (limited to 'inputbox.c')
-rw-r--r-- | inputbox.c | 18 |
1 files changed, 10 insertions, 8 deletions
@@ -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; |