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