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

Function mswin_add_menu

outdated/sys/wince/mswproc.c:1057–1082  ·  view source on GitHub ↗

add_menu(windid window, int glyph, const anything identifier, char accelerator, char groupacc, int attr, char *str, unsigned int itemflags) -- Add a text line str to the given menu window. If identifier is 0, then the line cannot be selected (e.g. a title). Otherwise, identifier i

Source from the content-addressed store, hash-verified

1055 menu is displayed, set preselected to TRUE.
1056*/
1057void
1058mswin_add_menu(winid wid, int glyph, const ANY_P *identifier,
1059 CHAR_P accelerator, CHAR_P group_accel, int attr,
1060 const char *str, unsigned int itemflags)
1061{
1062 boolean presel = ((itemflags & MENU_ITEMFLAGS_SELECTED) != 0);
1063
1064 logDebug("mswin_add_menu(%d, %d, %p, %c, %c, %d, %s, %u)\n", wid, glyph,
1065 identifier, (char) accelerator, (char) group_accel, attr, str,
1066 itemflags);
1067 if ((wid >= 0) && (wid < MAXWINDOWS)
1068 && (GetNHApp()->windowlist[wid].win != NULL)) {
1069 MSNHMsgAddMenu data;
1070 ZeroMemory(&data, sizeof(data));
1071 data.glyph = glyph;
1072 data.identifier = identifier;
1073 data.accelerator = accelerator;
1074 data.group_accel = group_accel;
1075 data.attr = attr;
1076 data.str = str;
1077 data.presel = presel;
1078
1079 SendMessage(GetNHApp()->windowlist[wid].win, WM_MSNH_COMMAND,
1080 (WPARAM) MSNH_MSG_ADDMENU, (LPARAM) &data);
1081 }
1082}
1083
1084/*
1085end_menu(window, prompt)

Callers 1

ActivateCellFunction · 0.70

Calls 2

logDebugFunction · 0.70
GetNHAppFunction · 0.70

Tested by

no test coverage detected