aboutsummaryrefslogtreecommitdiff
path: root/scripts/config/lxdialog/msgbox.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2006-10-06 13:51:04 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2006-10-06 13:51:04 +0000
commit4fa499a17b52b299abc3a6ddd289bb6ca74bb84b (patch)
tree17df4dd427d85319857d9b7882585b3db9ad6994 /scripts/config/lxdialog/msgbox.c
parentc12f53090bd41dbb87279083bc442769cb0610f0 (diff)
downloadbusybox-w32-4fa499a17b52b299abc3a6ddd289bb6ca74bb84b.tar.gz
busybox-w32-4fa499a17b52b299abc3a6ddd289bb6ca74bb84b.tar.bz2
busybox-w32-4fa499a17b52b299abc3a6ddd289bb6ca74bb84b.zip
build system: remove loeftover (two empty dirs)
Diffstat (limited to 'scripts/config/lxdialog/msgbox.c')
-rw-r--r--scripts/config/lxdialog/msgbox.c86
1 files changed, 0 insertions, 86 deletions
diff --git a/scripts/config/lxdialog/msgbox.c b/scripts/config/lxdialog/msgbox.c
deleted file mode 100644
index a13bcbafb..000000000
--- a/scripts/config/lxdialog/msgbox.c
+++ /dev/null
@@ -1,86 +0,0 @@
1/* vi: set sw=4 ts=4: */
2/*
3 * msgbox.c -- implements the message box and info box
4 *
5 * ORIGINAL AUTHOR: Savio Lam (lam836@cs.cuhk.hk)
6 * MODIFIED FOR LINUX KERNEL CONFIG BY: William Roadcap (roadcapw@cfw.com)
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 */
22
23#include "dialog.h"
24
25/*
26 * Display a message box. Program will pause and display an "OK" button
27 * if the parameter 'pause' is non-zero.
28 */
29int
30dialog_msgbox (const char *title, const char *prompt, int height, int width,
31 int pause)
32{
33 int i, x, y, key = 0;
34 WINDOW *dialog;
35
36 /* center dialog box on screen */
37 x = (COLS - width) / 2;
38 y = (LINES - height) / 2;
39
40 draw_shadow (stdscr, y, x, height, width);
41
42 dialog = newwin (height, width, y, x);
43 keypad (dialog, TRUE);
44
45 draw_box (dialog, 0, 0, height, width, dialog_attr, border_attr);
46
47 if (title != NULL && strlen(title) >= width-2 ) {
48 /* truncate long title -- mec */
49 char * title2 = malloc(width-2+1);
50 memcpy( title2, title, width-2 );
51 title2[width-2] = '\0';
52 title = title2;
53 }
54
55 if (title != NULL) {
56 wattrset (dialog, title_attr);
57 mvwaddch (dialog, 0, (width - strlen(title))/2 - 1, ' ');
58 waddstr (dialog, (char *)title);
59 waddch (dialog, ' ');
60 }
61 wattrset (dialog, dialog_attr);
62 print_autowrap (dialog, prompt, width - 2, 1, 2);
63
64 if (pause) {
65 wattrset (dialog, border_attr);
66 mvwaddch (dialog, height - 3, 0, ACS_LTEE);
67 for (i = 0; i < width - 2; i++)
68 waddch (dialog, ACS_HLINE);
69 wattrset (dialog, dialog_attr);
70 waddch (dialog, ACS_RTEE);
71
72 print_button (dialog, " Ok ",
73 height - 2, width / 2 - 4, TRUE);
74
75 wrefresh (dialog);
76 while (key != ESC && key != '\n' && key != ' ' &&
77 key != 'O' && key != 'o' && key != 'X' && key != 'x')
78 key = wgetch (dialog);
79 } else {
80 key = '\n';
81 wrefresh (dialog);
82 }
83
84 delwin (dialog);
85 return key == ESC ? -1 : 0;
86}