aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/kconfig/lxdialog/msgbox.c
diff options
context:
space:
mode:
authorSam Ravnborg <sam@mars.ravnborg.org>2006-07-27 16:10:27 -0400
committerSam Ravnborg <sam@neptun.ravnborg.org>2006-09-30 05:19:19 -0400
commit2982de6993e6d9944f2215d7cb9b558b465a0c99 (patch)
tree3b4765905e7c53e2a03ed599692d2636623e22a5 /scripts/kconfig/lxdialog/msgbox.c
parent350b5b76384e77bcc58217f00455fdbec5cac594 (diff)
kconfig/menuconfig: lxdialog is now built-in
lxdialog was previously called as an external program causing screen to flicker when used. With this patch lxdialog is now built-in. It is loosly based om previous work by: Petr Baudis <pasky@ucw.cz> Following is a list of changes: o Moved build of dialog routings to kconfig Makefile o menubox + checklist uses a new item list to hold all menu items o in util.c implmented helper function to deal with item list o menubox now uses parameters to save scroll state (avoids temp file) o textbox now get text to be displayed as parameter and not a file o make sure to properly delete subwin's before main windows o killed unused files: lxdialog.c msgbox.c o modified return value for ESC to match direct calling o in a few places the code has been adjusted to 80 char wide o in textbox a small refactoring was made to make code remotely readable o in mconf removed all unused stuff (functions/variables) Following is a list of know short comings: a) pressing ESC twice will be interpreted as two ESC presses b) resize does not work. menuconfig needs to be restarted to be adjusted Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Diffstat (limited to 'scripts/kconfig/lxdialog/msgbox.c')
-rw-r--r--scripts/kconfig/lxdialog/msgbox.c72
1 files changed, 0 insertions, 72 deletions
diff --git a/scripts/kconfig/lxdialog/msgbox.c b/scripts/kconfig/lxdialog/msgbox.c
deleted file mode 100644
index 236759ff3f4e..000000000000
--- a/scripts/kconfig/lxdialog/msgbox.c
+++ /dev/null
@@ -1,72 +0,0 @@
1/*
2 * msgbox.c -- implements the message box and info box
3 *
4 * ORIGINAL AUTHOR: Savio Lam (lam836@cs.cuhk.hk)
5 * MODIFIED FOR LINUX KERNEL CONFIG BY: William Roadcap (roadcapw@cfw.com)
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 */
21
22#include "dialog.h"
23
24/*
25 * Display a message box. Program will pause and display an "OK" button
26 * if the parameter 'pause' is non-zero.
27 */
28int dialog_msgbox(const char *title, const char *prompt, int height, int width,
29 int pause)
30{
31 int i, x, y, key = 0;
32 WINDOW *dialog;
33
34 /* center dialog box on screen */
35 x = (COLS - width) / 2;
36 y = (LINES - height) / 2;
37
38 draw_shadow(stdscr, y, x, height, width);
39
40 dialog = newwin(height, width, y, x);
41 keypad(dialog, TRUE);
42
43 draw_box(dialog, 0, 0, height, width,
44 dlg.dialog.atr, dlg.border.atr);
45
46 print_title(dialog, title, width);
47
48 wattrset(dialog, dlg.dialog.atr);
49 print_autowrap(dialog, prompt, width - 2, 1, 2);
50
51 if (pause) {
52 wattrset(dialog, dlg.border.atr);
53 mvwaddch(dialog, height - 3, 0, ACS_LTEE);
54 for (i = 0; i < width - 2; i++)
55 waddch(dialog, ACS_HLINE);
56 wattrset(dialog, dlg.dialog.atr);
57 waddch(dialog, ACS_RTEE);
58
59 print_button(dialog, " Ok ", height - 2, width / 2 - 4, TRUE);
60
61 wrefresh(dialog);
62 while (key != ESC && key != '\n' && key != ' ' &&
63 key != 'O' && key != 'o' && key != 'X' && key != 'x')
64 key = wgetch(dialog);
65 } else {
66 key = '\n';
67 wrefresh(dialog);
68 }
69
70 delwin(dialog);
71 return key == ESC ? -1 : 0;
72}