summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2016-11-23 09:41:14 +1100
committer Vas Crabb <vas@vastheman.com>2016-11-23 09:41:33 +1100
commit32c256eccc827d2708c6c270c5c59df4b8a6ae01 (patch)
treed604fb4f36efeb9a68dc395e0f7a1ae48b3d0e21
parentf4871c88cb9d09ceb6689d8d2d3b10ddb133d225 (diff)
Encapsulate a bit more of the menu base class to control when layout changes can happen
-rw-r--r--src/frontend/mame/ui/auditmenu.cpp2
-rw-r--r--src/frontend/mame/ui/auditmenu.h2
-rw-r--r--src/frontend/mame/ui/barcode.cpp5
-rw-r--r--src/frontend/mame/ui/barcode.h6
-rw-r--r--src/frontend/mame/ui/cheatopt.cpp4
-rw-r--r--src/frontend/mame/ui/cheatopt.h4
-rw-r--r--src/frontend/mame/ui/custmenu.cpp4
-rw-r--r--src/frontend/mame/ui/custmenu.h4
-rw-r--r--src/frontend/mame/ui/custui.cpp16
-rw-r--r--src/frontend/mame/ui/custui.h14
-rw-r--r--src/frontend/mame/ui/datmenu.cpp8
-rw-r--r--src/frontend/mame/ui/datmenu.h7
-rw-r--r--src/frontend/mame/ui/devopt.cpp2
-rw-r--r--src/frontend/mame/ui/devopt.h2
-rw-r--r--src/frontend/mame/ui/dirmenu.cpp8
-rw-r--r--src/frontend/mame/ui/dirmenu.h8
-rw-r--r--src/frontend/mame/ui/filecreate.cpp6
-rw-r--r--src/frontend/mame/ui/filecreate.h10
-rw-r--r--src/frontend/mame/ui/filemngr.cpp2
-rw-r--r--src/frontend/mame/ui/filemngr.h2
-rw-r--r--src/frontend/mame/ui/filesel.cpp4
-rw-r--r--src/frontend/mame/ui/filesel.h8
-rw-r--r--src/frontend/mame/ui/imgcntrl.cpp2
-rw-r--r--src/frontend/mame/ui/imgcntrl.h2
-rw-r--r--src/frontend/mame/ui/info.cpp4
-rw-r--r--src/frontend/mame/ui/info.h9
-rw-r--r--src/frontend/mame/ui/info_pty.cpp2
-rw-r--r--src/frontend/mame/ui/info_pty.h6
-rw-r--r--src/frontend/mame/ui/inputmap.cpp10
-rw-r--r--src/frontend/mame/ui/inputmap.h14
-rw-r--r--src/frontend/mame/ui/mainmenu.cpp2
-rw-r--r--src/frontend/mame/ui/mainmenu.h2
-rw-r--r--src/frontend/mame/ui/menu.cpp21
-rw-r--r--src/frontend/mame/ui/menu.h24
-rw-r--r--src/frontend/mame/ui/miscmenu.cpp21
-rw-r--r--src/frontend/mame/ui/miscmenu.h22
-rw-r--r--src/frontend/mame/ui/optsmenu.cpp2
-rw-r--r--src/frontend/mame/ui/optsmenu.h2
-rw-r--r--src/frontend/mame/ui/pluginopt.cpp4
-rw-r--r--src/frontend/mame/ui/pluginopt.h4
-rw-r--r--src/frontend/mame/ui/selector.cpp2
-rw-r--r--src/frontend/mame/ui/selector.h2
-rw-r--r--src/frontend/mame/ui/selgame.cpp2
-rw-r--r--src/frontend/mame/ui/selgame.h2
-rw-r--r--src/frontend/mame/ui/selmenu.cpp17
-rw-r--r--src/frontend/mame/ui/selmenu.h5
-rw-r--r--src/frontend/mame/ui/selsoft.cpp6
-rw-r--r--src/frontend/mame/ui/selsoft.h10
-rw-r--r--src/frontend/mame/ui/simpleselgame.cpp2
-rw-r--r--src/frontend/mame/ui/simpleselgame.h6
-rw-r--r--src/frontend/mame/ui/sliders.cpp2
-rw-r--r--src/frontend/mame/ui/sliders.h2
-rw-r--r--src/frontend/mame/ui/slotopt.cpp2
-rw-r--r--src/frontend/mame/ui/slotopt.h2
-rw-r--r--src/frontend/mame/ui/sndmenu.cpp2
-rw-r--r--src/frontend/mame/ui/sndmenu.h8
-rw-r--r--src/frontend/mame/ui/submenu.cpp6
-rw-r--r--src/frontend/mame/ui/submenu.h6
-rw-r--r--src/frontend/mame/ui/swlist.cpp6
-rw-r--r--src/frontend/mame/ui/swlist.h6
-rw-r--r--src/frontend/mame/ui/tapectrl.cpp61
-rw-r--r--src/frontend/mame/ui/tapectrl.h2
-rw-r--r--src/frontend/mame/ui/videoopt.cpp4
-rw-r--r--src/frontend/mame/ui/videoopt.h4
64 files changed, 235 insertions, 213 deletions
diff --git a/src/frontend/mame/ui/auditmenu.cpp b/src/frontend/mame/ui/auditmenu.cpp
index c76d43da8db..9fbccdf55eb 100644
--- a/src/frontend/mame/ui/auditmenu.cpp
+++ b/src/frontend/mame/ui/auditmenu.cpp
@@ -166,7 +166,7 @@ void menu_audit::handle()
// populate
//-------------------------------------------------
-void menu_audit::populate()
+void menu_audit::populate(float &customtop, float &custombottom)
{
item_append("Dummy", "", 0, (void *)(uintptr_t)1);
}
diff --git a/src/frontend/mame/ui/auditmenu.h b/src/frontend/mame/ui/auditmenu.h
index 4f630792023..aadebcbac9f 100644
--- a/src/frontend/mame/ui/auditmenu.h
+++ b/src/frontend/mame/ui/auditmenu.h
@@ -28,7 +28,7 @@ public:
virtual ~menu_audit() override;
private:
- virtual void populate() override;
+ virtual void populate(float &customtop, float &custombottom) override;
virtual void handle() override;
void save_available_machines();
diff --git a/src/frontend/mame/ui/barcode.cpp b/src/frontend/mame/ui/barcode.cpp
index 1c62f42a92b..7945e70fd07 100644
--- a/src/frontend/mame/ui/barcode.cpp
+++ b/src/frontend/mame/ui/barcode.cpp
@@ -50,7 +50,7 @@ menu_barcode_reader::~menu_barcode_reader()
// populate - populates the barcode input menu
//-------------------------------------------------
-void menu_barcode_reader::populate()
+void menu_barcode_reader::populate(float &customtop, float &custombottom)
{
if (current_device())
{
@@ -89,8 +89,7 @@ void menu_barcode_reader::populate()
void menu_barcode_reader::handle()
{
// rebuild the menu (so to update the selected device, if the user has pressed L or R)
- reset(reset_options::REMEMBER_POSITION);
- populate();
+ repopulate(reset_options::REMEMBER_POSITION);
// process the menu
const event *event = process(PROCESS_LR_REPEAT);
diff --git a/src/frontend/mame/ui/barcode.h b/src/frontend/mame/ui/barcode.h
index b5573b4b3b5..7f48d4f78ed 100644
--- a/src/frontend/mame/ui/barcode.h
+++ b/src/frontend/mame/ui/barcode.h
@@ -8,11 +8,11 @@
***************************************************************************/
-#pragma once
-
#ifndef MAME_FRONTEND_UI_BARCODE_H
#define MAME_FRONTEND_UI_BARCODE_H
+#pragma once
+
#include "machine/bcreader.h"
#include "ui/devctrl.h"
@@ -23,7 +23,7 @@ public:
virtual ~menu_barcode_reader() override;
private:
- virtual void populate() override;
+ virtual void populate(float &customtop, float &custombottom) override;
virtual void handle() override;
std::string m_barcode_buffer;
diff --git a/src/frontend/mame/ui/cheatopt.cpp b/src/frontend/mame/ui/cheatopt.cpp
index d04b4e2e289..0e911aa0972 100644
--- a/src/frontend/mame/ui/cheatopt.cpp
+++ b/src/frontend/mame/ui/cheatopt.cpp
@@ -126,7 +126,7 @@ menu_cheat::menu_cheat(mame_ui_manager &mui, render_container &container) : menu
{
}
-void menu_cheat::populate()
+void menu_cheat::populate(float &customtop, float &custombottom)
{
/* iterate over cheats */
std::string text;
@@ -264,7 +264,7 @@ void menu_autofire::handle()
menu
-------------------------------------------------*/
-void menu_autofire::populate()
+void menu_autofire::populate(float &customtop, float &custombottom)
{
char temp_text[64];
diff --git a/src/frontend/mame/ui/cheatopt.h b/src/frontend/mame/ui/cheatopt.h
index 7c0b8973587..e95e765cb30 100644
--- a/src/frontend/mame/ui/cheatopt.h
+++ b/src/frontend/mame/ui/cheatopt.h
@@ -23,7 +23,7 @@ public:
virtual ~menu_cheat() override;
private:
- virtual void populate() override;
+ virtual void populate(float &customtop, float &custombottom) override;
virtual void handle() override;
};
@@ -35,7 +35,7 @@ public:
virtual ~menu_autofire() override;
private:
- virtual void populate() override;
+ virtual void populate(float &customtop, float &custombottom) override;
virtual void handle() override;
float refresh;
diff --git a/src/frontend/mame/ui/custmenu.cpp b/src/frontend/mame/ui/custmenu.cpp
index 4f91d8f2ebc..bdb6b5c9f9f 100644
--- a/src/frontend/mame/ui/custmenu.cpp
+++ b/src/frontend/mame/ui/custmenu.cpp
@@ -152,7 +152,7 @@ void menu_custom_filter::handle()
//-------------------------------------------------
// populate
//-------------------------------------------------
-void menu_custom_filter::populate()
+void menu_custom_filter::populate(float &customtop, float &custombottom)
{
// add main filter
uint32_t arrow_flags = get_arrow_flags<uint16_t>(FILTER_ALL, FILTER_UNAVAILABLE, custfltr::main);
@@ -439,7 +439,7 @@ void menu_swcustom_filter::handle()
//-------------------------------------------------
// populate
//-------------------------------------------------
-void menu_swcustom_filter::populate()
+void menu_swcustom_filter::populate(float &customtop, float &custombottom)
{
// add main filter
uint32_t arrow_flags = get_arrow_flags<uint16_t>(UI_SW_ALL, UI_SW_UNAVAILABLE, sw_custfltr::main);
diff --git a/src/frontend/mame/ui/custmenu.h b/src/frontend/mame/ui/custmenu.h
index 8fef83c0cac..77a470cf621 100644
--- a/src/frontend/mame/ui/custmenu.h
+++ b/src/frontend/mame/ui/custmenu.h
@@ -95,7 +95,7 @@ private:
OTHER_FILTER = LIST_FILTER + MAX_CUST_FILTER + 1
};
- virtual void populate() override;
+ virtual void populate(float &customtop, float &custombottom) override;
virtual void handle() override;
void save_sw_custom_filters();
@@ -128,7 +128,7 @@ private:
SCREEN_FILTER = YEAR_FILTER + MAX_CUST_FILTER + 1,
OTHER_FILTER = SCREEN_FILTER + MAX_CUST_FILTER + 1
};
- virtual void populate() override;
+ virtual void populate(float &customtop, float &custombottom) override;
virtual void handle() override;
void save_custom_filters();
diff --git a/src/frontend/mame/ui/custui.cpp b/src/frontend/mame/ui/custui.cpp
index 8aef30cc083..a1bc8dc8f63 100644
--- a/src/frontend/mame/ui/custui.cpp
+++ b/src/frontend/mame/ui/custui.cpp
@@ -137,7 +137,7 @@ void menu_custom_ui::handle()
// populate
//-------------------------------------------------
-void menu_custom_ui::populate()
+void menu_custom_ui::populate(float &customtop, float &custombottom)
{
uint32_t arrow_flags;
item_append(_("Fonts"), "", 0, (void *)(uintptr_t)FONT_MENU);
@@ -338,7 +338,7 @@ void menu_font_ui::handle()
// populate
//-------------------------------------------------
-void menu_font_ui::populate()
+void menu_font_ui::populate(float &customtop, float &custombottom)
{
// set filter arrow
uint32_t arrow_flags;
@@ -501,7 +501,7 @@ void menu_colors_ui::handle()
// populate
//-------------------------------------------------
-void menu_colors_ui::populate()
+void menu_colors_ui::populate(float &customtop, float &custombottom)
{
item_append(_("Normal text"), "", 0, (void *)(uintptr_t)MUI_TEXT_COLOR);
item_append(_("Selected color"), "", 0, (void *)(uintptr_t)MUI_SELECTED_COLOR);
@@ -824,7 +824,7 @@ void menu_rgb_ui::handle()
// populate
//-------------------------------------------------
-void menu_rgb_ui::populate()
+void menu_rgb_ui::populate(float &customtop, float &custombottom)
{
// set filter arrow
uint32_t arrow_flags = FLAG_LEFT_ARROW | FLAG_RIGHT_ARROW;
@@ -1035,7 +1035,7 @@ void menu_palette_sel::handle()
// populate
//-------------------------------------------------
-void menu_palette_sel::populate()
+void menu_palette_sel::populate(float &customtop, float &custombottom)
{
for (unsigned x = 0; x < ARRAY_LENGTH(s_palette); ++x)
item_append(_(s_palette[x].first), s_palette[x].second, 0, (void *)(uintptr_t)(x + 1));
@@ -1087,7 +1087,7 @@ void menu_palette_sel::draw(uint32_t flags)
}
// account for extra space at the top and bottom
- auto visible_extra_menu_height = customtop + custombottom;
+ auto visible_extra_menu_height = get_customtop() + get_custombottom();
// add a little bit of slop for rounding
visible_width += 0.01f;
@@ -1109,7 +1109,7 @@ void menu_palette_sel::draw(uint32_t flags)
float visible_top = (1.0f - (visible_main_menu_height + visible_extra_menu_height)) * 0.5f;
// if the menu is at the bottom of the extra, adjust
- visible_top += customtop;
+ visible_top += get_customtop();
// first add us a box
float x1 = visible_left - UI_BOX_LR_BORDER;
@@ -1231,7 +1231,7 @@ void menu_palette_sel::draw(uint32_t flags)
}
// if there is something special to add, do it by calling the virtual method
- custom_render(get_selection_ref(), customtop, custombottom, x1, y1, x2, y2);
+ custom_render(get_selection_ref(), get_customtop(), get_custombottom(), x1, y1, x2, y2);
// return the number of visible lines, minus 1 for top arrow and 1 for bottom arrow
m_visible_items = visible_lines - (top_line != 0) - (top_line + visible_lines != item.size());
diff --git a/src/frontend/mame/ui/custui.h b/src/frontend/mame/ui/custui.h
index ed4ebc12585..a7ac84680d5 100644
--- a/src/frontend/mame/ui/custui.h
+++ b/src/frontend/mame/ui/custui.h
@@ -8,11 +8,11 @@
***************************************************************************/
-#pragma once
-
#ifndef MAME_FRONTEND_UI_CUSTUI_H
#define MAME_FRONTEND_UI_CUSTUI_H
+#pragma once
+
#include "ui/menu.h"
namespace ui {
@@ -38,7 +38,7 @@ private:
HIDE_MENU
};
- virtual void populate() override;
+ virtual void populate(float &customtop, float &custombottom) override;
virtual void handle() override;
static const char *const HIDE_STATUS[];
@@ -70,7 +70,7 @@ private:
MUI_ITALIC
};
- virtual void populate() override;
+ virtual void populate(float &customtop, float &custombottom) override;
virtual void handle() override;
void list();
@@ -126,7 +126,7 @@ private:
const char *option;
};
- virtual void populate() override;
+ virtual void populate(float &customtop, float &custombottom) override;
virtual void handle() override;
s_color_table m_color_table[MUI_RESTORE];
@@ -156,7 +156,7 @@ private:
PALETTE_CHOOSE
};
- virtual void populate() override;
+ virtual void populate(float &customtop, float &custombottom) override;
virtual void handle() override;
void inkey_special(const event *menu_event);
@@ -185,7 +185,7 @@ private:
// draw palette menu
virtual void draw(uint32_t flags) override;
- virtual void populate() override;
+ virtual void populate(float &customtop, float &custombottom) override;
virtual void handle() override;
static std::pair<const char *, const char *> const s_palette[];
diff --git a/src/frontend/mame/ui/datmenu.cpp b/src/frontend/mame/ui/datmenu.cpp
index bd4e7a72865..4e15c31b674 100644
--- a/src/frontend/mame/ui/datmenu.cpp
+++ b/src/frontend/mame/ui/datmenu.cpp
@@ -126,7 +126,7 @@ void menu_dats_view::handle()
// populate
//-------------------------------------------------
-void menu_dats_view::populate()
+void menu_dats_view::populate(float &customtop, float &custombottom)
{
bool paused = machine().paused();
if (!paused)
@@ -160,7 +160,7 @@ void menu_dats_view::draw(uint32_t flags)
hover = item.size() + 1;
visible_items = item.size() - 2;
float extra_height = 2.0f * line_height;
- float visible_extra_menu_height = customtop + custombottom + extra_height;
+ float visible_extra_menu_height = get_customtop() + get_custombottom() + extra_height;
// locate mouse
mouse_hit = false;
@@ -179,7 +179,7 @@ void menu_dats_view::draw(uint32_t flags)
float visible_top = (1.0f - (visible_main_menu_height + visible_extra_menu_height)) * 0.5f;
// if the menu is at the bottom of the extra, adjust
- visible_top += customtop;
+ visible_top += get_customtop();
// compute left box size
float x1 = visible_left;
@@ -277,7 +277,7 @@ void menu_dats_view::draw(uint32_t flags)
}
// if there is something special to add, do it by calling the virtual method
- custom_render(get_selection_ref(), customtop, custombottom, x1, y1, x2, y2);
+ custom_render(get_selection_ref(), get_customtop(), get_custombottom(), x1, y1, x2, y2);
// return the number of visible lines, minus 1 for top arrow and 1 for bottom arrow
m_visible_items = m_visible_lines - (top_line != 0) - (top_line + m_visible_lines != visible_items);
diff --git a/src/frontend/mame/ui/datmenu.h b/src/frontend/mame/ui/datmenu.h
index ed16d276d3d..f12cd61e67d 100644
--- a/src/frontend/mame/ui/datmenu.h
+++ b/src/frontend/mame/ui/datmenu.h
@@ -9,11 +9,11 @@
***************************************************************************/
-#pragma once
-
#ifndef MAME_FRONTEND_UI_DATMENU_H
#define MAME_FRONTEND_UI_DATMENU_H
+#pragma once
+
#include "ui/menu.h"
#include <string>
@@ -23,6 +23,7 @@
struct ui_software_info;
namespace ui {
+
//-------------------------------------------------
// class dats menu
//-------------------------------------------------
@@ -41,7 +42,7 @@ private:
// draw dats menu
virtual void draw(uint32_t flags) override;
- virtual void populate() override;
+ virtual void populate(float &customtop, float &custombottom) override;
virtual void handle() override;
int visible_items;
diff --git a/src/frontend/mame/ui/devopt.cpp b/src/frontend/mame/ui/devopt.cpp
index 120ff1d774e..1d7f81036d6 100644
--- a/src/frontend/mame/ui/devopt.cpp
+++ b/src/frontend/mame/ui/devopt.cpp
@@ -26,7 +26,7 @@ menu_device_config::menu_device_config(mame_ui_manager &mui, render_container &c
m_mounted = slot->device().subdevice(option->name()) != nullptr;
}
-void menu_device_config::populate()
+void menu_device_config::populate(float &customtop, float &custombottom)
{
std::ostringstream str;
device_t *dev;
diff --git a/src/frontend/mame/ui/devopt.h b/src/frontend/mame/ui/devopt.h
index bf6835f9df0..1bd3fafb627 100644
--- a/src/frontend/mame/ui/devopt.h
+++ b/src/frontend/mame/ui/devopt.h
@@ -23,7 +23,7 @@ public:
virtual ~menu_device_config() override;
private:
- virtual void populate() override;
+ virtual void populate(float &customtop, float &custombottom) override;
virtual void handle() override;
device_slot_interface *m_owner;
diff --git a/src/frontend/mame/ui/dirmenu.cpp b/src/frontend/mame/ui/dirmenu.cpp
index ed91853c5cf..a8c5ffc20d2 100644
--- a/src/frontend/mame/ui/dirmenu.cpp
+++ b/src/frontend/mame/ui/dirmenu.cpp
@@ -98,7 +98,7 @@ void menu_directory::handle()
// populate
//-------------------------------------------------
-void menu_directory::populate()
+void menu_directory::populate(float &customtop, float &custombottom)
{
for (auto & elem : s_folders)
item_append(_(elem.name), "", 0, (void *)(uintptr_t)elem.action);
@@ -181,7 +181,7 @@ void menu_display_actual::handle()
// populate
//-------------------------------------------------
-void menu_display_actual::populate()
+void menu_display_actual::populate(float &customtop, float &custombottom)
{
m_tempbuf = string_format(_("Current %1$s Folders"), _(s_folders[m_ref].name));
if (ui().options().exists(s_folders[m_ref].option))
@@ -446,7 +446,7 @@ void menu_add_change_folder::handle()
// populate
//-------------------------------------------------
-void menu_add_change_folder::populate()
+void menu_add_change_folder::populate(float &customtop, float &custombottom)
{
// open a path
const char *volume_name = nullptr;
@@ -608,7 +608,7 @@ void menu_remove_folder::handle()
// populate menu
//-------------------------------------------------
-void menu_remove_folder::populate()
+void menu_remove_folder::populate(float &customtop, float &custombottom)
{
int folders_count = 0;
for (auto & elem : m_folders)
diff --git a/src/frontend/mame/ui/dirmenu.h b/src/frontend/mame/ui/dirmenu.h
index f23bcc44103..baff9bd1d52 100644
--- a/src/frontend/mame/ui/dirmenu.h
+++ b/src/frontend/mame/ui/dirmenu.h
@@ -33,7 +33,7 @@ protected:
virtual void custom_render(void *selectedref, float top, float bottom, float x, float y, float x2, float y2) override;
private:
- virtual void populate() override;
+ virtual void populate(float &customtop, float &custombottom) override;
virtual void handle() override;
};
@@ -57,7 +57,7 @@ private:
REMOVE,
};
- virtual void populate() override;
+ virtual void populate(float &customtop, float &custombottom) override;
virtual void handle() override;
std::string m_tempbuf, m_searchpath;
@@ -79,7 +79,7 @@ protected:
virtual void custom_render(void *selectedref, float top, float bottom, float x, float y, float x2, float y2) override;
private:
- virtual void populate() override;
+ virtual void populate(float &customtop, float &custombottom) override;
virtual void handle() override;
std::string m_searchpath;
@@ -103,7 +103,7 @@ protected:
virtual bool menu_has_search_active() override { return (m_search[0] != 0); }
private:
- virtual void populate() override;
+ virtual void populate(float &customtop, float &custombottom) override;
virtual void handle() override;
int m_ref;
diff --git a/src/frontend/mame/ui/filecreate.cpp b/src/frontend/mame/ui/filecreate.cpp
index a1540e403a5..0cfef03b723 100644
--- a/src/frontend/mame/ui/filecreate.cpp
+++ b/src/frontend/mame/ui/filecreate.cpp
@@ -74,7 +74,7 @@ menu_confirm_save_as::~menu_confirm_save_as()
// populate
//-------------------------------------------------
-void menu_confirm_save_as::populate()
+void menu_confirm_save_as::populate(float &customtop, float &custombottom)
{
item_append(_("File Already Exists - Override?"), "", FLAG_DISABLE, nullptr);
item_append(menu_item_type::SEPARATOR);
@@ -152,7 +152,7 @@ void menu_file_create::custom_render(void *selectedref, float top, float bottom,
// populate - populates the file creator menu
//-------------------------------------------------
-void menu_file_create::populate()
+void menu_file_create::populate(float &customtop, float &custombottom)
{
std::string buffer;
const image_device_format *format;
@@ -261,7 +261,7 @@ menu_select_format::~menu_select_format()
// populate
//-------------------------------------------------
-void menu_select_format::populate()
+void menu_select_format::populate(float &customtop, float &custombottom)
{
item_append(_("Select image format"), "", FLAG_DISABLE, nullptr);
for (int i = 0; i < m_total_usable; i++)
diff --git a/src/frontend/mame/ui/filecreate.h b/src/frontend/mame/ui/filecreate.h
index 9dfb50d7432..a97b4f53ef5 100644
--- a/src/frontend/mame/ui/filecreate.h
+++ b/src/frontend/mame/ui/filecreate.h
@@ -8,11 +8,11 @@
***************************************************************************/
-#pragma once
-
#ifndef MAME_FRONTEND_UI_FILECREATE_H
#define MAME_FRONTEND_UI_FILECREATE_H
+#pragma once
+
#include "ui/menu.h"
class floppy_image_format_t;
@@ -27,7 +27,7 @@ public:
virtual ~menu_confirm_save_as() override;
private:
- virtual void populate() override;
+ virtual void populate(float &customtop, float &custombottom) override;
virtual void handle() override;
bool *m_yes;
@@ -46,7 +46,7 @@ protected:
virtual void custom_render(void *selectedref, float top, float bottom, float x, float y, float x2, float y2) override;
private:
- virtual void populate() override;
+ virtual void populate(float &customtop, float &custombottom) override;
virtual void handle() override;
bool & m_ok;
@@ -67,7 +67,7 @@ public:
virtual ~menu_select_format() override;
private:
- virtual void populate() override;
+ virtual void populate(float &customtop, float &custombottom) override;
virtual void handle() override;
// internal state
diff --git a/src/frontend/mame/ui/filemngr.cpp b/src/frontend/mame/ui/filemngr.cpp
index a5ae3c84968..74916b46ac1 100644
--- a/src/frontend/mame/ui/filemngr.cpp
+++ b/src/frontend/mame/ui/filemngr.cpp
@@ -103,7 +103,7 @@ void menu_file_manager::fill_image_line(device_image_interface *img, std::string
// populate
//-------------------------------------------------
-void menu_file_manager::populate()
+void menu_file_manager::populate(float &customtop, float &custombottom)
{
std::string tmp_inst, tmp_name;
bool first_entry = true;
diff --git a/src/frontend/mame/ui/filemngr.h b/src/frontend/mame/ui/filemngr.h
index 34cdb0a98ce..68da54f1d05 100644
--- a/src/frontend/mame/ui/filemngr.h
+++ b/src/frontend/mame/ui/filemngr.h
@@ -30,7 +30,7 @@ protected:
virtual void custom_render(void *selectedref, float top, float bottom, float x, float y, float x2, float y2) override;
private:
- virtual void populate() override;
+ virtual void populate(float &customtop, float &custombottom) override;
virtual void handle() override;
void fill_image_line(device_image_interface *img, std::string &instance, std::string &filename);
diff --git a/src/frontend/mame/ui/filesel.cpp b/src/frontend/mame/ui/filesel.cpp
index fe63b20d3a8..adf1f7f1a39 100644
--- a/src/frontend/mame/ui/filesel.cpp
+++ b/src/frontend/mame/ui/filesel.cpp
@@ -288,7 +288,7 @@ void menu_file_selector::append_entry_menu_item(const file_selector_entry *entry
// populate
//-------------------------------------------------
-void menu_file_selector::populate()
+void menu_file_selector::populate(float &customtop, float &custombottom)
{
util::zippath_directory *directory = nullptr;
osd_file::error err;
@@ -507,7 +507,7 @@ menu_select_rw::~menu_select_rw()
// populate
//-------------------------------------------------
-void menu_select_rw::populate()
+void menu_select_rw::populate(float &customtop, float &custombottom)
{
item_append(_("Select access mode"), "", FLAG_DISABLE, nullptr);
item_append(_("Read-only"), "", 0, itemref_from_result(result::READONLY));
diff --git a/src/frontend/mame/ui/filesel.h b/src/frontend/mame/ui/filesel.h
index 7692a996124..a987e9f424b 100644
--- a/src/frontend/mame/ui/filesel.h
+++ b/src/frontend/mame/ui/filesel.h
@@ -8,11 +8,11 @@
***************************************************************************/
-#pragma once
-
#ifndef MAME_FRONTEND_UI_FILESEL_H
#define MAME_FRONTEND_UI_FILESEL_H
+#pragma once
+
#include "ui/menu.h"
namespace ui {
@@ -67,7 +67,7 @@ private:
std::string m_hover_directory;
std::string m_filename;
- virtual void populate() override;
+ virtual void populate(float &customtop, float &custombottom) override;
virtual void handle() override;
// methods
@@ -95,7 +95,7 @@ public:
menu_select_rw(mame_ui_manager &mui, render_container &container,
bool can_in_place, result &result);
virtual ~menu_select_rw() override;
- virtual void populate() override;
+ virtual void populate(float &customtop, float &custombottom) override;
virtual void handle() override;
static void *itemref_from_result(result result);
diff --git a/src/frontend/mame/ui/imgcntrl.cpp b/src/frontend/mame/ui/imgcntrl.cpp
index 7766099bf0f..793466f7d57 100644
--- a/src/frontend/mame/ui/imgcntrl.cpp
+++ b/src/frontend/mame/ui/imgcntrl.cpp
@@ -168,7 +168,7 @@ void menu_control_device_image::hook_load(const std::string &name)
// populate
//-------------------------------------------------
-void menu_control_device_image::populate()
+void menu_control_device_image::populate(float &customtop, float &custombottom)
{
}
diff --git a/src/frontend/mame/ui/imgcntrl.h b/src/frontend/mame/ui/imgcntrl.h
index 3b4188d65f3..a41a3f85f77 100644
--- a/src/frontend/mame/ui/imgcntrl.h
+++ b/src/frontend/mame/ui/imgcntrl.h
@@ -65,7 +65,7 @@ private:
std::string m_software_info_name;
// methods
- virtual void populate() override;
+ virtual void populate(float &customtop, float &custombottom) override;
void test_create(bool &can_create, bool &need_confirm);
void load_software_part();
};
diff --git a/src/frontend/mame/ui/info.cpp b/src/frontend/mame/ui/info.cpp
index 69d47954558..9de81cef6ec 100644
--- a/src/frontend/mame/ui/info.cpp
+++ b/src/frontend/mame/ui/info.cpp
@@ -353,7 +353,7 @@ menu_game_info::~menu_game_info()
{
}
-void menu_game_info::populate()
+void menu_game_info::populate(float &customtop, float &custombottom)
{
std::string tempstring = ui().machine_info().game_info_string();
item_append(std::move(tempstring), "", FLAG_MULTILINE, nullptr);
@@ -379,7 +379,7 @@ menu_image_info::~menu_image_info()
{
}
-void menu_image_info::populate()
+void menu_image_info::populate(float &customtop, float &custombottom)
{
item_append(machine().system().description, "", FLAG_DISABLE, nullptr);
item_append("", "", FLAG_DISABLE, nullptr);
diff --git a/src/frontend/mame/ui/info.h b/src/frontend/mame/ui/info.h
index 51c81c807cd..21d920e4131 100644
--- a/src/frontend/mame/ui/info.h
+++ b/src/frontend/mame/ui/info.h
@@ -8,14 +8,15 @@
***************************************************************************/
-#pragma once
-
#ifndef MAME_FRONTEND_UI_INFO_H
#define MAME_FRONTEND_UI_INFO_H
+#pragma once
+
#include "ui/menu.h"
namespace ui {
+
class machine_info
{
public:
@@ -54,7 +55,7 @@ public:
virtual ~menu_game_info() override;
private:
- virtual void populate() override;
+ virtual void populate(float &customtop, float &custombottom) override;
virtual void handle() override;
};
@@ -66,7 +67,7 @@ public:
virtual ~menu_image_info() override;
private:
- virtual void populate() override;
+ virtual void populate(float &customtop, float &custombottom) override;
virtual void handle() override;
void image_info(device_image_interface *image);
};
diff --git a/src/frontend/mame/ui/info_pty.cpp b/src/frontend/mame/ui/info_pty.cpp
index cf7b6fb4f6f..7b85b090b10 100644
--- a/src/frontend/mame/ui/info_pty.cpp
+++ b/src/frontend/mame/ui/info_pty.cpp
@@ -23,7 +23,7 @@ menu_pty_info::~menu_pty_info()
{
}
-void menu_pty_info::populate()
+void menu_pty_info::populate(float &customtop, float &custombottom)
{
item_append(_("Pseudo terminals"), "", FLAG_DISABLE, nullptr);
item_append("", "", FLAG_DISABLE, nullptr);
diff --git a/src/frontend/mame/ui/info_pty.h b/src/frontend/mame/ui/info_pty.h
index be112c003e4..55249a34d34 100644
--- a/src/frontend/mame/ui/info_pty.h
+++ b/src/frontend/mame/ui/info_pty.h
@@ -8,11 +8,11 @@
***************************************************************************/
-#pragma once
-
#ifndef MAME_FRONTEND_UI_INFO_PTY_H
#define MAME_FRONTEND_UI_INFO_PTY_H
+#pragma once
+
#include "ui/menu.h"
namespace ui {
@@ -23,7 +23,7 @@ public:
virtual ~menu_pty_info() override;
private:
- virtual void populate() override;
+ virtual void populate(float &customtop, float &custombottom) override;
virtual void handle() override;
};
diff --git a/src/frontend/mame/ui/inputmap.cpp b/src/frontend/mame/ui/inputmap.cpp
index c4071f503be..72568523e87 100644
--- a/src/frontend/mame/ui/inputmap.cpp
+++ b/src/frontend/mame/ui/inputmap.cpp
@@ -45,7 +45,7 @@ menu_input_groups::menu_input_groups(mame_ui_manager &mui, render_container &con
{
}
-void menu_input_groups::populate()
+void menu_input_groups::populate(float &customtop, float &custombottom)
{
int player;
@@ -88,7 +88,7 @@ menu_input_general::menu_input_general(mame_ui_manager &mui, render_container &c
group = _group;
}
-void menu_input_general::populate()
+void menu_input_general::populate(float &customtop, float &custombottom)
{
input_item_data *itemlist = nullptr;
int suborder[SEQ_TYPE_TOTAL];
@@ -151,7 +151,7 @@ menu_input_specific::menu_input_specific(mame_ui_manager &mui, render_container
{
}
-void menu_input_specific::populate()
+void menu_input_specific::populate(float &customtop, float &custombottom)
{
input_item_data *itemlist = nullptr;
int suborder[SEQ_TYPE_TOTAL];
@@ -538,7 +538,7 @@ menu_settings::menu_settings(mame_ui_manager &mui, render_container &container,
type = _type;
}
-void menu_settings::populate()
+void menu_settings::populate(float &customtop, float &custombottom)
{
dip_descriptor **diplist_tailptr;
std::string prev_owner;
@@ -812,7 +812,7 @@ menu_analog::menu_analog(mame_ui_manager &mui, render_container &container) : me
{
}
-void menu_analog::populate()
+void menu_analog::populate(float &customtop, float &custombottom)
{
std::string prev_owner;
bool first_entry = true;
diff --git a/src/frontend/mame/ui/inputmap.h b/src/frontend/mame/ui/inputmap.h
index b6934a1d4d6..5006cdffef2 100644
--- a/src/frontend/mame/ui/inputmap.h
+++ b/src/frontend/mame/ui/inputmap.h
@@ -8,11 +8,11 @@
***************************************************************************/
-#pragma once
-
#ifndef MAME_FRONTEND_UI_INPUTMAP_H
#define MAME_FRONTEND_UI_INPUTMAP_H
+#pragma once
+
#include "ui/menu.h"
@@ -24,7 +24,7 @@ public:
virtual ~menu_input_groups() override;
private:
- virtual void populate() override;
+ virtual void populate(float &customtop, float &custombottom) override;
virtual void handle() override;
};
@@ -83,7 +83,7 @@ public:
virtual ~menu_input_general() override;
private:
- virtual void populate() override;
+ virtual void populate(float &customtop, float &custombottom) override;
virtual void update_input(struct input_item_data *seqchangeditem) override;
int group;
@@ -96,7 +96,7 @@ public:
virtual ~menu_input_specific() override;
private:
- virtual void populate() override;
+ virtual void populate(float &customtop, float &custombottom) override;
virtual void update_input(struct input_item_data *seqchangeditem) override;
};
@@ -121,7 +121,7 @@ protected:
int type;
private:
- virtual void populate() override;
+ virtual void populate(float &customtop, float &custombottom) override;
virtual void handle() override;
};
@@ -169,7 +169,7 @@ private:
int defvalue;
};
- virtual void populate() override;
+ virtual void populate(float &customtop, float &custombottom) override;
virtual void handle() override;
};
diff --git a/src/frontend/mame/ui/mainmenu.cpp b/src/frontend/mame/ui/mainmenu.cpp
index 0b46e8fc2c7..bf796513e29 100644
--- a/src/frontend/mame/ui/mainmenu.cpp
+++ b/src/frontend/mame/ui/mainmenu.cpp
@@ -49,7 +49,7 @@ menu_main::menu_main(mame_ui_manager &mui, render_container &container) : menu(m
{
}
-void menu_main::populate()
+void menu_main::populate(float &customtop, float &custombottom)
{
/* add input menu items */
item_append(_("Input (general)"), "", 0, (void *)INPUT_GROUPS);
diff --git a/src/frontend/mame/ui/mainmenu.h b/src/frontend/mame/ui/mainmenu.h
index aab547e9d56..16ca2d1cde4 100644
--- a/src/frontend/mame/ui/mainmenu.h
+++ b/src/frontend/mame/ui/mainmenu.h
@@ -51,7 +51,7 @@ private:
QUIT_GAME
};
- virtual void populate() override;
+ virtual void populate(float &customtop, float &custombottom) override;
virtual void handle() override;
};
diff --git a/src/frontend/mame/ui/menu.cpp b/src/frontend/mame/ui/menu.cpp
index bac0b8a1c10..6c8e3c9f720 100644
--- a/src/frontend/mame/ui/menu.cpp
+++ b/src/frontend/mame/ui/menu.cpp
@@ -233,6 +233,8 @@ menu::menu(mame_ui_manager &mui, render_container &container)
, m_parent()
, m_event()
, m_pool(nullptr)
+ , m_customtop(0.0f)
+ , m_custombottom(0.0f)
, m_resetpos(0)
, m_resetref(nullptr)
{
@@ -400,6 +402,17 @@ void menu::item_append(std::string &&text, std::string &&subtext, uint32_t flags
//-------------------------------------------------
+// repopulate - repopulate menu items
+//-------------------------------------------------
+
+void menu::repopulate(reset_options options)
+{
+ reset(options);
+ populate(m_customtop, m_custombottom);
+}
+
+
+//-------------------------------------------------
// process - process a menu, drawing it
// and returning any interesting events
//-------------------------------------------------
@@ -541,7 +554,7 @@ void menu::draw(uint32_t flags)
}
// account for extra space at the top and bottom
- float const visible_extra_menu_height = customtop + custombottom;
+ float const visible_extra_menu_height = m_customtop + m_custombottom;
// add a little bit of slop for rounding
visible_width += 0.01f;
@@ -560,7 +573,7 @@ void menu::draw(uint32_t flags)
// compute top/left of inner menu area by centering
float const visible_left = (1.0f - visible_width) * 0.5f;
- float const visible_top = ((1.0f - visible_main_menu_height - visible_extra_menu_height) * 0.5f) + customtop;
+ float const visible_top = ((1.0f - visible_main_menu_height - visible_extra_menu_height) * 0.5f) + m_customtop;
// first add us a box
float const x1 = visible_left - UI_BOX_LR_BORDER;
@@ -776,7 +789,7 @@ void menu::draw(uint32_t flags)
}
// if there is something special to add, do it by calling the virtual method
- custom_render(get_selection_ref(), customtop, custombottom, x1, y1, x2, y2);
+ custom_render(get_selection_ref(), m_customtop, m_custombottom, x1, y1, x2, y2);
}
void menu::custom_render(void *selectedref, float top, float bottom, float x, float y, float x2, float y2)
@@ -1135,7 +1148,7 @@ void menu::validate_selection(int scandir)
void menu::do_handle()
{
if (item.size() < 2)
- populate();
+ populate(m_customtop, m_custombottom);
handle();
}
diff --git a/src/frontend/mame/ui/menu.h b/src/frontend/mame/ui/menu.h
index 554a70fddd2..c3ef414d449 100644
--- a/src/frontend/mame/ui/menu.h
+++ b/src/frontend/mame/ui/menu.h
@@ -51,8 +51,6 @@ public:
virtual ~menu();
int hover; // which item is being hovered over
- float customtop; // amount of extra height to add at the top
- float custombottom; // amount of extra height to add at the bottom
std::vector<menu_item> item; // array of items
// append a new item to the end of the menu
@@ -136,7 +134,7 @@ protected:
void *itemref; // reference for the selected item
menu_item_type type; // item type (eventually will go away when itemref is proper ui_menu_item class rather than void*)
int iptkey; // one of the IPT_* values from inptport.h
- char32_t unichar; // unicode character if iptkey == IPT_SPECIAL
+ char32_t unichar; // unicode character if iptkey == IPT_SPECIAL
render_bounds mouse; // mouse position if iptkey == IPT_CUSTOM
};
@@ -170,6 +168,9 @@ protected:
void add_cleanup_callback(cleanup_callback &&callback) { m_global_state->add_cleanup_callback(std::move(callback)); }
+ // repopulate the menu items
+ void repopulate(reset_options options);
+
// process a menu, drawing it and returning any interesting events
const event *process(uint32_t flags, float x0 = 0.0f, float y0 = 0.0f);
void process_parent() { m_parent->process(PROCESS_NOINPUT); }
@@ -189,6 +190,10 @@ protected:
// test if the given key is pressed and we haven't already reported a key
bool exclusive_input_pressed(int &iptkey, int key, int repeat);
+ // layout
+ float get_customtop() const { return m_customtop; }
+ float get_custombottom() const { return m_custombottom; }
+
// highlight
void highlight(float x0, float y0, float x1, float y1, rgb_t bgcolor);
render_texture *hilight_main_texture() { return m_global_state->hilight_main_texture(); }
@@ -226,8 +231,6 @@ protected:
return ((actual > min) ? FLAG_LEFT_ARROW : 0) | ((actual < max) ? FLAG_RIGHT_ARROW : 0);
}
- int right_visible_lines; // right box lines
-
private:
class global_state : public widgets_manager
{
@@ -270,9 +273,9 @@ private:
struct pool
{
- pool *next; // chain to next one
- uint8_t *top; // top of the pool
- uint8_t *end; // end of the pool
+ pool *next; // chain to next one
+ uint8_t *top; // top of the pool
+ uint8_t *end; // end of the pool
};
// request the specific handling of the game selection main menu
@@ -280,7 +283,7 @@ private:
void set_special_main_menu(bool disable);
// To be reimplemented in the menu subclass
- virtual void populate() = 0;
+ virtual void populate(float &customtop, float &custombottom) = 0;
// To be reimplemented in the menu subclass
virtual void handle() = 0;
@@ -304,6 +307,9 @@ private:
event m_event; // the UI event that occurred
pool *m_pool; // list of memory pools
+ float m_customtop; // amount of extra height to add at the top
+ float m_custombottom; // amount of extra height to add at the bottom
+
int m_resetpos; // reset position
void *m_resetref; // reset reference
diff --git a/src/frontend/mame/ui/miscmenu.cpp b/src/frontend/mame/ui/miscmenu.cpp
index e991b4a8f06..25f57a61898 100644
--- a/src/frontend/mame/ui/miscmenu.cpp
+++ b/src/frontend/mame/ui/miscmenu.cpp
@@ -37,7 +37,7 @@ menu_keyboard_mode::menu_keyboard_mode(mame_ui_manager &mui, render_container &c
{
}
-void menu_keyboard_mode::populate()
+void menu_keyboard_mode::populate(float &customtop, float &custombottom)
{
bool natural = machine().ioport().natkeyboard().in_use();
item_append(_("Keyboard Mode:"), natural ? _("Natural") : _("Emulated"), natural ? FLAG_LEFT_ARROW : FLAG_RIGHT_ARROW, nullptr);
@@ -74,7 +74,7 @@ menu_bios_selection::menu_bios_selection(mame_ui_manager &mui, render_container
{
}
-void menu_bios_selection::populate()
+void menu_bios_selection::populate(float &customtop, float &custombottom)
{
/* cycle through all devices for this system */
for (device_t &device : device_iterator(machine().root_device()))
@@ -156,7 +156,7 @@ menu_network_devices::~menu_network_devices()
network device menu
-------------------------------------------------*/
-void menu_network_devices::populate()
+void menu_network_devices::populate(float &customtop, float &custombottom)
{
/* cycle through all devices for this system */
for (device_network_interface &network : network_interface_iterator(machine().root_device()))
@@ -211,9 +211,8 @@ void menu_bookkeeping::handle()
curtime = machine().time();
if (prevtime.seconds() != curtime.seconds())
{
- reset(reset_options::SELECT_FIRST);
prevtime = curtime;
- populate();
+ repopulate(reset_options::SELECT_FIRST);
}
/* process the menu */
@@ -233,7 +232,7 @@ menu_bookkeeping::~menu_bookkeeping()
{
}
-void menu_bookkeeping::populate()
+void menu_bookkeeping::populate(float &customtop, float &custombottom)
{
int tickets = machine().bookkeeping().get_dispensed_tickets();
std::ostringstream tempstring;
@@ -375,7 +374,7 @@ menu_crosshair::menu_crosshair(mame_ui_manager &mui, render_container &container
{
}
-void menu_crosshair::populate()
+void menu_crosshair::populate(float &customtop, float &custombottom)
{
crosshair_item_data *data;
char temp_text[16];
@@ -532,7 +531,7 @@ menu_quit_game::~menu_quit_game()
{
}
-void menu_quit_game::populate()
+void menu_quit_game::populate(float &customtop, float &custombottom)
{
}
@@ -662,7 +661,7 @@ void menu_export::handle()
// populate
//-------------------------------------------------
-void menu_export::populate()
+void menu_export::populate(float &customtop, float &custombottom)
{
// add options items
item_append(_("Export list in XML format (like -listxml)"), "", 0, (void *)(uintptr_t)1);
@@ -769,7 +768,7 @@ void menu_machine_configure::handle()
// populate
//-------------------------------------------------
-void menu_machine_configure::populate()
+void menu_machine_configure::populate(float &customtop, float &custombottom)
{
// add options items
item_append(_("Bios"), "", FLAG_DISABLE | FLAG_UI_HEADING, nullptr);
@@ -934,7 +933,7 @@ void menu_plugins_configure::handle()
// populate
//-------------------------------------------------
-void menu_plugins_configure::populate()
+void menu_plugins_configure::populate(float &customtop, float &custombottom)
{
plugin_options& plugins = mame_machine_manager::instance()->plugins();
diff --git a/src/frontend/mame/ui/miscmenu.h b/src/frontend/mame/ui/miscmenu.h
index 11909f099f5..e96a7a2db97 100644
--- a/src/frontend/mame/ui/miscmenu.h
+++ b/src/frontend/mame/ui/miscmenu.h
@@ -8,11 +8,11 @@
***************************************************************************/
-#pragma once
-
#ifndef MAME_FRONTEND_UI_MISCMENU_H
#define MAME_FRONTEND_UI_MISCMENU_H
+#pragma once
+
#include "crsshair.h"
#include "emuopts.h"
@@ -28,7 +28,7 @@ public:
virtual ~menu_keyboard_mode();
private:
- virtual void populate() override;
+ virtual void populate(float &customtop, float &custombottom) override;
virtual void handle() override;
};
@@ -39,7 +39,7 @@ public:
virtual ~menu_network_devices();
private:
- virtual void populate() override;
+ virtual void populate(float &customtop, float &custombottom) override;
virtual void handle() override;
};
@@ -50,7 +50,7 @@ public:
virtual ~menu_bookkeeping();
private:
- virtual void populate() override;
+ virtual void populate(float &customtop, float &custombottom) override;
virtual void handle() override;
attotime prevtime;
@@ -84,7 +84,7 @@ private:
char next_name[CROSSHAIR_PIC_NAME_LENGTH + 1];
};
- virtual void populate() override;
+ virtual void populate(float &customtop, float &custombottom) override;
virtual void handle() override;
};
@@ -95,7 +95,7 @@ public:
virtual ~menu_quit_game();
private:
- virtual void populate() override;
+ virtual void populate(float &customtop, float &custombottom) override;
virtual void handle() override;
};
@@ -106,7 +106,7 @@ public:
virtual ~menu_bios_selection();
private:
- virtual void populate() override;
+ virtual void populate(float &customtop, float &custombottom) override;
virtual void handle() override;
};
@@ -122,7 +122,7 @@ public:
virtual ~menu_export();
private:
- virtual void populate() override;
+ virtual void populate(float &customtop, float &custombottom) override;
virtual void handle() override;
std::vector<const game_driver*> m_list;
@@ -156,7 +156,7 @@ private:
LAST = ADVANCED
};
- virtual void populate() override;
+ virtual void populate(float &customtop, float &custombottom) override;
virtual void handle() override;
const game_driver *m_drv;
@@ -179,7 +179,7 @@ public:
virtual ~menu_plugins_configure();
protected:
- virtual void populate() override;
+ virtual void populate(float &customtop, float &custombottom) override;
virtual void handle() override;
virtual void custom_render(void *selectedref, float top, float bottom, float x, float y, float x2, float y2) override;
diff --git a/src/frontend/mame/ui/optsmenu.cpp b/src/frontend/mame/ui/optsmenu.cpp
index bb29179d3e7..00a27353965 100644
--- a/src/frontend/mame/ui/optsmenu.cpp
+++ b/src/frontend/mame/ui/optsmenu.cpp
@@ -220,7 +220,7 @@ void menu_game_options::handle()
// populate
//-------------------------------------------------
-void menu_game_options::populate()
+void menu_game_options::populate(float &customtop, float &custombottom)
{
if (machine().options().ui() != emu_options::UI_SIMPLE)
{
diff --git a/src/frontend/mame/ui/optsmenu.h b/src/frontend/mame/ui/optsmenu.h
index 96e951da6e4..769d0aa9ecf 100644
--- a/src/frontend/mame/ui/optsmenu.h
+++ b/src/frontend/mame/ui/optsmenu.h
@@ -46,7 +46,7 @@ private:
SAVE_CONFIG
};
- virtual void populate() override;
+ virtual void populate(float &customtop, float &custombottom) override;
virtual void handle() override;
uint16_t m_main;
diff --git a/src/frontend/mame/ui/pluginopt.cpp b/src/frontend/mame/ui/pluginopt.cpp
index 11884b6be40..a2be9d5f530 100644
--- a/src/frontend/mame/ui/pluginopt.cpp
+++ b/src/frontend/mame/ui/pluginopt.cpp
@@ -34,7 +34,7 @@ menu_plugin::menu_plugin(mame_ui_manager &mui, render_container &container) :
{
}
-void menu_plugin::populate()
+void menu_plugin::populate(float &customtop, float &custombottom)
{
for (auto &curplugin : m_plugins)
item_append(curplugin, "", 0, (void *)curplugin.c_str());
@@ -104,7 +104,7 @@ void menu_plugin_opt::handle()
}
}
-void menu_plugin_opt::populate()
+void menu_plugin_opt::populate(float &customtop, float &custombottom)
{
std::vector<std::tuple<std::string, std::string, std::string>> menu_list;
mame_machine_manager::instance()->lua()->menu_populate(m_menu, menu_list);
diff --git a/src/frontend/mame/ui/pluginopt.h b/src/frontend/mame/ui/pluginopt.h
index 2aac32a6ea6..8b7edd1e305 100644
--- a/src/frontend/mame/ui/pluginopt.h
+++ b/src/frontend/mame/ui/pluginopt.h
@@ -31,7 +31,7 @@ public:
virtual ~menu_plugin();
private:
- virtual void populate() override;
+ virtual void populate(float &customtop, float &custombottom) override;
virtual void handle() override;
std::vector<std::string> &m_plugins;
@@ -44,7 +44,7 @@ public:
virtual ~menu_plugin_opt();
private:
- virtual void populate() override;
+ virtual void populate(float &customtop, float &custombottom) override;
virtual void handle() override;
std::string m_menu;
diff --git a/src/frontend/mame/ui/selector.cpp b/src/frontend/mame/ui/selector.cpp
index f2944791dbd..83af27c4b72 100644
--- a/src/frontend/mame/ui/selector.cpp
+++ b/src/frontend/mame/ui/selector.cpp
@@ -116,7 +116,7 @@ void menu_selector::handle()
// populate
//-------------------------------------------------
-void menu_selector::populate()
+void menu_selector::populate(float &customtop, float &custombottom)
{
if (!m_search.empty())
{
diff --git a/src/frontend/mame/ui/selector.h b/src/frontend/mame/ui/selector.h
index 8b3d4cac8e8..e111d69551c 100644
--- a/src/frontend/mame/ui/selector.h
+++ b/src/frontend/mame/ui/selector.h
@@ -42,7 +42,7 @@ protected:
private:
enum { VISIBLE_GAMES_IN_SEARCH = 200 };
- virtual void populate() override;
+ virtual void populate(float &customtop, float &custombottom) override;
virtual void handle() override;
void find_matches(const char *str);
diff --git a/src/frontend/mame/ui/selgame.cpp b/src/frontend/mame/ui/selgame.cpp
index 9351c028a06..2b9a0e22a9b 100644
--- a/src/frontend/mame/ui/selgame.cpp
+++ b/src/frontend/mame/ui/selgame.cpp
@@ -493,7 +493,7 @@ void menu_select_game::handle()
// populate
//-------------------------------------------------
-void menu_select_game::populate()
+void menu_select_game::populate(float &customtop, float &custombottom)
{
ui_globals::redraw_icon = true;
ui_globals::switch_image = true;
diff --git a/src/frontend/mame/ui/selgame.h b/src/frontend/mame/ui/selgame.h
index 9455acb90cf..7c745ab1d8d 100644
--- a/src/frontend/mame/ui/selgame.h
+++ b/src/frontend/mame/ui/selgame.h
@@ -50,7 +50,7 @@ private:
const game_driver *m_searchlist[VISIBLE_GAMES_IN_SEARCH + 1];
- virtual void populate() override;
+ virtual void populate(float &customtop, float &custombottom) override;
virtual void handle() override;
// draw left panel
diff --git a/src/frontend/mame/ui/selmenu.cpp b/src/frontend/mame/ui/selmenu.cpp
index 3ac345ff324..74e3667694c 100644
--- a/src/frontend/mame/ui/selmenu.cpp
+++ b/src/frontend/mame/ui/selmenu.cpp
@@ -163,6 +163,7 @@ menu_select_launch::menu_select_launch(mame_ui_manager &mui, render_container &c
, m_focus(focused_menu::main)
, m_pressed(false)
, m_repeat(0)
+ , m_right_visible_lines(0)
{
// set up persistent cache for machine run
{
@@ -876,7 +877,7 @@ void menu_select_launch::handle_keys(uint32_t flags, int &iptkey)
if (!rightclose && m_focus == focused_menu::rightbottom)
{
iptkey = IPT_UI_DOWN_PANEL;
- m_topline_datsview -= right_visible_lines - 1;
+ m_topline_datsview -= m_right_visible_lines - 1;
return;
}
@@ -898,7 +899,7 @@ void menu_select_launch::handle_keys(uint32_t flags, int &iptkey)
if (!rightclose && m_focus == focused_menu::rightbottom)
{
iptkey = IPT_UI_DOWN_PANEL;
- m_topline_datsview += right_visible_lines - 1;
+ m_topline_datsview += m_right_visible_lines - 1;
return;
}
@@ -1041,9 +1042,9 @@ void menu_select_launch::handle_events(uint32_t flags, event &ev)
else if (hover == HOVER_UI_LEFT)
ev.iptkey = IPT_UI_LEFT;
else if (hover == HOVER_DAT_DOWN)
- m_topline_datsview += right_visible_lines - 1;
+ m_topline_datsview += m_right_visible_lines - 1;
else if (hover == HOVER_DAT_UP)
- m_topline_datsview -= right_visible_lines - 1;
+ m_topline_datsview -= m_right_visible_lines - 1;
else if (hover == HOVER_LPANEL_ARROW)
{
if (ui_globals::panels_status == HIDE_LEFT_PANEL)
@@ -1200,7 +1201,7 @@ void menu_select_launch::draw(uint32_t flags)
hover = item.size() + 1;
visible_items = (m_is_swlist) ? item.size() - 2 : item.size() - 2 - skip_main_items;
float extra_height = (m_is_swlist) ? 2.0f * line_height : (2.0f + skip_main_items) * line_height;
- float visible_extra_menu_height = customtop + custombottom + extra_height;
+ float visible_extra_menu_height = get_customtop() + get_custombottom() + extra_height;
// locate mouse
mouse_hit = false;
@@ -1228,7 +1229,7 @@ void menu_select_launch::draw(uint32_t flags)
float visible_top = (1.0f - (visible_main_menu_height + visible_extra_menu_height)) * 0.5f;
// if the menu is at the bottom of the extra, adjust
- visible_top += customtop;
+ visible_top += get_customtop();
// compute left box size
float x1 = visible_left - UI_BOX_LR_BORDER;
@@ -1408,7 +1409,7 @@ void menu_select_launch::draw(uint32_t flags)
x2 = primary_left + primary_width + UI_BOX_LR_BORDER;
// if there is something special to add, do it by calling the virtual method
- custom_render(get_selection_ref(), customtop, custombottom, x1, y1, x2, y2);
+ custom_render(get_selection_ref(), get_customtop(), get_custombottom(), x1, y1, x2, y2);
// return the number of visible lines, minus 1 for top arrow and 1 for bottom arrow
m_visible_items = m_visible_lines - (top_line != 0) - (top_line + m_visible_lines != visible_items);
@@ -2066,7 +2067,7 @@ void menu_select_launch::infos_render(float origx1, float origy1, float origx2,
oy1 += (line_height * text_size);
}
// return the number of visible lines, minus 1 for top arrow and 1 for bottom arrow
- right_visible_lines = r_visible_lines - (m_topline_datsview != 0) - (m_topline_datsview + r_visible_lines != m_total_lines);
+ m_right_visible_lines = r_visible_lines - (m_topline_datsview != 0) - (m_topline_datsview + r_visible_lines != m_total_lines);
}
} // namespace ui
diff --git a/src/frontend/mame/ui/selmenu.h b/src/frontend/mame/ui/selmenu.h
index 7741cc8b2d5..7878f12fd54 100644
--- a/src/frontend/mame/ui/selmenu.h
+++ b/src/frontend/mame/ui/selmenu.h
@@ -182,9 +182,12 @@ private:
cache_ptr m_cache;
bool m_is_swlist;
focused_menu m_focus;
- bool m_pressed; // mouse button held down
+ bool m_pressed; // mouse button held down
osd_ticks_t m_repeat;
+ int m_right_visible_lines; // right box lines
+
+
render_texture *m_icons_texture[MAX_ICONS_RENDER];
bitmap_ptr m_icons_bitmap[MAX_ICONS_RENDER];
game_driver const *m_old_icons[MAX_ICONS_RENDER];
diff --git a/src/frontend/mame/ui/selsoft.cpp b/src/frontend/mame/ui/selsoft.cpp
index 8a1768afae8..899605f04a0 100644
--- a/src/frontend/mame/ui/selsoft.cpp
+++ b/src/frontend/mame/ui/selsoft.cpp
@@ -417,7 +417,7 @@ void menu_select_software::handle()
// populate
//-------------------------------------------------
-void menu_select_software::populate()
+void menu_select_software::populate(float &customtop, float &custombottom)
{
uint32_t flags_ui = FLAG_LEFT_ARROW | FLAG_RIGHT_ARROW;
m_has_empty_start = true;
@@ -1265,7 +1265,7 @@ software_parts::~software_parts()
// populate
//-------------------------------------------------
-void software_parts::populate()
+void software_parts::populate(float &customtop, float &custombottom)
{
for (auto & elem : m_parts)
item_append(elem.first, elem.second, 0, (void *)&elem);
@@ -1363,7 +1363,7 @@ bios_selection::~bios_selection()
// populate
//-------------------------------------------------
-void bios_selection::populate()
+void bios_selection::populate(float &customtop, float &custombottom)
{
for (auto & elem : m_bios)
item_append(elem.first, "", 0, (void *)&elem.first);
diff --git a/src/frontend/mame/ui/selsoft.h b/src/frontend/mame/ui/selsoft.h
index 7eb6597279e..48a452b5c68 100644
--- a/src/frontend/mame/ui/selsoft.h
+++ b/src/frontend/mame/ui/selsoft.h
@@ -7,11 +7,11 @@
UI software menu.
***************************************************************************/
-#pragma once
-
#ifndef MAME_FRONTEND_UI_SELSOFT_H
#define MAME_FRONTEND_UI_SELSOFT_H
+#pragma once
+
#include "ui/custmenu.h"
#include "ui/selmenu.h"
@@ -37,7 +37,7 @@ private:
s_filter m_filter;
int highlight;
- virtual void populate() override;
+ virtual void populate(float &customtop, float &custombottom) override;
virtual void handle() override;
// draw left panel
@@ -78,7 +78,7 @@ protected:
virtual void custom_render(void *selectedref, float top, float bottom, float x, float y, float x2, float y2) override;
private:
- virtual void populate() override;
+ virtual void populate(float &customtop, float &custombottom) override;
virtual void handle() override;
ui_software_info *m_uiinfo;
@@ -95,7 +95,7 @@ protected:
virtual void custom_render(void *selectedref, float top, float bottom, float x, float y, float x2, float y2) override;
private:
- virtual void populate() override;
+ virtual void populate(float &customtop, float &custombottom) override;
virtual void handle() override;
void *m_driver;
diff --git a/src/frontend/mame/ui/simpleselgame.cpp b/src/frontend/mame/ui/simpleselgame.cpp
index 1630c35c8f7..bfa8b91b205 100644
--- a/src/frontend/mame/ui/simpleselgame.cpp
+++ b/src/frontend/mame/ui/simpleselgame.cpp
@@ -214,7 +214,7 @@ void simple_menu_select_game::inkey_special(const event *menu_event)
// populate - populate the game select menu
//-------------------------------------------------
-void simple_menu_select_game::populate()
+void simple_menu_select_game::populate(float &customtop, float &custombottom)
{
int matchcount;
int curitem;
diff --git a/src/frontend/mame/ui/simpleselgame.h b/src/frontend/mame/ui/simpleselgame.h
index a368e61b40e..a520165c340 100644
--- a/src/frontend/mame/ui/simpleselgame.h
+++ b/src/frontend/mame/ui/simpleselgame.h
@@ -8,11 +8,11 @@
***************************************************************************/
-#pragma once
-
#ifndef MAME_FRONTEND_UI_SIMPLESELGAME_H
#define MAME_FRONTEND_UI_SIMPLESELGAME_H
+#pragma once
+
#include "menu.h"
class driver_enumerator;
@@ -33,7 +33,7 @@ protected:
private:
enum { VISIBLE_GAMES_IN_LIST = 15 };
- virtual void populate() override;
+ virtual void populate(float &customtop, float &custombottom) override;
virtual void handle() override;
// internal methods
diff --git a/src/frontend/mame/ui/sliders.cpp b/src/frontend/mame/ui/sliders.cpp
index 00a51944680..8631fc47971 100644
--- a/src/frontend/mame/ui/sliders.cpp
+++ b/src/frontend/mame/ui/sliders.cpp
@@ -135,7 +135,7 @@ void menu_sliders::handle()
// menu
//-------------------------------------------------
-void menu_sliders::populate()
+void menu_sliders::populate(float &customtop, float &custombottom)
{
std::string tempstring;
diff --git a/src/frontend/mame/ui/sliders.h b/src/frontend/mame/ui/sliders.h
index 54b2af38f78..4ef399173e3 100644
--- a/src/frontend/mame/ui/sliders.h
+++ b/src/frontend/mame/ui/sliders.h
@@ -33,7 +33,7 @@ private:
INPUT_SPECIFIC,
};
- virtual void populate() override;
+ virtual void populate(float &customtop, float &custombottom) override;
virtual void handle() override;
bool m_menuless_mode;
diff --git a/src/frontend/mame/ui/slotopt.cpp b/src/frontend/mame/ui/slotopt.cpp
index 9c68410f2ef..3c0353160c6 100644
--- a/src/frontend/mame/ui/slotopt.cpp
+++ b/src/frontend/mame/ui/slotopt.cpp
@@ -151,7 +151,7 @@ menu_slot_devices::menu_slot_devices(mame_ui_manager &mui, render_container &con
{
}
-void menu_slot_devices::populate()
+void menu_slot_devices::populate(float &customtop, float &custombottom)
{
/* cycle through all devices for this system */
for (device_slot_interface &slot : slot_interface_iterator(machine().root_device()))
diff --git a/src/frontend/mame/ui/slotopt.h b/src/frontend/mame/ui/slotopt.h
index faca9fc236f..2ef1477d74a 100644
--- a/src/frontend/mame/ui/slotopt.h
+++ b/src/frontend/mame/ui/slotopt.h
@@ -24,7 +24,7 @@ public:
virtual ~menu_slot_devices() override;
private:
- virtual void populate() override;
+ virtual void populate(float &customtop, float &custombottom) override;
virtual void handle() override;
device_slot_option *slot_get_current_option(device_slot_interface &slot);
diff --git a/src/frontend/mame/ui/sndmenu.cpp b/src/frontend/mame/ui/sndmenu.cpp
index 28fcc7909a4..0a0d1c019ed 100644
--- a/src/frontend/mame/ui/sndmenu.cpp
+++ b/src/frontend/mame/ui/sndmenu.cpp
@@ -124,7 +124,7 @@ void menu_sound_options::handle()
// populate
//-------------------------------------------------
-void menu_sound_options::populate()
+void menu_sound_options::populate(float &customtop, float &custombottom)
{
uint32_t arrow_flags = get_arrow_flags(uint16_t(0), uint16_t(ARRAY_LENGTH(m_sound_rate) - 1), m_cur_rates);
m_sample_rate = m_sound_rate[m_cur_rates];
diff --git a/src/frontend/mame/ui/sndmenu.h b/src/frontend/mame/ui/sndmenu.h
index 8cb78d47650..4cecc5dc165 100644
--- a/src/frontend/mame/ui/sndmenu.h
+++ b/src/frontend/mame/ui/sndmenu.h
@@ -8,11 +8,11 @@
***************************************************************************/
-#pragma once
-
#ifndef MAME_FRONTEND_UI_SNDMENU_H
#define MAME_FRONTEND_UI_SNDMENU_H
+#pragma once
+
#include "ui/menu.h"
namespace ui {
@@ -36,10 +36,10 @@ private:
ENABLE_SAMPLES
};
- virtual void populate() override;
+ virtual void populate(float &customtop, float &custombottom) override;
virtual void handle() override;
- uint16_t m_cur_rates;
+ uint16_t m_cur_rates;
static const int m_sound_rate[];
int m_sample_rate;
bool m_samples, m_sound;
diff --git a/src/frontend/mame/ui/submenu.cpp b/src/frontend/mame/ui/submenu.cpp
index d54724997fe..5a8cb83cd8b 100644
--- a/src/frontend/mame/ui/submenu.cpp
+++ b/src/frontend/mame/ui/submenu.cpp
@@ -313,13 +313,13 @@ void submenu::handle()
// populate
//-------------------------------------------------
-void submenu::populate()
+void submenu::populate(float &customtop, float &custombottom)
{
- uint32_t arrow_flags;
-
// add options
for (auto sm_option = m_options.begin(); sm_option < m_options.end(); ++sm_option)
{
+ uint32_t arrow_flags;
+
// skip first heading (is menu title)
if (sm_option == m_options.begin() && sm_option->type == option_type::HEAD) continue;
diff --git a/src/frontend/mame/ui/submenu.h b/src/frontend/mame/ui/submenu.h
index 475abde7018..acaf28d90e4 100644
--- a/src/frontend/mame/ui/submenu.h
+++ b/src/frontend/mame/ui/submenu.h
@@ -7,11 +7,11 @@
UI options menu.
***************************************************************************/
-#pragma once
-
#ifndef MAME_FRONTEND_UI_SUBMENU_H
#define MAME_FRONTEND_UI_SUBMENU_H
+#pragma once
+
#include "emuopts.h"
#include "ui/menu.h"
@@ -67,7 +67,7 @@ protected:
virtual void custom_render(void *selectedref, float top, float bottom, float x, float y, float x2, float y2) override;
private:
- virtual void populate() override;
+ virtual void populate(float &customtop, float &custombottom) override;
virtual void handle() override;
std::vector<option> m_options;
diff --git a/src/frontend/mame/ui/swlist.cpp b/src/frontend/mame/ui/swlist.cpp
index 2488c1d1cc4..c327980376f 100644
--- a/src/frontend/mame/ui/swlist.cpp
+++ b/src/frontend/mame/ui/swlist.cpp
@@ -70,7 +70,7 @@ menu_software_parts::~menu_software_parts()
// populate
//-------------------------------------------------
-void menu_software_parts::populate()
+void menu_software_parts::populate(float &customtop, float &custombottom)
{
if (m_other_opt)
{
@@ -212,7 +212,7 @@ void menu_software_list::append_software_entry(const software_info &swinfo)
// populate
//-------------------------------------------------
-void menu_software_list::populate()
+void menu_software_list::populate(float &customtop, float &custombottom)
{
// build up the list of entries for the menu
for (const software_info &swinfo : m_swlist->get_info())
@@ -342,7 +342,7 @@ menu_software::~menu_software()
// populate
//-------------------------------------------------
-void menu_software::populate()
+void menu_software::populate(float &customtop, float &custombottom)
{
bool have_compatible = false;
diff --git a/src/frontend/mame/ui/swlist.h b/src/frontend/mame/ui/swlist.h
index 77b2267f7da..d0239c2c389 100644
--- a/src/frontend/mame/ui/swlist.h
+++ b/src/frontend/mame/ui/swlist.h
@@ -38,7 +38,7 @@ private:
const software_part *part;
};
- virtual void populate() override;
+ virtual void populate(float &customtop, float &custombottom) override;
virtual void handle() override;
// variables
@@ -57,7 +57,7 @@ class menu_software_list : public menu
public:
menu_software_list(mame_ui_manager &mui, render_container &container, software_list_device *swlist, const char *interface, std::string &result);
virtual ~menu_software_list() override;
- virtual void populate() override;
+ virtual void populate(float &customtop, float &custombottom) override;
virtual void handle() override;
private:
@@ -94,7 +94,7 @@ class menu_software : public menu
public:
menu_software(mame_ui_manager &mui, render_container &container, const char *interface, software_list_device **result);
virtual ~menu_software() override;
- virtual void populate() override;
+ virtual void populate(float &customtop, float &custombottom) override;
virtual void handle() override;
private:
diff --git a/src/frontend/mame/ui/tapectrl.cpp b/src/frontend/mame/ui/tapectrl.cpp
index 57432ecd14e..0784ed72d26 100644
--- a/src/frontend/mame/ui/tapectrl.cpp
+++ b/src/frontend/mame/ui/tapectrl.cpp
@@ -54,7 +54,7 @@ menu_tape_control::~menu_tape_control()
// populate - populates the main tape control menu
//-------------------------------------------------
-void menu_tape_control::populate()
+void menu_tape_control::populate(float &customtop, float &custombottom)
{
if (current_device())
{
@@ -117,8 +117,7 @@ void menu_tape_control::populate()
void menu_tape_control::handle()
{
// rebuild the menu (so to update the selected device, if the user has pressed L or R, and the tape counter)
- reset(reset_options::REMEMBER_POSITION);
- populate();
+ repopulate(reset_options::REMEMBER_POSITION);
// process the menu
const event *event = process(PROCESS_LR_REPEAT);
@@ -126,34 +125,34 @@ void menu_tape_control::handle()
{
switch(event->iptkey)
{
- case IPT_UI_LEFT:
- if (event->itemref == TAPECMD_SLIDER)
- current_device()->seek(-1, SEEK_CUR);
- else if (event->itemref == TAPECMD_SELECT)
- previous();
- break;
-
- case IPT_UI_RIGHT:
- if (event->itemref == TAPECMD_SLIDER)
- current_device()->seek(+1, SEEK_CUR);
- else if (event->itemref == TAPECMD_SELECT)
- next();
- break;
-
- case IPT_UI_SELECT:
- if (event->itemref == TAPECMD_STOP)
- current_device()->change_state(CASSETTE_STOPPED, CASSETTE_MASK_UISTATE);
- else if (event->itemref == TAPECMD_PLAY)
- current_device()->change_state(CASSETTE_PLAY, CASSETTE_MASK_UISTATE);
- else if (event->itemref == TAPECMD_RECORD)
- current_device()->change_state(CASSETTE_RECORD, CASSETTE_MASK_UISTATE);
- else if (event->itemref == TAPECMD_REWIND)
- current_device()->seek(-30, SEEK_CUR);
- else if (event->itemref == TAPECMD_FAST_FORWARD)
- current_device()->seek(30, SEEK_CUR);
- else if (event->itemref == TAPECMD_SLIDER)
- current_device()->seek(0, SEEK_SET);
- break;
+ case IPT_UI_LEFT:
+ if (event->itemref == TAPECMD_SLIDER)
+ current_device()->seek(-1, SEEK_CUR);
+ else if (event->itemref == TAPECMD_SELECT)
+ previous();
+ break;
+
+ case IPT_UI_RIGHT:
+ if (event->itemref == TAPECMD_SLIDER)
+ current_device()->seek(+1, SEEK_CUR);
+ else if (event->itemref == TAPECMD_SELECT)
+ next();
+ break;
+
+ case IPT_UI_SELECT:
+ if (event->itemref == TAPECMD_STOP)
+ current_device()->change_state(CASSETTE_STOPPED, CASSETTE_MASK_UISTATE);
+ else if (event->itemref == TAPECMD_PLAY)
+ current_device()->change_state(CASSETTE_PLAY, CASSETTE_MASK_UISTATE);
+ else if (event->itemref == TAPECMD_RECORD)
+ current_device()->change_state(CASSETTE_RECORD, CASSETTE_MASK_UISTATE);
+ else if (event->itemref == TAPECMD_REWIND)
+ current_device()->seek(-30, SEEK_CUR);
+ else if (event->itemref == TAPECMD_FAST_FORWARD)
+ current_device()->seek(30, SEEK_CUR);
+ else if (event->itemref == TAPECMD_SLIDER)
+ current_device()->seek(0, SEEK_SET);
+ break;
}
}
}
diff --git a/src/frontend/mame/ui/tapectrl.h b/src/frontend/mame/ui/tapectrl.h
index 460503df705..11ac3bbfc7d 100644
--- a/src/frontend/mame/ui/tapectrl.h
+++ b/src/frontend/mame/ui/tapectrl.h
@@ -24,7 +24,7 @@ public:
virtual ~menu_tape_control() override;
private:
- virtual void populate() override;
+ virtual void populate(float &customtop, float &custombottom) override;
virtual void handle() override;
static void get_time_string(std::string &dest, cassette_image_device *cassette, int *curpos, int *endpos);
diff --git a/src/frontend/mame/ui/videoopt.cpp b/src/frontend/mame/ui/videoopt.cpp
index 3d3aaf69e26..7ee243ec4e2 100644
--- a/src/frontend/mame/ui/videoopt.cpp
+++ b/src/frontend/mame/ui/videoopt.cpp
@@ -38,7 +38,7 @@ menu_video_targets::menu_video_targets(mame_ui_manager &mui, render_container &c
{
}
-void menu_video_targets::populate()
+void menu_video_targets::populate(float &customtop, float &custombottom)
{
int targetnum;
@@ -170,7 +170,7 @@ menu_video_options::menu_video_options(mame_ui_manager &mui, render_container &c
target = _target;
}
-void menu_video_options::populate()
+void menu_video_options::populate(float &customtop, float &custombottom)
{
const char *subtext = "";
std::string tempstring;
diff --git a/src/frontend/mame/ui/videoopt.h b/src/frontend/mame/ui/videoopt.h
index 3a66f502ca2..d920fe55837 100644
--- a/src/frontend/mame/ui/videoopt.h
+++ b/src/frontend/mame/ui/videoopt.h
@@ -23,7 +23,7 @@ public:
virtual ~menu_video_targets() override;
private:
- virtual void populate() override;
+ virtual void populate(float &customtop, float &custombottom) override;
virtual void handle() override;
};
@@ -45,7 +45,7 @@ private:
VIDEO_ITEM_VIEW
};
- virtual void populate() override;
+ virtual void populate(float &customtop, float &custombottom) override;
virtual void handle() override;
render_target *target;