Allow all text attributes for menu_headings
This commit is contained in:
@@ -2097,8 +2097,8 @@ Implemented by the Amiga, Gem and tty ports.
|
||||
Default '^'.
|
||||
.lp menu_headings
|
||||
Controls how the headings in a menu are highlighted.
|
||||
Values are 'bold', 'inverse', or 'underline'.
|
||||
Not all ports can actually display all three types.
|
||||
Values are 'none', 'bold', 'dim', 'underline', 'blink', or 'inverse'.
|
||||
Not all ports can actually display all types.
|
||||
.lp menu_invert_all
|
||||
Menu character accelerator to invert all items in a menu.
|
||||
Implemented by the Amiga, Gem, X11 and tty ports.
|
||||
|
||||
@@ -2530,8 +2530,9 @@ Implemented by the Amiga, Gem and tty ports.
|
||||
Default `\verb+^+'.
|
||||
\item[\ib{menu\_headings}]
|
||||
Controls how the headings in a menu are highlighted.
|
||||
Values are ``{\tt bold}'', ``{\tt inverse}'', or ``{\tt underline}''.
|
||||
Not all ports can actually display all three types.
|
||||
Values are ``{\tt none}'', ``{\tt bold}'', ``{\tt dim}'',
|
||||
``{\tt underline}'', ``{\tt blink}'', or ``{\tt inverse}''.
|
||||
Not all ports can actually display all types.
|
||||
\item[\ib{menu\_invert\_all}]
|
||||
Menu character accelerator to invert all items in a menu.
|
||||
Implemented by the Amiga, Gem, X11 and tty ports.
|
||||
|
||||
@@ -283,7 +283,7 @@ static struct Comp_Opt
|
||||
4, SET_IN_FILE },
|
||||
{ "menu_first_page", "jump to the first page in a menu",
|
||||
4, SET_IN_FILE },
|
||||
{ "menu_headings", "bold, inverse, or underline headings", 9, SET_IN_GAME },
|
||||
{ "menu_headings", "text attribute for menu headings", 9, SET_IN_GAME },
|
||||
{ "menu_invert_all", "invert all items in a menu", 4, SET_IN_FILE },
|
||||
{ "menu_invert_page", "invert all items on this page of a menu",
|
||||
4, SET_IN_FILE },
|
||||
@@ -501,7 +501,7 @@ STATIC_OVL int FDECL(count_ape_maps, (int *, int *));
|
||||
STATIC_DCL const char *FDECL(clr2colorname, (int));
|
||||
STATIC_DCL const char *FDECL(attr2attrname, (int));
|
||||
STATIC_DCL int NDECL(query_color);
|
||||
STATIC_DCL int NDECL(query_attr);
|
||||
STATIC_DCL int FDECL(query_attr, (char *));
|
||||
STATIC_DCL boolean FDECL(add_menu_coloring_parsed, (char *, int, int));
|
||||
STATIC_DCL void FDECL(free_one_menu_coloring, (int));
|
||||
STATIC_DCL int NDECL(count_menucolors);
|
||||
@@ -1219,7 +1219,8 @@ query_color()
|
||||
}
|
||||
|
||||
int
|
||||
query_attr()
|
||||
query_attr(prompt)
|
||||
char *prompt;
|
||||
{
|
||||
winid tmpwin;
|
||||
anything any;
|
||||
@@ -1233,7 +1234,7 @@ query_attr()
|
||||
any.a_int = i + 1;
|
||||
add_menu(tmpwin, NO_GLYPH, &any, 0, 0, attrnames[i].attr, attrnames[i].name, MENU_UNSELECTED);
|
||||
}
|
||||
end_menu(tmpwin, "Pick an attribute");
|
||||
end_menu(tmpwin, prompt ? prompt : "Pick an attribute");
|
||||
pick_cnt = select_menu(tmpwin, PICK_ONE, &picks);
|
||||
destroy_nhwindow(tmpwin);
|
||||
if (pick_cnt > 0) {
|
||||
@@ -2751,14 +2752,12 @@ goodfruit:
|
||||
else if (!(opts = string_for_env_opt(fullname, opts, FALSE))) {
|
||||
return;
|
||||
}
|
||||
if (!strcmpi(opts,"bold"))
|
||||
iflags.menu_headings = ATR_BOLD;
|
||||
else if (!strcmpi(opts,"inverse"))
|
||||
iflags.menu_headings = ATR_INVERSE;
|
||||
else if (!strcmpi(opts,"underline"))
|
||||
iflags.menu_headings = ATR_ULINE;
|
||||
else
|
||||
badoption(opts);
|
||||
for (i = 0; i < SIZE(attrnames); i++)
|
||||
if (!strcmpi(opts, attrnames[i].name)) {
|
||||
iflags.menu_headings = attrnames[i].attr;
|
||||
return;
|
||||
}
|
||||
badoption(opts);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -3647,35 +3646,8 @@ boolean setinitial,setfromfile;
|
||||
}
|
||||
destroy_nhwindow(tmpwin);
|
||||
} else if (!strcmp("menu_headings", optname)) {
|
||||
static const char *mhchoices[3] = {"bold", "inverse", "underline"};
|
||||
const char *npletters = "biu";
|
||||
menu_item *mode_pick = (menu_item *)0;
|
||||
|
||||
tmpwin = create_nhwindow(NHW_MENU);
|
||||
start_menu(tmpwin);
|
||||
any = zeroany;
|
||||
for (i = 0; i < SIZE(mhchoices); i++) {
|
||||
any.a_int = i + 1;
|
||||
add_menu(tmpwin, NO_GLYPH, &any, npletters[i], 0,
|
||||
ATR_NONE, mhchoices[i], MENU_UNSELECTED);
|
||||
}
|
||||
end_menu(tmpwin, "How to highlight menu headings:");
|
||||
if (select_menu(tmpwin, PICK_ONE, &mode_pick) > 0) {
|
||||
int mode = mode_pick->item.a_int - 1;
|
||||
switch(mode) {
|
||||
case 2:
|
||||
iflags.menu_headings = ATR_ULINE;
|
||||
break;
|
||||
case 0:
|
||||
iflags.menu_headings = ATR_BOLD;
|
||||
break;
|
||||
case 1:
|
||||
default:
|
||||
iflags.menu_headings = ATR_INVERSE;
|
||||
}
|
||||
free((genericptr_t)mode_pick);
|
||||
}
|
||||
destroy_nhwindow(tmpwin);
|
||||
int mhattr = query_attr("How to highlight menu headings:");
|
||||
if (mhattr != -1) iflags.menu_headings = mhattr;
|
||||
} else if (!strcmp("menucolors", optname)) {
|
||||
int opt_idx, nmc, mcclr, mcattr;
|
||||
char mcbuf[BUFSZ];
|
||||
@@ -3689,7 +3661,7 @@ menucolors_again:
|
||||
if (*mcbuf == '\033' || !*mcbuf) goto menucolors_again;
|
||||
mcclr = query_color();
|
||||
if (mcclr == -1) goto menucolors_again;
|
||||
mcattr = query_attr();
|
||||
mcattr = query_attr(NULL);
|
||||
if (mcattr == -1) goto menucolors_again;
|
||||
if (!add_menu_coloring_parsed(mcbuf, mcclr, mcattr)) {
|
||||
pline("Error adding the menu color.");
|
||||
@@ -4083,10 +4055,7 @@ char *buf;
|
||||
else if (!strcmp(optname, "menu_invert_all"))
|
||||
Sprintf(buf, "%s", to_be_done);
|
||||
else if (!strcmp(optname, "menu_headings")) {
|
||||
Sprintf(buf, "%s", (iflags.menu_headings == ATR_BOLD) ?
|
||||
"bold" : (iflags.menu_headings == ATR_INVERSE) ?
|
||||
"inverse" : (iflags.menu_headings == ATR_ULINE) ?
|
||||
"underline" : "unknown");
|
||||
Sprintf(buf, "%s", attr2attrname(iflags.menu_headings));
|
||||
}
|
||||
else if (!strcmp(optname, "menu_invert_page"))
|
||||
Sprintf(buf, "%s", to_be_done);
|
||||
|
||||
Reference in New Issue
Block a user