trunk/src/osd/modules/debugger/win/consolewininfo.c
r243674 | r243675 | |
21 | 21 | |
22 | 22 | |
23 | 23 | consolewin_info::consolewin_info(debugger_windows_interface &debugger) : |
24 | | disasmbasewin_info(debugger, true, "Debug", NULL) |
| 24 | disasmbasewin_info(debugger, true, "Debug", NULL), |
| 25 | m_devices_menu(NULL) |
25 | 26 | { |
26 | 27 | if ((window() == NULL) || (m_views[0] == NULL)) |
27 | 28 | goto cleanup; |
r243674 | r243675 | |
37 | 38 | { |
38 | 39 | // Add image menu only if image devices exist |
39 | 40 | image_interface_iterator iter(machine().root_device()); |
40 | | if (iter.first() != NULL) |
| 41 | device_image_interface *img = iter.first(); |
| 42 | if (img != NULL) |
41 | 43 | { |
42 | | //info->update_menu = image_update_menu; |
43 | | //image_update_menu(info); |
| 44 | m_devices_menu = CreatePopupMenu(); |
| 45 | for ( ; img != NULL; img = iter.next()) |
| 46 | { |
| 47 | astring temp; |
| 48 | temp.format("%s : %s", img->device().name(), img->exists() ? img->filename() : "[no image]"); |
| 49 | TCHAR *tc_buf = tstring_from_utf8(temp); |
| 50 | if (tc_buf != NULL) |
| 51 | { |
| 52 | AppendMenu(m_devices_menu, MF_ENABLED, 0, tc_buf); |
| 53 | osd_free(tc_buf); |
| 54 | } |
| 55 | } |
| 56 | AppendMenu(GetMenu(window()), MF_ENABLED | MF_POPUP, (UINT_PTR)m_devices_menu, TEXT("Images")); |
44 | 57 | } |
45 | 58 | |
46 | 59 | // get the work bounds |
r243674 | r243675 | |
151 | 164 | { |
152 | 165 | disasmbasewin_info::update_menu(); |
153 | 166 | |
154 | | image_interface_iterator iter(machine().root_device()); |
155 | | if (iter.first() != NULL) |
| 167 | if (m_devices_menu != NULL) |
156 | 168 | { |
157 | | DeleteMenu(GetMenu(window()), 2, MF_BYPOSITION); |
158 | | |
159 | 169 | // create the image menu |
160 | | HMENU const devicesmenu = CreatePopupMenu(); |
| 170 | image_interface_iterator iter(machine().root_device()); |
161 | 171 | device_image_interface *img; |
162 | 172 | UINT32 cnt; |
163 | 173 | for (img = iter.first(), cnt = 0; img != NULL; img = iter.next(), cnt++) |
r243674 | r243675 | |
196 | 206 | TCHAR *tc_buf = tstring_from_utf8(temp); |
197 | 207 | if (tc_buf != NULL) |
198 | 208 | { |
199 | | AppendMenu(devicesmenu, MF_ENABLED | MF_POPUP, (UINT_PTR)devicesubmenu, tc_buf); |
| 209 | ModifyMenu(m_devices_menu, cnt, MF_BYPOSITION | MF_POPUP, (UINT_PTR)devicesubmenu, tc_buf); |
200 | 210 | osd_free(tc_buf); |
201 | 211 | } |
202 | 212 | } |
203 | | AppendMenu(GetMenu(window()), MF_ENABLED | MF_POPUP, (UINT_PTR)devicesmenu, TEXT("Images")); |
204 | 213 | } |
205 | 214 | } |
206 | 215 | |