1. Remove some ancient bogons from when I initially added dialogMenuItem
support. 2. Have message boxes say "Continue" instead of "Exit"
This commit is contained in:
parent
68753bffb7
commit
15232ab26e
@ -430,28 +430,14 @@ dialog_checklist(unsigned char *title, unsigned char *prompt, int height, int wi
|
||||
case KEY_RIGHT:
|
||||
button = !button;
|
||||
if (ditems && result) {
|
||||
if (button) {
|
||||
print_button(dialog, ditems[OK_BUTTON].prompt, y, x,
|
||||
ditems[OK_BUTTON].checked ? ditems[OK_BUTTON].checked(&ditems[OK_BUTTON]) : !button);
|
||||
print_button(dialog, ditems[CANCEL_BUTTON].prompt, y, x + strlen(ditems[OK_BUTTON].prompt) + 5,
|
||||
ditems[CANCEL_BUTTON].checked ? ditems[CANCEL_BUTTON].checked(&ditems[CANCEL_BUTTON]) : button);
|
||||
}
|
||||
else {
|
||||
print_button(dialog, ditems[CANCEL_BUTTON].prompt, y, x + strlen(ditems[OK_BUTTON].prompt) + 5,
|
||||
ditems[CANCEL_BUTTON].checked ? ditems[CANCEL_BUTTON].checked(&ditems[CANCEL_BUTTON]) : button);
|
||||
print_button(dialog, ditems[OK_BUTTON].prompt, y, x,
|
||||
ditems[OK_BUTTON].checked ? ditems[OK_BUTTON].checked(&ditems[OK_BUTTON]) : !button);
|
||||
}
|
||||
print_button(dialog, ditems[CANCEL_BUTTON].prompt, y, x + strlen(ditems[OK_BUTTON].prompt) + 5,
|
||||
ditems[CANCEL_BUTTON].checked ? ditems[CANCEL_BUTTON].checked(&ditems[CANCEL_BUTTON]) : button);
|
||||
print_button(dialog, ditems[OK_BUTTON].prompt, y, x,
|
||||
ditems[OK_BUTTON].checked ? ditems[OK_BUTTON].checked(&ditems[OK_BUTTON]) : !button);
|
||||
}
|
||||
else {
|
||||
if (button) {
|
||||
print_button(dialog, " OK ", y, x, !button);
|
||||
print_button(dialog, "Cancel", y, x + 14, button);
|
||||
}
|
||||
else {
|
||||
print_button(dialog, "Cancel", y, x + 14, button);
|
||||
print_button(dialog, " OK ", y, x, !button);
|
||||
}
|
||||
print_button(dialog, "Cancel", y, x + 14, button);
|
||||
print_button(dialog, " OK ", y, x, !button);
|
||||
}
|
||||
wrefresh(dialog);
|
||||
break;
|
||||
|
@ -349,28 +349,14 @@ dialog_menu(unsigned char *title, unsigned char *prompt, int height, int width,
|
||||
case KEY_RIGHT:
|
||||
button = !button;
|
||||
if (ditems && result) {
|
||||
if (button) {
|
||||
print_button(dialog, ditems[OK_BUTTON].prompt, y, x,
|
||||
ditems[OK_BUTTON].checked ? ditems[OK_BUTTON].checked(&ditems[OK_BUTTON]) : !button);
|
||||
print_button(dialog, ditems[CANCEL_BUTTON].prompt, y, x + strlen(ditems[OK_BUTTON].prompt) + 5,
|
||||
ditems[CANCEL_BUTTON].checked ? ditems[CANCEL_BUTTON].checked(&ditems[CANCEL_BUTTON]) : button);
|
||||
}
|
||||
else {
|
||||
print_button(dialog, ditems[CANCEL_BUTTON].prompt, y, x + strlen(ditems[OK_BUTTON].prompt) + 5,
|
||||
ditems[CANCEL_BUTTON].checked ? ditems[CANCEL_BUTTON].checked(&ditems[CANCEL_BUTTON]) : button);
|
||||
print_button(dialog, ditems[OK_BUTTON].prompt, y, x,
|
||||
ditems[OK_BUTTON].checked ? ditems[OK_BUTTON].checked(&ditems[OK_BUTTON]) : !button);
|
||||
}
|
||||
print_button(dialog, ditems[CANCEL_BUTTON].prompt, y, x + strlen(ditems[OK_BUTTON].prompt) + 5,
|
||||
ditems[CANCEL_BUTTON].checked ? ditems[CANCEL_BUTTON].checked(&ditems[CANCEL_BUTTON]) : button);
|
||||
print_button(dialog, ditems[OK_BUTTON].prompt, y, x,
|
||||
ditems[OK_BUTTON].checked ? ditems[OK_BUTTON].checked(&ditems[OK_BUTTON]) : !button);
|
||||
}
|
||||
else {
|
||||
if (button) {
|
||||
print_button(dialog, " OK ", y, x, !button);
|
||||
print_button(dialog, "Cancel", y, x + 14, button);
|
||||
}
|
||||
else {
|
||||
print_button(dialog, "Cancel", y, x + 14, button);
|
||||
print_button(dialog, " OK ", y, x, !button);
|
||||
}
|
||||
print_button(dialog, "Cancel", y, x + 14, button);
|
||||
print_button(dialog, " OK ", y, x, !button);
|
||||
}
|
||||
wrefresh(dialog);
|
||||
break;
|
||||
|
@ -171,7 +171,7 @@ dialog_mesgbox(unsigned char *title, unsigned char *prompt, int height, int widt
|
||||
for (i = 0; i < width-2; i++)
|
||||
waddch(dialog, ' ');
|
||||
display_helpline(dialog, height-1, width);
|
||||
print_button(dialog, " EXIT ", height-2, width/2-4, TRUE);
|
||||
print_button(dialog, " CONTINUE ", height-2, width/2-8, TRUE);
|
||||
wattrset(dialog, dialog_attr);
|
||||
|
||||
theight = height - 4;
|
||||
@ -180,7 +180,7 @@ dialog_mesgbox(unsigned char *title, unsigned char *prompt, int height, int widt
|
||||
max_lines = getnlines(prompt);
|
||||
print_page(dialog, theight, width, prompt, startline, hscroll);
|
||||
print_perc(dialog, height-3, width-9, (float) (startline+theight)/max_lines);
|
||||
wmove(dialog, height-2, width/2-2);
|
||||
wmove(dialog, height-2, width/2-6);
|
||||
wrefresh(dialog);
|
||||
while ((key != ESC) && (key != '\n') && (key != '\r')) {
|
||||
key = wgetch(dialog);
|
||||
|
@ -427,28 +427,14 @@ dialog_radiolist(unsigned char *title, unsigned char *prompt, int height, int wi
|
||||
case KEY_RIGHT:
|
||||
button = !button;
|
||||
if (ditems && result) {
|
||||
if (button) {
|
||||
print_button(dialog, ditems[OK_BUTTON].prompt, y, x,
|
||||
ditems[OK_BUTTON].checked ? ditems[OK_BUTTON].checked(&ditems[OK_BUTTON]) : !button);
|
||||
print_button(dialog, ditems[CANCEL_BUTTON].prompt, y, x + strlen(ditems[OK_BUTTON].prompt) + 5,
|
||||
ditems[CANCEL_BUTTON].checked ? ditems[CANCEL_BUTTON].checked(&ditems[CANCEL_BUTTON]) : button);
|
||||
}
|
||||
else {
|
||||
print_button(dialog, ditems[CANCEL_BUTTON].prompt, y, x + strlen(ditems[OK_BUTTON].prompt) + 5,
|
||||
ditems[CANCEL_BUTTON].checked ? ditems[CANCEL_BUTTON].checked(&ditems[CANCEL_BUTTON]) : button);
|
||||
print_button(dialog, ditems[OK_BUTTON].prompt, y, x,
|
||||
ditems[OK_BUTTON].checked ? ditems[OK_BUTTON].checked(&ditems[OK_BUTTON]) : !button);
|
||||
}
|
||||
print_button(dialog, ditems[CANCEL_BUTTON].prompt, y, x + strlen(ditems[OK_BUTTON].prompt) + 5,
|
||||
ditems[CANCEL_BUTTON].checked ? ditems[CANCEL_BUTTON].checked(&ditems[CANCEL_BUTTON]) : button);
|
||||
print_button(dialog, ditems[OK_BUTTON].prompt, y, x,
|
||||
ditems[OK_BUTTON].checked ? ditems[OK_BUTTON].checked(&ditems[OK_BUTTON]) : !button);
|
||||
}
|
||||
else {
|
||||
if (button) {
|
||||
print_button(dialog, " OK ", y, x, !button);
|
||||
print_button(dialog, "Cancel", y, x + 14, button);
|
||||
}
|
||||
else {
|
||||
print_button(dialog, "Cancel", y, x + 14, button);
|
||||
print_button(dialog, " OK ", y, x, !button);
|
||||
}
|
||||
print_button(dialog, "Cancel", y, x + 14, button);
|
||||
print_button(dialog, " OK ", y, x, !button);
|
||||
}
|
||||
wrefresh(dialog);
|
||||
break;
|
||||
|
@ -136,7 +136,7 @@ int dialog_textbox(unsigned char *title, unsigned char *file, int height, int wi
|
||||
}
|
||||
display_helpline(dialog, height-1, width);
|
||||
|
||||
print_button(dialog, " EXIT ", height-2, width/2-4, TRUE);
|
||||
print_button(dialog, " CONTINUE ", height-2, width/2-8, TRUE);
|
||||
wnoutrefresh(dialog);
|
||||
getyx(dialog, cur_y, cur_x); /* Save cursor position */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user