trunk/src/emu/ui/swlist.c
| r31804 | r31805 | |
| 30 | 30 | // ctor |
| 31 | 31 | //------------------------------------------------- |
| 32 | 32 | |
| 33 | | ui_menu_software_parts::ui_menu_software_parts(running_machine &machine, render_container *container, const software_info *info, const char *interface, const software_part **part, bool opt_fmgr, int *result) |
| 33 | ui_menu_software_parts::ui_menu_software_parts(running_machine &machine, render_container *container, const software_info *info, const char *interface, const software_part **part, bool other_opt, int *result) |
| 34 | 34 | : ui_menu(machine, container) |
| 35 | 35 | { |
| 36 | 36 | m_info = info; |
| 37 | 37 | m_interface = interface; |
| 38 | 38 | m_selected_part = part; |
| 39 | | m_opt_fmgr = opt_fmgr; |
| 39 | m_other_opt = other_opt; |
| 40 | 40 | m_result = result; |
| 41 | 41 | } |
| 42 | 42 | |
| r31804 | r31805 | |
| 56 | 56 | |
| 57 | 57 | void ui_menu_software_parts::populate() |
| 58 | 58 | { |
| 59 | if (m_other_opt) |
| 60 | { |
| 61 | software_part_menu_entry *entry1 = (software_part_menu_entry *) m_pool_alloc(sizeof(*entry1)); |
| 62 | entry1->type = T_EMPTY; |
| 63 | entry1->part = 0; |
| 64 | item_append("[empty slot]", 0, 0, entry1); |
| 65 | |
| 66 | software_part_menu_entry *entry2 = (software_part_menu_entry *) m_pool_alloc(sizeof(*entry2)); |
| 67 | entry2->type = T_FMGR; |
| 68 | entry2->part = 0; |
| 69 | item_append("[file manager]", 0, 0, entry2); |
| 70 | |
| 71 | |
| 72 | software_part_menu_entry *entry3 = (software_part_menu_entry *) m_pool_alloc(sizeof(*entry3)); |
| 73 | entry3->type = T_SWLIST; |
| 74 | entry3->part = 0; |
| 75 | item_append("[software list]", 0, 0, entry3); |
| 76 | } |
| 77 | |
| 59 | 78 | for (const software_part *swpart = m_info->first_part(); swpart != NULL; swpart = swpart->next()) |
| 60 | 79 | { |
| 61 | 80 | if (swpart->matches_interface(m_interface)) |
| r31804 | r31805 | |
| 71 | 90 | item_append(m_info->shortname(), menu_part_name.cstr(), 0, entry); |
| 72 | 91 | } |
| 73 | 92 | } |
| 74 | | |
| 75 | | if (m_opt_fmgr) |
| 76 | | { |
| 77 | | software_part_menu_entry *entry = (software_part_menu_entry *) m_pool_alloc(sizeof(*entry)); |
| 78 | | entry->type = T_FMGR; |
| 79 | | entry->part = 0; |
| 80 | | item_append("[file manager]", 0, 0, entry); |
| 81 | | } |
| 82 | 93 | } |
| 83 | 94 | |
| 84 | 95 | |
trunk/src/emu/ui/swlist.h
| r31804 | r31805 | |
| 16 | 16 | |
| 17 | 17 | class ui_menu_software_parts : public ui_menu { |
| 18 | 18 | public: |
| 19 | | enum { T_ENTRY, T_FMGR }; |
| 20 | | ui_menu_software_parts(running_machine &machine, render_container *container, const software_info *info, const char *interface, const software_part **part, bool opt_fmgr, int *result); |
| 19 | enum { T_EMPTY, T_FMGR, T_SWLIST, T_ENTRY, }; |
| 20 | ui_menu_software_parts(running_machine &machine, render_container *container, const software_info *info, const char *interface, const software_part **part, bool other_opt, int *result); |
| 21 | 21 | virtual ~ui_menu_software_parts(); |
| 22 | 22 | virtual void populate(); |
| 23 | 23 | virtual void handle(); |
| r31804 | r31805 | |
| 32 | 32 | const software_info * m_info; |
| 33 | 33 | const char * m_interface; |
| 34 | 34 | const software_part ** m_selected_part; |
| 35 | | bool m_opt_fmgr; |
| 35 | bool m_other_opt; |
| 36 | 36 | int * m_result; |
| 37 | 37 | }; |
| 38 | 38 | |