summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/ui/custmenu.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/emu/ui/custmenu.cpp')
-rw-r--r--src/emu/ui/custmenu.cpp59
1 files changed, 29 insertions, 30 deletions
diff --git a/src/emu/ui/custmenu.cpp b/src/emu/ui/custmenu.cpp
index 3a50f4bfc03..2d6083536db 100644
--- a/src/emu/ui/custmenu.cpp
+++ b/src/emu/ui/custmenu.cpp
@@ -1,4 +1,4 @@
-// license:BSD-3-Clause
+// license:BSD-3-Clause
// copyright-holders:Dankan1890
/*********************************************************************
@@ -171,7 +171,7 @@ void ui_menu_custom_filter::populate()
if (custfltr::other[x] == FILTER_MANUFACTURER && c_mnfct::ui.size() > 0)
{
arrow_flags = get_arrow_flags(0, c_mnfct::ui.size() - 1, custfltr::mnfct[x]);
- std::string fbuff("^!Manufacturer");
+ std::string fbuff(_("^!Manufacturer"));
convert_command_glyph(fbuff);
item_append(fbuff.c_str(), c_mnfct::ui[custfltr::mnfct[x]].c_str(), arrow_flags, (void *)(FPTR)(MNFCT_FILTER + x));
}
@@ -180,7 +180,7 @@ void ui_menu_custom_filter::populate()
else if (custfltr::other[x] == FILTER_YEAR && c_year::ui.size() > 0)
{
arrow_flags = get_arrow_flags(0, c_year::ui.size() - 1, custfltr::year[x]);
- std::string fbuff("^!Year");
+ std::string fbuff(_("^!Year"));
convert_command_glyph(fbuff);
item_append(fbuff.c_str(), c_year::ui[custfltr::year[x]].c_str(), arrow_flags, (void *)(FPTR)(YEAR_FILTER + x));
}
@@ -208,7 +208,7 @@ void ui_menu_custom_filter::custom_render(void *selectedref, float top, float bo
// get the size of the text
mui.draw_text_full(container, _("Select custom filters:"), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_NEVER,
- DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr);
+ DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr);
width += (2.0f * UI_BOX_LR_BORDER) + 0.01f;
float maxwidth = MAX(width, origx2 - origx1);
@@ -228,7 +228,7 @@ void ui_menu_custom_filter::custom_render(void *selectedref, float top, float bo
// draw the text within it
mui.draw_text_full(container, _("Select custom filters:"), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_NEVER,
- DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
+ DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
}
//-------------------------------------------------
@@ -242,19 +242,19 @@ void ui_menu_custom_filter::save_custom_filters()
if (file.open("custom_", emulator_info::get_configname(), "_filter.ini") == FILERR_NONE)
{
// generate custom filters info
- std::string cinfo;
- strprintf(cinfo, "Total filters = %d\n", (custfltr::numother + 1));
- cinfo.append("Main filter = ").append(main_filters::text[custfltr::main]).append("\n");
+ std::ostringstream cinfo;
+ util::stream_format(cinfo, "Total filters = %d\n", (custfltr::numother + 1));
+ util::stream_format(cinfo, "Main filter = %s\n", main_filters::text[custfltr::main]);
for (int x = 1; x <= custfltr::numother; x++)
{
- cinfo.append("Other filter = ").append(main_filters::text[custfltr::other[x]]).append("\n");
+ util::stream_format(cinfo, "Other filter = %s\n", main_filters::text[custfltr::other[x]]);
if (custfltr::other[x] == FILTER_MANUFACTURER)
- cinfo.append(" Manufacturer filter = ").append(c_mnfct::ui[custfltr::mnfct[x]]).append("\n");
+ util::stream_format(cinfo, " Manufacturer filter = %s\n", c_mnfct::ui[custfltr::mnfct[x]]);
else if (custfltr::other[x] == FILTER_YEAR)
- cinfo.append(" Year filter = ").append(c_year::ui[custfltr::year[x]]).append("\n");
+ util::stream_format(cinfo, " Year filter = %s\n", c_year::ui[custfltr::year[x]]);
}
- file.puts(cinfo.c_str());
+ file.puts(cinfo.str().c_str());
file.close();
}
}
@@ -456,7 +456,7 @@ void ui_menu_swcustom_filter::populate()
if (sw_custfltr::other[x] == UI_SW_PUBLISHERS && m_filter.publisher.ui.size() > 0)
{
arrow_flags = get_arrow_flags(0, m_filter.publisher.ui.size() - 1, sw_custfltr::mnfct[x]);
- std::string fbuff("^!Publisher");
+ std::string fbuff(_("^!Publisher"));
convert_command_glyph(fbuff);
item_append(fbuff.c_str(), m_filter.publisher.ui[sw_custfltr::mnfct[x]].c_str(), arrow_flags, (void *)(FPTR)(MNFCT_FILTER + x));
}
@@ -465,7 +465,7 @@ void ui_menu_swcustom_filter::populate()
else if (sw_custfltr::other[x] == UI_SW_YEARS && m_filter.year.ui.size() > 0)
{
arrow_flags = get_arrow_flags(0, m_filter.year.ui.size() - 1, sw_custfltr::year[x]);
- std::string fbuff("^!Year");
+ std::string fbuff(_("^!Year"));
convert_command_glyph(fbuff);
item_append(fbuff.c_str(), m_filter.year.ui[sw_custfltr::year[x]].c_str(), arrow_flags, (void *)(FPTR)(YEAR_FILTER + x));
}
@@ -474,7 +474,7 @@ void ui_menu_swcustom_filter::populate()
else if (sw_custfltr::other[x] == UI_SW_LIST && m_filter.swlist.name.size() > 0)
{
arrow_flags = get_arrow_flags(0, m_filter.swlist.name.size() - 1, sw_custfltr::list[x]);
- std::string fbuff("^!Software List");
+ std::string fbuff(_("^!Software List"));
convert_command_glyph(fbuff);
item_append(fbuff.c_str(), m_filter.swlist.description[sw_custfltr::list[x]].c_str(), arrow_flags, (void *)(FPTR)(LIST_FILTER + x));
}
@@ -483,7 +483,7 @@ void ui_menu_swcustom_filter::populate()
else if (sw_custfltr::other[x] == UI_SW_TYPE && m_filter.type.ui.size() > 0)
{
arrow_flags = get_arrow_flags(0, m_filter.type.ui.size() - 1, sw_custfltr::type[x]);
- std::string fbuff("^!Device type");
+ std::string fbuff(_("^!Device type"));
convert_command_glyph(fbuff);
item_append(fbuff.c_str(), m_filter.type.ui[sw_custfltr::type[x]].c_str(), arrow_flags, (void *)(FPTR)(TYPE_FILTER + x));
}
@@ -492,7 +492,7 @@ void ui_menu_swcustom_filter::populate()
else if (sw_custfltr::other[x] == UI_SW_REGION && m_filter.region.ui.size() > 0)
{
arrow_flags = get_arrow_flags(0, m_filter.region.ui.size() - 1, sw_custfltr::region[x]);
- std::string fbuff("^!Region");
+ std::string fbuff(_("^!Region"));
convert_command_glyph(fbuff);
item_append(fbuff.c_str(), m_filter.region.ui[sw_custfltr::region[x]].c_str(), arrow_flags, (void *)(FPTR)(REGION_FILTER + x));
}
@@ -521,7 +521,7 @@ void ui_menu_swcustom_filter::custom_render(void *selectedref, float top, float
// get the size of the text
mui.draw_text_full(container, _("Select custom filters:"), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_NEVER,
- DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr);
+ DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr);
width += (2.0f * UI_BOX_LR_BORDER) + 0.01f;
float maxwidth = MAX(width, origx2 - origx1);
@@ -541,7 +541,7 @@ void ui_menu_swcustom_filter::custom_render(void *selectedref, float top, float
// draw the text within it
mui.draw_text_full(container, _("Select custom filters:"), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_NEVER,
- DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
+ DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
}
//-------------------------------------------------
@@ -555,26 +555,25 @@ void ui_menu_swcustom_filter::save_sw_custom_filters()
if (file.open("custom_", m_driver->name, "_filter.ini") == FILERR_NONE)
{
// generate custom filters info
- std::string cinfo;
- strprintf(cinfo, "Total filters = %d\n", (sw_custfltr::numother + 1));
- cinfo.append("Main filter = ").append(sw_filters::text[sw_custfltr::main]).append("\n");
+ std::ostringstream cinfo;
+ util::stream_format(cinfo, "Total filters = %d\n", (sw_custfltr::numother + 1));
+ util::stream_format(cinfo, "Main filter = %s\n", sw_filters::text[sw_custfltr::main]);
for (int x = 1; x <= sw_custfltr::numother; x++)
{
- cinfo.append("Other filter = ").append(sw_filters::text[sw_custfltr::other[x]]).append("\n");
+ util::stream_format(cinfo, "Other filter = %s\n", sw_filters::text[sw_custfltr::other[x]]);
if (sw_custfltr::other[x] == UI_SW_PUBLISHERS)
- cinfo.append(" Manufacturer filter = ").append(m_filter.publisher.ui[sw_custfltr::mnfct[x]]).append("\n");
+ util::stream_format(cinfo, " Manufacturer filter = %s\n", m_filter.publisher.ui[sw_custfltr::mnfct[x]]);
else if (sw_custfltr::other[x] == UI_SW_LIST)
- cinfo.append(" Software List filter = ").append(m_filter.swlist.name[sw_custfltr::list[x]]).append("\n");
+ util::stream_format(cinfo, " Software List filter = %s\n", m_filter.swlist.name[sw_custfltr::list[x]]);
else if (sw_custfltr::other[x] == UI_SW_YEARS)
- cinfo.append(" Year filter = ").append(m_filter.year.ui[sw_custfltr::year[x]]).append("\n");
+ util::stream_format(cinfo, " Year filter = %s\n", m_filter.year.ui[sw_custfltr::year[x]]);
else if (sw_custfltr::other[x] == UI_SW_TYPE)
- cinfo.append(" Type filter = ").append(m_filter.type.ui[sw_custfltr::type[x]]).append("\n");
+ util::stream_format(cinfo, " Type filter = %s\n", m_filter.type.ui[sw_custfltr::type[x]]);
else if (sw_custfltr::other[x] == UI_SW_REGION)
- cinfo.append(" Region filter = ").append(m_filter.region.ui[sw_custfltr::region[x]]).append("\n");
+ util::stream_format(cinfo, " Region filter = %s\n", m_filter.region.ui[sw_custfltr::region[x]]);
}
- file.puts(cinfo.c_str());
+ file.puts(cinfo.str().c_str());
file.close();
}
}
-