mbsetup fixes for nodes edit and lots of filegroups

This commit is contained in:
Michiel Broek 2002-01-20 22:37:14 +00:00
parent dbd6db000b
commit eed70a8bff
3 changed files with 61 additions and 27 deletions

View File

@ -4322,7 +4322,9 @@ v0.33.19 26-Oct-2001
contains the % character.
In several menus after leaving a edit record records were
displayed from start again, now shows last screen.
When editing a node's connected file/mail groups it can now
handle more then 40 groups without messing up the screen.
mbsebbs:
Added menu 317, change FS editor shortcut keys to (Emacs/
Wordstar) style. This has no effect on the editor for now.

View File

@ -1,11 +1,10 @@
/*****************************************************************************
*
* File ..................: grlist.c
* $Id$
* Purpose ...............: Group Listing utils
* Last modification date : 27-Nov-2000
*
*****************************************************************************
* Copyright (C) 1997-2000
* Copyright (C) 1997-2002
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10
@ -121,7 +120,7 @@ int compgroup(gr_list **fdp1, gr_list **fdp2)
int E_Group(gr_list **fdp, char *title)
{
int n = 0, i, j, x, y, rc = FALSE;
int o = 0, n = 0, i, j, x, y, rc = FALSE;
gr_list *tmp;
clr_index();
@ -139,37 +138,56 @@ int E_Group(gr_list **fdp, char *title)
j = 0;
for (tmp = *fdp; tmp; tmp = tmp->next) {
j++;
j++;
if ((j >= (o + 1)) && (j < (o + 41))) {
if (tmp->tagged)
mvprintw(y, x, (char *)"%2d. + %s", j, tmp->group);
else
mvprintw(y, x, (char *)"%2d. %s", j, tmp->group);
y++;
if (y == 18) {
if (y == 17) {
y = 7;
x += 20;
}
}
}
i = select_tag(n);
if (i == 0) {
clr_index();
return rc;
}
if ((i >= 1) && (i <= n)) {
j = 0;
rc = TRUE;
for (tmp = *fdp; tmp; tmp = tmp->next) {
j++;
if (j == i) {
if (tmp->tagged)
tmp->tagged = FALSE;
else
tmp->tagged = TRUE;
switch (i) {
case 0: clr_index();
return rc;
break;
case -2: if ((o - 40) >= 0) {
clr_index();
set_color(WHITE, BLACK);
mvprintw(5, 5, (char *)"%s", title);
set_color(CYAN, BLACK);
o -= 40;
}
}
break;
case -1: if ((o + 40) < n) {
clr_index();
set_color(WHITE, BLACK);
mvprintw(5, 5, (char *)"%s", title);
set_color(CYAN, BLACK);
o += 40;
}
break;
default: if ((i >= 1) && (i <= n)) {
j = 0;
rc = TRUE;
for (tmp = *fdp; tmp; tmp = tmp->next) {
j++;
if (j == i) {
if (tmp->tagged)
tmp->tagged = FALSE;
else
tmp->tagged = TRUE;
}
}
}
break;
}
}
}

View File

@ -455,7 +455,7 @@ char *select_pick(int max, int items)
if (max == 0)
sprintf(help, "Select ^\"-\"^ for previous level");
else
if (max > 20)
if (max > items)
sprintf(help, "Record (1..%d), ^\"-\"^ prev. level, ^\"P\" or \"N\"^ to page", max);
else
sprintf(help, "Select record (1..%d), ^\"-\"^ for previous level", max);
@ -515,21 +515,35 @@ int select_menu_sub(int max, char *hlp)
char help[80];
int pick;
sprintf(help, "%s (1..%d) or ^\"-\"^ for previous level.", hlp, max);
if (max == 0)
sprintf(help, "Select ^\"-\"^ for previous level");
else
if (max > 40)
sprintf(help, "%s (1..%d), ^\"-\"^ prev. level, ^\"P\" or \"N\"^ to page", hlp, max);
else
sprintf(help, "%s (1..%d), ^\"-\"^ for previous level", hlp, max);
showhelp(help);
/* Loop forever until it's right.
/*
* Loop forever until it's right.
*/
for (;;) {
mvprintw(LINES - 3, 6, "Enter your choice >");
menu = (char *)"-";
menu = edit_field(LINES - 3, 26, 3, '9', menu);
menu = edit_field(LINES - 3, 26, 3, '!', menu);
locate(LINES -3, 6);
clrtoeol();
if (strncmp(menu, "-", 1) == 0)
return 0;
if (max > 40) {
if (strncmp(menu, "N", 1) == 0)
return -1;
if (strncmp(menu, "P", 1) == 0)
return -2;
}
pick = atoi(menu);
if ((pick >= 1) && (pick <= max))
return pick;