summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey A. Chernov <ache@FreeBSD.org>1994-11-02 01:40:34 +0000
committerAndrey A. Chernov <ache@FreeBSD.org>1994-11-02 01:40:34 +0000
commit76ab56f350063985dbd9481c27fb5f00aa91fac1 (patch)
tree2d36596e2e892f334875be3d6286688ea5d5589b
parentd29895dc1a27ad80a121a6101c44d6c19da185f0 (diff)
Notes
-rw-r--r--gnu/lib/libdialog/inputbox.c1
-rw-r--r--gnu/lib/libdialog/lineedit.c13
2 files changed, 11 insertions, 3 deletions
diff --git a/gnu/lib/libdialog/inputbox.c b/gnu/lib/libdialog/inputbox.c
index 8bf384dcf9e8..197b4dfaedf7 100644
--- a/gnu/lib/libdialog/inputbox.c
+++ b/gnu/lib/libdialog/inputbox.c
@@ -85,6 +85,7 @@ int dialog_inputbox(unsigned char *title, unsigned char *prompt, int height, int
print_button(dialog, " OK ", y, x, TRUE);
first = 1;
+ strcpy(instr, result);
while (key != ESC) {
if (button == -1) { /* Input box selected */
diff --git a/gnu/lib/libdialog/lineedit.c b/gnu/lib/libdialog/lineedit.c
index 78088e8e5a76..d6dbd579a85a 100644
--- a/gnu/lib/libdialog/lineedit.c
+++ b/gnu/lib/libdialog/lineedit.c
@@ -32,13 +32,20 @@ int line_edit(WINDOW* dialog, int box_y, int box_x, int box_width, chtype attr,
static int input_x, scroll;
static unsigned char instr[MAX_LEN+1];
- if (first) {
+ wattrset(dialog, attr);
keypad(dialog, TRUE);
+
+ if (first) {
memset(instr, 0, sizeof(instr));
- input_x = scroll = 0;
+ strcpy(instr, result);
+ i = strlen(instr);
+ input_x = i % box_width;
+ scroll = i - input_x;
+ wmove(dialog, box_y, box_x);
+ for (i = 0; i < box_width; i++)
+ waddch(dialog, instr[scroll+i] ? instr[scroll+i] : ' ');
}
- wattrset(dialog, attr);
wmove(dialog, box_y, box_x + input_x);
wrefresh(dialog);
for (;;) {