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

Function SetMenuType

win/win32/mhmenu.c:812–840  ·  view source on GitHub ↗

-----------------------------------------------------------------------------*/

Source from the content-addressed store, hash-verified

810}
811/*-----------------------------------------------------------------------------*/
812void
813SetMenuType(HWND hWnd, int type)
814{
815 PNHMenuWindow data;
816 HWND list, text;
817
818 data = (PNHMenuWindow) GetWindowLongPtr(hWnd, GWLP_USERDATA);
819
820 data->type = type;
821
822 text = GetDlgItem(hWnd, IDC_MENU_TEXT);
823 list = GetDlgItem(hWnd, IDC_MENU_LIST);
824 if (data->type == MENU_TYPE_TEXT) {
825 ShowWindow(list, SW_HIDE);
826 EnableWindow(list, FALSE);
827 EnableWindow(text, TRUE);
828 ShowWindow(text, SW_SHOW);
829 if (data->is_active)
830 SetFocus(text);
831 } else {
832 ShowWindow(text, SW_HIDE);
833 EnableWindow(text, FALSE);
834 EnableWindow(list, TRUE);
835 ShowWindow(list, SW_SHOW);
836 if (data->is_active)
837 SetFocus(list);
838 }
839 LayoutMenu(hWnd);
840}
841/*-----------------------------------------------------------------------------*/
842void
843SetMenuListType(HWND hWnd, int how)

Callers 2

mswin_init_menu_windowFunction · 0.70
onMSNHCommandFunction · 0.70

Calls 1

LayoutMenuFunction · 0.70

Tested by

no test coverage detected