diff options
author | 2021-10-31 12:31:16 +1100 | |
---|---|---|
committer | 2021-10-31 12:31:16 +1100 | |
commit | d64ea5331b2312f81df464fb22dcef0191216d86 (patch) | |
tree | a3f3784371da401e6a675e5b6b9734b88281a08d /src/frontend/mame/ui/swlist.cpp | |
parent | cfffc54b61cabc5ef9533396bf87324eb5eeb63e (diff) |
-frontend: Refactored menu event handling and fixed a number of issues. (#8777)
* Moved common code for drawing about box, info viewer, and other text box menus to a base class; removed the last of the info viewer logic and the multi-line item hack from the base menu class.
* Added previous/next group navigation for general inputs and plugin input selection menus.
* Moved message catalog logic to lib/util, allowing osd and emu to use localised messages.
* Made the base menu class use the UI manager’s feature for holding session state rather than a static map and mutex.
* Improved menu event handling model, and fixed many issues, particularly with menus behaving badly when hidden/shown.
* Added better support for menus that don’t participate in the usual menu stack, like the menuless sliders and the save/load state menus.
* Made a number of menus refresh state when being shown after being hidden (fixes MT08121 among other issues).
* Fixed indication of mounted slot option in the slot option details menu.
* Improved appearance of background menus when emulation isn't running - draw all menus in the stack, and darken the background menus to make the edges of the active menu clearer.
* Fixed locale issues in -listxml.
-debugger: Made GUI debuggers more uniform.
* Added new memory view features to Win32 debugger.
* Fixed spelling of hexadecimal in Cocoa debugger and added decimal address option.
* Fixed duplicate keyboard shortcut in Cocoa debugger (Shift-Cmd-D was both new device window and 64-bit float format).
* Made keyboard shortcuts slightly more consistent across debuggers.
-plugins: Moved input selection menu and sequence polling code to a common library. Fixed the issue that prevented keyboard inputs being mapped with -steadykey on.
-docs: Started adding some documentation for MAME's internal UI, and updated the list of example front-ends.
-Regenerated message catalog sources. For translators, the new strings are mostly:
* The names of the inputs provided by the OS-dependent layer for things like fullscreen and video features. These show up in the user interface inputs menu.
* The names for automatically generated views. These show up in the video options menu - test with a system with a lot of screens to see more variants.
* The input macro plugin UI.
* A few format strings for analog input assignments.
* A few strings for the about box header.
Diffstat (limited to 'src/frontend/mame/ui/swlist.cpp')
-rw-r--r-- | src/frontend/mame/ui/swlist.cpp | 40 |
1 files changed, 17 insertions, 23 deletions
diff --git a/src/frontend/mame/ui/swlist.cpp b/src/frontend/mame/ui/swlist.cpp index ac7235c1b1c..72e076df67c 100644 --- a/src/frontend/mame/ui/swlist.cpp +++ b/src/frontend/mame/ui/swlist.cpp @@ -124,14 +124,12 @@ void menu_software_parts::populate(float &customtop, float &custombottom) // handle //------------------------------------------------- -void menu_software_parts::handle() +void menu_software_parts::handle(event const *ev) { // process the menu - const event *event = process(0); - - if (event != nullptr && event->iptkey == IPT_UI_SELECT && event->itemref != nullptr) + if (ev && (ev->iptkey == IPT_UI_SELECT) && ev->itemref) { - software_part_menu_entry *entry = (software_part_menu_entry *) event->itemref; + software_part_menu_entry *entry = (software_part_menu_entry *)ev->itemref; m_result = entry->type; *m_selected_part = entry->part; stack_pop(); @@ -239,16 +237,14 @@ void menu_software_list::populate(float &customtop, float &custombottom) // handle //------------------------------------------------- -void menu_software_list::handle() +void menu_software_list::handle(event const *ev) { // process the menu - const event *event = process(0); - - if (event) + if (ev) { - if (event->iptkey == IPT_UI_SELECT) + if (ev->iptkey == IPT_UI_SELECT) { - if (event->itemref == ITEMREF_SWITCH_ITEM_ORDERING) + if (ev->itemref == ITEMREF_SWITCH_ITEM_ORDERING) { m_ordered_by_shortname = !m_ordered_by_shortname; @@ -262,23 +258,23 @@ void menu_software_list::handle() ? _("Switched Order: entries now ordered by shortname") : _("Switched Order: entries now ordered by description")); } - else if (event->itemref) + else if (ev->itemref) { // handle selections - entry_info *info = (entry_info *) event->itemref; + entry_info *info = (entry_info *)ev->itemref; m_result = info->short_name; stack_pop(); } } - else if (event->iptkey == IPT_SPECIAL) + else if (ev->iptkey == IPT_SPECIAL) { - if (input_character(m_search, event->unichar, m_ordered_by_shortname ? is_valid_softlist_part_char : [] (char32_t ch) { return true; })) + if (input_character(m_search, ev->unichar, m_ordered_by_shortname ? is_valid_softlist_part_char : [] (char32_t ch) { return true; })) { // display the popup ui().popup_time(ERROR_MESSAGE_TIME, "%s", m_search); // identify the selected entry - entry_info const *const cur_selected = (uintptr_t(event->itemref) != 1) + entry_info const *const cur_selected = (uintptr_t(ev->itemref) != 1) ? reinterpret_cast<entry_info const *>(get_selection_ref()) : nullptr; @@ -315,7 +311,7 @@ void menu_software_list::handle() } } } - else if (event->iptkey == IPT_UI_CANCEL) + else if (ev->iptkey == IPT_UI_CANCEL) { // reset the char buffer also in this case if (!m_search.empty()) @@ -410,15 +406,13 @@ void menu_software::populate(float &customtop, float &custombottom) // handle //------------------------------------------------- -void menu_software::handle() +void menu_software::handle(event const *ev) { // process the menu - const event *event = process(0); - - if (event != nullptr && event->iptkey == IPT_UI_SELECT) + if (ev && (ev->iptkey == IPT_UI_SELECT)) { - //menu::stack_push<menu_software_list>(ui(), container(), (software_list_config *)event->itemref, image); - *m_result = reinterpret_cast<software_list_device *>(event->itemref); + //menu::stack_push<menu_software_list>(ui(), container(), (software_list_config *)ev->itemref, image); + *m_result = reinterpret_cast<software_list_device *>(ev->itemref); stack_pop(); } } |