Changes to make bright and normal colors is display menus.

This commit is contained in:
Michiel Broek
2001-09-27 20:35:25 +00:00
parent 3f5a2c6977
commit 1215de5b4f
15 changed files with 212 additions and 160 deletions

View File

@@ -1,4 +1,4 @@
# Makefile.in generated automatically by automake 1.4 from Makefile.am
# Makefile.in generated automatically by automake 1.4-p4 from Makefile.am
# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
@@ -109,7 +109,7 @@ DIST_COMMON = Makefile.am Makefile.in
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = gtar
TAR = tar
GZIP_ENV = --best
DEP_FILES = .deps/grlist.P .deps/ledit.P .deps/m_archive.P \
.deps/m_bbs.P .deps/m_domain.P .deps/m_farea.P .deps/m_fdb.P \

View File

@@ -2,7 +2,7 @@
*
* File ..................: ledit.c
* Purpose ...............: Line Editor
* Last modification date : 27-May-2001
* Last modification date : 27-Sep-2001
*
*****************************************************************************
* Copyright (C) 1997-2001
@@ -1449,9 +1449,8 @@ void edit_color(int *fg, int *bg, char *help)
clr_index();
set_color(WHITE, BLACK);
mvprintw(5, 6, "1.7 EDIT COLORS");
sprintf(temp, "Change ^%s^ color with arrow keys, press <Enter> whene done", help);
showhelp(help);
sprintf(temp, "Change the ^%s^ color with arrow keys, press <Enter> whene done", help);
showhelp(temp);
for (f = 0; f < 16; f++)
for (b = 0; b < 8; b++) {
@@ -1466,7 +1465,7 @@ void edit_color(int *fg, int *bg, char *help)
mvprintw(7, 6, "This is an example...");
fflush(stdout);
mvprintw(b + 9, f + 33, "*");
ch = readkey(10,10,f,b);
ch = readkey(7,28,f,b);
mvprintw(b + 9, f + 33, ".");
switch(ch) {
case KEY_LINEFEED:
@@ -1491,6 +1490,30 @@ void edit_color(int *fg, int *bg, char *help)
char *get_color(int c)
{
switch (c) {
case BLACK: return (char *)"black";
case BLUE: return (char *)"blue";
case GREEN: return (char *)"green";
case CYAN: return (char *)"cyan";
case RED: return (char *)"red";
case MAGENTA: return (char *)"magenta";
case BROWN: return (char *)"brown";
case LIGHTGRAY: return (char *)"lightgray";
case DARKGRAY: return (char *)"darkgray";
case LIGHTBLUE: return (char *)"lightblue";
case LIGHTGREEN: return (char *)"lightgreen";
case LIGHTCYAN: return (char *)"lightcyan";
case LIGHTRED: return (char *)"lightred";
case LIGHTMAGENTA: return (char *)"lightmagenta";
case YELLOW: return (char *)"yellow";
case WHITE: return (char *)"white";
}
}
char *getmenutype(int val)
{
switch (val) {
@@ -1514,7 +1537,7 @@ char *getmenutype(int val)
case 18: return (char *)"Send an on-line message";
case 19: return (char *)"Display textfile with more";
case 20: return (char *)"Display .A?? file with Enter";
case 21: return (char *)"Display Text Only";
case 22: return (char *)"Message to nextuser door";
case 23: return (char *)"Time banking system";
@@ -1590,8 +1613,6 @@ char *getmenutype(int val)
case 505: return (char *)"Print a BBS";
case 506: return (char *)"Search for a BBS";
case 999: return (char *)"Display Text Only";
default: return (char *)"Unknown menu";
}
}

View File

@@ -59,6 +59,7 @@ void show_magictype(int, int, int);
int edit_magictype(int, int, int);
void show_aka(int, int, fidoaddr);
void edit_color(int *, int *, char *);
char *get_color(int);
char *getmenutype(int);

View File

@@ -2,7 +2,7 @@
*
* File ..................: m_global.c
* Purpose ...............: Global Setup Program
* Last modification date : 11-Aug-2001
* Last modification date : 27-Sep-2001
*
*****************************************************************************
* Copyright (C) 1997-2001
@@ -1633,12 +1633,6 @@ int PickAka(char *msg, int openit)
}
char Co[16][16] = {
"Black", "Blue", "Green", "Cyan",
"Red", "Magenta", "Brown", "Lightgray",
"Darkgary", "Lightblue", "Lightgreen", "Lightcyan",
"Lightred", "Lightmagenta", "Yellow", "White" };
int global_doc(FILE *fp, FILE *toc, int page)
{
@@ -1758,17 +1752,17 @@ int global_doc(FILE *fp, FILE *toc, int page)
addtoc(fp, toc, 1, 7, page, (char *)"Text colors");
fprintf(fp, " Normal text %s on %s\n", Co[CFG.TextColourF], Co[CFG.TextColourB]);
fprintf(fp, " Underline text %s on %s\n", Co[CFG.UnderlineColourF], Co[CFG.UnderlineColourB]);
fprintf(fp, " Input text %s on %s\n", Co[CFG.InputColourF], Co[CFG.InputColourB]);
fprintf(fp, " CR text %s on %s\n", Co[CFG.CRColourF], Co[CFG.CRColourB]);
fprintf(fp, " More prompt %s on %s\n", Co[CFG.MoreF], Co[CFG.MoreB]);
fprintf(fp, " Hilite text %s on %s\n", Co[CFG.HiliteF], Co[CFG.HiliteB]);
fprintf(fp, " File name %s on %s\n", Co[CFG.FilenameF], Co[CFG.FilenameB]);
fprintf(fp, " File size %s on %s\n", Co[CFG.FilesizeF], Co[CFG.FilesizeB]);
fprintf(fp, " File date %s on %s\n", Co[CFG.FiledateF], Co[CFG.FiledateB]);
fprintf(fp, " File description %s on %s\n", Co[CFG.FiledescF], Co[CFG.FiledescB]);
fprintf(fp, " Message input %s on %s\n", Co[CFG.MsgInputColourF], Co[CFG.MsgInputColourB]);
fprintf(fp, " Normal text %s on %s\n", get_color(CFG.TextColourF), get_color(CFG.TextColourB));
fprintf(fp, " Underline text %s on %s\n", get_color(CFG.UnderlineColourF), get_color(CFG.UnderlineColourB));
fprintf(fp, " Input text %s on %s\n", get_color(CFG.InputColourF), get_color(CFG.InputColourB));
fprintf(fp, " CR text %s on %s\n", get_color(CFG.CRColourF), get_color(CFG.CRColourB));
fprintf(fp, " More prompt %s on %s\n", get_color(CFG.MoreF), get_color(CFG.MoreB));
fprintf(fp, " Hilite text %s on %s\n", get_color(CFG.HiliteF), get_color(CFG.HiliteB));
fprintf(fp, " File name %s on %s\n", get_color(CFG.FilenameF), get_color(CFG.FilenameB));
fprintf(fp, " File size %s on %s\n", get_color(CFG.FilesizeF), get_color(CFG.FilesizeB));
fprintf(fp, " File date %s on %s\n", get_color(CFG.FiledateF), get_color(CFG.FiledateB));
fprintf(fp, " File description %s on %s\n", get_color(CFG.FiledescF), get_color(CFG.FiledescB));
fprintf(fp, " Message input %s on %s\n", get_color(CFG.MsgInputColourF), get_color(CFG.MsgInputColourB));
page = newpage(fp, page);
addtoc(fp, toc, 1, 8, page, (char *)"Next user door");

View File

@@ -2,7 +2,7 @@
*
* File ..................: mbsetup/m_menu.c
* Purpose ...............: Edit BBS menus
* Last modification date : 27-May-2001
* Last modification date : 26-Sep-2001
*
*****************************************************************************
* Copyright (C) 1997-2001
@@ -96,8 +96,6 @@ char *select_menurec(int max)
void Show_A_Menu(void);
void Show_A_Menu(void)
{
char *p;
clr_index();
set_color(WHITE, BLACK);
mvprintw( 5, 2, "8.3. EDIT MENU ITEM");
@@ -105,50 +103,44 @@ void Show_A_Menu(void)
mvprintw( 7, 2, "1. Sel. key");
mvprintw( 8, 2, "2. Type nr.");
mvprintw( 9, 2, "3. Opt. data");
mvprintw(10, 2, "4. Display");
mvprintw(11, 2, "5. Security");
mvprintw(12, 2, "6. Min. age");
mvprintw(13, 2, "7. Max. lvl");
mvprintw(14, 2, "8. Password");
mvprintw(15, 2, "9. Credit");
mvprintw(16, 2, "10. Colors");
mvprintw(12,42, "11. Autoexec");
mvprintw(13,42, "12. Menu open");
mvprintw(11, 2, "4. Display");
mvprintw(12, 2, "5. Security");
mvprintw(13, 2, "6. Min. age");
mvprintw(14, 2, "7. Max. lvl");
mvprintw(15, 2, "8. Password");
mvprintw(16, 2, "9. Credit");
mvprintw(17, 2, "10. Lo-colors");
mvprintw(18, 2, "11. Hi-colors");
mvprintw(15,42, "12. Autoexec");
if (menus.MenuType == 7) {
mvprintw(14,42, "13. No door.sys");
mvprintw(15,42, "14. Y2K style");
mvprintw(16,42, "15. Use Comport");
mvprintw(16,42, "13. No door.sys");
mvprintw(17,42, "14. Y2K style");
mvprintw(18,42, "15. Use Comport");
}
set_color(WHITE, BLACK);
show_str( 7,16, 1, menus.MenuKey);
show_int( 8,16, menus.MenuType); show_str( 8, 26,29, menus.TypeDesc);
show_str( 9,16,64, menus.OptionalData);
show_str(10,16,64, menus.Display);
show_sec(11,16, menus.MenuSecurity);
show_int(12,16, menus.Age);
show_int(13,16, menus.MaxSecurity);
show_str(10,16,64,(char *)"1234567890123456789012345678901234567890123456789012345678901234");
show_str(11,16,64, menus.Display);
show_sec(12,16, menus.MenuSecurity);
show_int(13,16, menus.Age);
show_int(14,16, menus.MaxSecurity);
if (strlen(menus.Password))
show_str(14,16,14, (char *)"**************");
show_str(15,16,14, (char *)"**************");
else
show_str(14,16,14, (char *)"<null>");
show_int(15,16, menus.Credit);
S_COL(16,16, "Display color", menus.ForeGnd, menus.BackGnd)
show_str(15,16,14, (char *)"<null>");
show_int(16,16, menus.Credit);
S_COL(17,16, "Normal display color", menus.ForeGnd, menus.BackGnd)
S_COL(18,16, "Bright display color", menus.HiForeGnd, menus.HiBackGnd)
set_color(WHITE, BLACK);
show_bool(12,58, menus.AutoExec);
if ((menus.OpenFrom == 0) && (menus.OpenTo == 0))
show_str(13,58, 6, (char *)"Always");
else {
p = calloc(40, sizeof(char));
sprintf(p, "%02d:%02d - %02d:%02d", menus.OpenFrom / 60, menus.OpenFrom % 60,
menus.OpenTo / 60, menus.OpenTo % 60);
show_str(13, 58, 13, p);
free(p);
}
show_bool(15,58, menus.AutoExec);
if (menus.MenuType == 7) {
show_bool(14,58, menus.NoDoorsys);
show_bool(15,58, menus.Y2Kdoorsys);
show_bool(16,58, menus.Comport);
show_bool(16,58, menus.NoDoorsys);
show_bool(17,58, menus.Y2Kdoorsys);
show_bool(18,58, menus.Comport);
}
}
@@ -222,38 +214,41 @@ void Edit_A_Menu(void)
for (;;) {
switch(select_menu(15)) {
case 0:
return;
case 0: return;
break;
case 1: E_UPS( 7,16, 1, menus.MenuKey, "The ^key^ to select this menu item")
case 2: menus.MenuType = GetMenuType();
memset(&menus.TypeDesc, 0, sizeof(menus.TypeDesc));
if (menus.MenuType)
strcpy(menus.TypeDesc, getmenutype(menus.MenuType));
if (menus.MenuType == 21)
menus.AutoExec = TRUE;
Show_A_Menu();
break;
case 3: E_STR( 9,16,64, menus.OptionalData, "The ^optional data^ for this menu item")
case 4: E_STR(10,16,64, menus.Display, "The text to ^display^ for this menu")
case 5: E_SEC(11,16, menus.MenuSecurity, "7.3.5 MENU ACCESS SECURITY", Show_A_Menu)
case 6: E_INT(12,16, menus.Age, "The minimum ^Age^ to select this menu, 0 is don't care")
case 7: E_INT(13,16, menus.MaxSecurity, "The maximum ^Security level^ to access this menu")
case 8: E_STR(14,16,14, menus.Password, "The ^password^ to access this menu item")
case 9: E_INT(15,16, menus.Credit, "The ^credit cost^ for this menu item")
case 10:edit_color(&menus.ForeGnd, &menus.BackGnd, (char *)"Display color");
case 4: E_STR(11,16,64, menus.Display, "The text to ^display^ for this menu")
case 5: E_SEC(12,16, menus.MenuSecurity, "7.3.5 MENU ACCESS SECURITY", Show_A_Menu)
case 6: E_INT(13,16, menus.Age, "The minimum ^Age^ to select this menu, 0 is don't care")
case 7: E_INT(14,16, menus.MaxSecurity, "The maximum ^Security level^ to access this menu")
case 8: E_STR(15,16,14, menus.Password, "The ^password^ to access this menu item")
case 9: E_INT(16,16, menus.Credit, "The ^credit cost^ for this menu item")
case 10:edit_color(&menus.ForeGnd, &menus.BackGnd, (char *)"normal");
Show_A_Menu();
break;
case 11:E_BOOL(12,58, menus.AutoExec, "Is this an ^Autoexecute^ menu item")
case 11:edit_color(&menus.HiForeGnd, &menus.HiBackGnd, (char *)"bright");
Show_A_Menu();
break;
case 12:E_BOOL(15,58, menus.AutoExec, "Is this an ^Autoexecute^ menu item")
case 13:if (menus.MenuType == 7) {
E_BOOL(14,58, menus.NoDoorsys, "Suppress writing ^door.sys^ dropfile")
E_BOOL(16,58, menus.NoDoorsys, "Suppress writing ^door.sys^ dropfile")
} else
break;
case 14:if (menus.MenuType == 7) {
E_BOOL(15,58, menus.Y2Kdoorsys, "Create ^door.sys^ with 4 digit yearnumbers")
E_BOOL(17,58, menus.Y2Kdoorsys, "Create ^door.sys^ with 4 digit yearnumbers")
} else
break;
case 15:if (menus.MenuType == 7) {
E_BOOL(16,58, menus.Comport, "Write real ^COM port^ in door.sys for Vmodem patch")
E_BOOL(18,58, menus.Comport, "Write real ^COM port^ in door.sys for Vmodem patch")
} else
break;
}
@@ -306,7 +301,7 @@ void EditMenu(char *Name)
offset = ((o + i) - 1) * sizeof(menus);
fseek(tmp, offset, SEEK_SET);
fread(&menus, sizeof(menus), 1, tmp);
if (menus.MenuType || menus.AutoExec) {
if (menus.MenuKey[0] || menus.AutoExec) {
set_color(CYAN, BLACK);
mvprintw(y, 5, "%3d. ", o + i);
if (menus.AutoExec) {
@@ -341,9 +336,10 @@ void EditMenu(char *Name)
if ((fil = fopen(temp, "w+")) == NULL) {
working(2, 0, 0);
} else {
Syslog('+', "Updated menu %s", temp);
fseek(tmp, 0, SEEK_SET);
while (fread(&menus, sizeof(menus), 1, tmp) == 1) {
if (menus.MenuType || menus.AutoExec)
if (menus.MenuKey[0] || menus.AutoExec)
fwrite(&menus, sizeof(menus), 1, fil);
}
fclose(fil);
@@ -359,6 +355,8 @@ void EditMenu(char *Name)
if (strncmp(pick, "A", 1) == 0) {
working(1, 0, 0);
memset(&menus, 0, sizeof(menus));
menus.ForeGnd = LIGHTGRAY;
menus.HiForeGnd = WHITE;
fseek(tmp, 0, SEEK_END);
fwrite(&menus, sizeof(menus), 1, tmp);
records++;
@@ -573,6 +571,10 @@ int bbs_menu_doc(FILE *fp, FILE *toc, int page)
fprintf(fp, " Maximum level %d\n", menus.MaxSecurity);
fprintf(fp, " Password %s\n", menus.Password);
fprintf(fp, " Credits %ld\n", menus.Credit);
fprintf(fp, " Lo-colors %s on %s\n",
get_color(menus.ForeGnd), get_color(menus.BackGnd));
fprintf(fp, " Hi-colors %s on %s\n",
get_color(menus.HiForeGnd), get_color(menus.HiBackGnd));
if (menus.MenuType == 7) {
fprintf(fp, " No door.sys %s\n", getboolean(menus.NoDoorsys));
fprintf(fp, " Y2K door.sys %s\n", getboolean(menus.Y2Kdoorsys));