diff options
author | jkh <jkh@FreeBSD.org> | 1996-04-08 10:02:55 +0000 |
---|---|---|
committer | jkh <jkh@FreeBSD.org> | 1996-04-08 10:02:55 +0000 |
commit | 06a2488050e8b7fea31bf0b51975209edbd0d9c1 (patch) | |
tree | 4be3224ee16df0029cf314f8467a1df6e4169ced /gnu | |
parent | 241c31412fae49e5ef43aa1bd0c628ae44986df1 (diff) | |
download | FreeBSD-src-06a2488050e8b7fea31bf0b51975209edbd0d9c1.zip FreeBSD-src-06a2488050e8b7fea31bf0b51975209edbd0d9c1.tar.gz |
Refresh dialogs if a callback action fails.
Diffstat (limited to 'gnu')
-rw-r--r-- | gnu/lib/libdialog/checklist.c | 16 | ||||
-rw-r--r-- | gnu/lib/libdialog/menubox.c | 12 | ||||
-rw-r--r-- | gnu/lib/libdialog/radiolist.c | 16 |
3 files changed, 33 insertions, 11 deletions
diff --git a/gnu/lib/libdialog/checklist.c b/gnu/lib/libdialog/checklist.c index 391e351..b93baf5 100644 --- a/gnu/lib/libdialog/checklist.c +++ b/gnu/lib/libdialog/checklist.c @@ -199,8 +199,10 @@ dialog_checklist(unsigned char *title, unsigned char *prompt, int height, int wi /* Shortcut to OK? */ if (toupper(key) == okButton) { if (ditems && result && ditems[OK_BUTTON].fire) { - if (ditems[OK_BUTTON].fire(&ditems[OK_BUTTON]) == DITEM_FAILURE) + if (ditems[OK_BUTTON].fire(&ditems[OK_BUTTON]) == DITEM_FAILURE) { + wrefresh(dialog); continue; + } else delwin(dialog); } @@ -219,8 +221,10 @@ dialog_checklist(unsigned char *title, unsigned char *prompt, int height, int wi /* Shortcut to cancel? */ else if (toupper(key) == cancelButton) { if (ditems && result && ditems[CANCEL_BUTTON].fire) { - if (ditems[CANCEL_BUTTON].fire(&ditems[CANCEL_BUTTON]) == DITEM_FAILURE) + if (ditems[CANCEL_BUTTON].fire(&ditems[CANCEL_BUTTON]) == DITEM_FAILURE) { + wrefresh(dialog); continue; + } } delwin(dialog); return 1; @@ -297,8 +301,10 @@ dialog_checklist(unsigned char *title, unsigned char *prompt, int height, int wi key = ESC; break; } - else if (st == DITEM_FAILURE) + else if (st == DITEM_FAILURE) { + wrefresh(dialog); continue; + } else if (st == DITEM_REDRAW) { for (i = 0; i < max_choice; i++) { status[scroll + i] = ditems[scroll + i].checked ? @@ -425,8 +431,10 @@ dialog_checklist(unsigned char *title, unsigned char *prompt, int height, int wi if (!button && result) { if (ditems && ditems[button ? CANCEL_BUTTON : OK_BUTTON].fire) { if (ditems[button ? CANCEL_BUTTON : OK_BUTTON].fire(&ditems[button ? CANCEL_BUTTON : OK_BUTTON]) == - DITEM_FAILURE) + DITEM_FAILURE) { + wrefresh(dialog); continue; + } } else { *result = '\0'; diff --git a/gnu/lib/libdialog/menubox.c b/gnu/lib/libdialog/menubox.c index 650d090..c213d08 100644 --- a/gnu/lib/libdialog/menubox.c +++ b/gnu/lib/libdialog/menubox.c @@ -188,8 +188,10 @@ dialog_menu(unsigned char *title, unsigned char *prompt, int height, int width, /* Shortcut to OK? */ if (toupper(key) == okButton) { if (ditems && result && ditems[OK_BUTTON].fire) { - if (ditems[OK_BUTTON].fire(&ditems[OK_BUTTON]) == DITEM_FAILURE) + if (ditems[OK_BUTTON].fire(&ditems[OK_BUTTON]) == DITEM_FAILURE) { + wrefresh(dialog); continue; + } else delwin(dialog); } @@ -202,8 +204,10 @@ dialog_menu(unsigned char *title, unsigned char *prompt, int height, int width, /* Shortcut to cancel? */ else if (toupper(key) == cancelButton) { if (ditems && result && ditems[CANCEL_BUTTON].fire) { - if (ditems[CANCEL_BUTTON].fire(&ditems[CANCEL_BUTTON]) == DITEM_FAILURE) + if (ditems[CANCEL_BUTTON].fire(&ditems[CANCEL_BUTTON]) == DITEM_FAILURE) { + wrefresh(dialog); continue; + } } delwin(dialog); return 1; @@ -359,8 +363,10 @@ dialog_menu(unsigned char *title, unsigned char *prompt, int height, int width, case '\n': if (!button) { if (ditems && ditems[scroll + choice].fire) { - if (ditems[scroll + choice].fire(&ditems[scroll + choice]) == DITEM_FAILURE) + if (ditems[scroll + choice].fire(&ditems[scroll + choice]) == DITEM_FAILURE) { + wrefresh(dialog); continue; + } } else if (result) strcpy(result, items[(scroll+choice)*2]); diff --git a/gnu/lib/libdialog/radiolist.c b/gnu/lib/libdialog/radiolist.c index 8ae84c2..3443ece 100644 --- a/gnu/lib/libdialog/radiolist.c +++ b/gnu/lib/libdialog/radiolist.c @@ -208,8 +208,10 @@ dialog_radiolist(unsigned char *title, unsigned char *prompt, int height, int wi /* See if its the short-cut to "OK" */ if (toupper(key) == okButton) { if (ditems && result && ditems[OK_BUTTON].fire) { - if (ditems[OK_BUTTON].fire(&ditems[OK_BUTTON]) == DITEM_FAILURE) + if (ditems[OK_BUTTON].fire(&ditems[OK_BUTTON]) == DITEM_FAILURE) { + wrefresh(dialog); continue; + } else delwin(dialog); } @@ -228,8 +230,10 @@ dialog_radiolist(unsigned char *title, unsigned char *prompt, int height, int wi /* Shortcut to cancel */ else if (toupper(key) == cancelButton) { if (ditems && result && ditems[CANCEL_BUTTON].fire) { - if (ditems[CANCEL_BUTTON].fire(&ditems[CANCEL_BUTTON]) == DITEM_FAILURE) + if (ditems[CANCEL_BUTTON].fire(&ditems[CANCEL_BUTTON]) == DITEM_FAILURE) { + wrefresh(dialog); continue; + } } delwin(dialog); return 1; @@ -304,8 +308,10 @@ dialog_radiolist(unsigned char *title, unsigned char *prompt, int height, int wi key = ESC; break; } - else if (st == DITEM_FAILURE) + else if (st == DITEM_FAILURE) { + wrefresh(dialog); continue; + } } for (i = 0; i < item_no; i++) status[i] = ditems[i].checked ? ditems[i].checked(&ditems[i]) : FALSE; @@ -413,8 +419,10 @@ dialog_radiolist(unsigned char *title, unsigned char *prompt, int height, int wi if (!button && result) { if (ditems && ditems[button ? CANCEL_BUTTON : OK_BUTTON].fire) { if (ditems[button ? CANCEL_BUTTON : OK_BUTTON].fire(&ditems[button ? CANCEL_BUTTON : OK_BUTTON]) == - DITEM_FAILURE) + DITEM_FAILURE) { + wrefresh(dialog); continue; + } } else { *result = '\0'; |