MCPcopy Create free account
hub / github.com/NetHack/NetHack / mswin_add_menu

Function mswin_add_menu

win/win32/mswproc.c:1147–1176  ·  view source on GitHub ↗

add_menu(windid window, const glyph_info *glyphinfo, const anything identifier, char accelerator, char groupacc, int attr, int clr, char *str, unsigned int itemflags) -- Add a text line str to the given menu window. If identifier is 0,

Source from the content-addressed store, hash-verified

1145 menu is displayed, set preselected to TRUE.
1146*/
1147void
1148mswin_add_menu(winid wid, const glyph_info *glyphinfo,
1149 const ANY_P *identifier,
1150 char accelerator, char group_accel, int attr, int clr,
1151 const char *str, unsigned int itemflags)
1152{
1153 boolean presel = ((itemflags & MENU_ITEMFLAGS_SELECTED) != 0);
1154 logDebug("mswin_add_menu(%d, %d, %u, %p, %c, %c, %d, %d, %s, %u)\n", wid,
1155 glyphinfo->glyph, glyphinfo->gm.glyphflags,
1156 identifier, (char) accelerator, (char) group_accel, attr, clr, str,
1157 itemflags);
1158 if ((wid >= 0) && (wid < MAXWINDOWS)
1159 && (GetNHApp()->windowlist[wid].win != NULL)) {
1160 MSNHMsgAddMenu data;
1161 ZeroMemory(&data, sizeof(data));
1162 if (glyphinfo)
1163 data.glyphinfo = *glyphinfo;
1164 data.identifier = identifier;
1165 data.accelerator = accelerator;
1166 data.group_accel = group_accel;
1167 data.attr = attr;
1168 data.color = clr;
1169 data.str = str;
1170 data.presel = presel;
1171 data.itemflags = itemflags;
1172
1173 SendMessage(GetNHApp()->windowlist[wid].win, WM_MSNH_COMMAND,
1174 (WPARAM) MSNH_MSG_ADDMENU, (LPARAM) &data);
1175 }
1176}
1177
1178/*
1179end_menu(window, prompt)

Callers

nothing calls this directly

Calls 2

logDebugFunction · 0.70
GetNHAppFunction · 0.70

Tested by

no test coverage detected