* Common code point leading into the interface-specific * add_menu() to allow single-spot adjustments to the parameters, * such as those done by menu_colors. */
| 1782 | * such as those done by menu_colors. |
| 1783 | */ |
| 1784 | void |
| 1785 | add_menu( |
| 1786 | winid window, /* window to use, must be of type NHW_MENU */ |
| 1787 | const glyph_info *glyphinfo, /* glyph info with glyph to |
| 1788 | * display with item */ |
| 1789 | const anything *identifier, /* what to return if selected */ |
| 1790 | char ch, /* selector letter (0 = pick our own) */ |
| 1791 | char gch, /* group accelerator (0 = no group) */ |
| 1792 | int attr, /* attribute for menu text (str) */ |
| 1793 | int color, /* color for menu text (str) */ |
| 1794 | const char *str, /* menu text */ |
| 1795 | unsigned int itemflags) /* itemflags such as MENU_ITEMFLAGS_SELECTED */ |
| 1796 | { |
| 1797 | if (!str) { |
| 1798 | /* if 'str' is Null, just return without adding any menu entry */ |
| 1799 | debugpline0("add_menu(Null)"); |
| 1800 | return; |
| 1801 | } |
| 1802 | |
| 1803 | if (iflags.use_menu_color) { |
| 1804 | if ((itemflags & MENU_ITEMFLAGS_SKIPMENUCOLORS) == 0) |
| 1805 | (void) get_menu_coloring(str, &color, &attr); |
| 1806 | } |
| 1807 | /* this is the only function that cared about this flag; remove it now */ |
| 1808 | itemflags &= ~MENU_ITEMFLAGS_SKIPMENUCOLORS; |
| 1809 | |
| 1810 | (*windowprocs.win_add_menu)(window, glyphinfo, identifier, |
| 1811 | ch, gch, attr, color, str, itemflags); |
| 1812 | } |
| 1813 | |
| 1814 | /* insert a non-selectable, possibly highlighted line of text into a menu */ |
| 1815 | void |
no test coverage detected