groundwork for window port interface change to add_menu

groundwork only - window port interface change

This changes the last parameter for add_menu() from a boolean
to an unsigned int, to allow additional itemflags in future
beyond just the "preselected" that the original boolean offered.

There shouldn't be any functionality changes with this groundwork-only
change, and if there are it is unintentional and should be reported.
This commit is contained in:
nhmall
2019-12-22 18:28:24 -05:00
parent 0f1284f068
commit 308943aea4
54 changed files with 446 additions and 382 deletions

View File

@@ -1565,13 +1565,13 @@ spellsortmenu()
/* separate final choice from others with a blank line */
any.a_int = 0;
add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, "",
MENU_UNSELECTED);
MENU_ITEMFLAGS_NONE);
} else {
let = 'a' + i;
}
any.a_int = i + 1;
add_menu(tmpwin, NO_GLYPH, &any, let, 0, ATR_NONE, spl_sortchoices[i],
(i == g.spl_sortmode) ? MENU_SELECTED : MENU_UNSELECTED);
(i == g.spl_sortmode) ? MENU_ITEMFLAGS_SELECTED : MENU_ITEMFLAGS_NONE);
}
end_menu(tmpwin, "View known spells list sorted");
@@ -1658,7 +1658,7 @@ int *spell_no;
fmt = "%s\t%-d\t%s\t%-d%%\t%s";
}
add_menu(tmpwin, NO_GLYPH, &any, 0, 0, iflags.menu_headings, buf,
MENU_UNSELECTED);
MENU_ITEMFLAGS_NONE);
for (i = 0; i < MAXSPELL && spellid(i) != NO_SPELL; i++) {
splnum = !g.spl_orderindx ? i : g.spl_orderindx[i];
Sprintf(buf, fmt, spellname(splnum), spellev(splnum),
@@ -1668,7 +1668,7 @@ int *spell_no;
any.a_int = splnum + 1; /* must be non-zero */
add_menu(tmpwin, NO_GLYPH, &any, spellet(splnum), 0, ATR_NONE, buf,
(splnum == splaction) ? MENU_SELECTED : MENU_UNSELECTED);
(splnum == splaction) ? MENU_ITEMFLAGS_SELECTED : MENU_ITEMFLAGS_NONE);
}
how = PICK_ONE;
if (splaction == SPELLMENU_VIEW) {
@@ -1679,7 +1679,7 @@ int *spell_no;
/* more than 1 spell, add an extra menu entry */
any.a_int = SPELLMENU_SORT + 1;
add_menu(tmpwin, NO_GLYPH, &any, '+', 0, ATR_NONE,
"[sort spells]", MENU_UNSELECTED);
"[sort spells]", MENU_ITEMFLAGS_NONE);
}
}
end_menu(tmpwin, prompt);