--- xmil/win9x/menu.cpp 2004/08/07 12:10:27 1.6 +++ xmil/win9x/menu.cpp 2004/08/18 10:44:48 1.14 @@ -104,7 +104,116 @@ void sysmenu_setbgsound(UINT8 value) { // ---- -void xmenu_disablewindow(void) { +typedef struct { + UINT16 title; + UINT16 items; +const MENUITEMS *item; +} SUBMENUI; + +static const MENUITEMS fddsitem[4][3] = { + { {IDM_FDD0OPEN, IDS_OPEN}, + {0, 0}, + {IDM_FDD0EJECT, IDS_EJECT}}, + { {IDM_FDD1OPEN, IDS_OPEN}, + {0, 0}, + {IDM_FDD1EJECT, IDS_EJECT}}, + { {IDM_FDD2OPEN, IDS_OPEN}, + {0, 0}, + {IDM_FDD2EJECT, IDS_EJECT}}, + { {IDM_FDD3OPEN, IDS_OPEN}, + {0, 0}, + {IDM_FDD3EJECT, IDS_EJECT}}}; + +static const SUBMENUI fddmenu[4] = { + {IDS_FDD0, 3, fddsitem[0]}, + {IDS_FDD1, 3, fddsitem[1]}, + {IDS_FDD2, 3, fddsitem[2]}, + {IDS_FDD3, 3, fddsitem[3]}}; + +static const MENUITEMS dbgsitem[4] = { + {IDM_WIDTH40, IDS_WIDTH40}, + {IDM_WIDTH80, IDS_WIDTH80}, + {0, 0}, + {IDM_Z80SAVE, IDS_Z80SAVE}}; + +static const SUBMENUI dbgmenu = {IDS_DEBUG, 4, dbgsitem}; + + +static void insertsubmenu(HMENU hMenu, UINT pos, const SUBMENUI *sm) { + + HMENU hSubMenu; + + hSubMenu = CreatePopupMenu(); + insertresmenus(hSubMenu, 0, sm->item, sm->items); + insertresmenu(hMenu, pos, MF_BYPOSITION | MF_POPUP, + (UINT)hSubMenu, sm->title); +} + +#if defined(SUPPORT_STATSAVE) +static const OEMCHAR xmenu_stat[] = OEMTEXT("S&tat"); +static const OEMCHAR xmenu_statsave[] = OEMTEXT("Save %u"); +static const OEMCHAR xmenu_statload[] = OEMTEXT("Load %u"); + +static void addstatsavemenu(HMENU hMenu, UINT pos) { + + HMENU hSubMenu; + UINT i; + OEMCHAR buf[16]; + + hSubMenu = CreatePopupMenu(); + for (i=0; i