mirror of
https://github.com/holub/mame
synced 2025-04-19 23:12:11 +03:00
Merge pull request #1017 from npwoods/filesel_and_other_cleanups
Filesel and other cleanups
This commit is contained in:
commit
91229d5976
@ -57,7 +57,7 @@ void menu_barcode_reader::populate()
|
||||
const char *new_barcode;
|
||||
|
||||
// selected device
|
||||
item_append(current_display_name().c_str(), "", current_display_flags(), ITEMREF_SELECT_READER);
|
||||
item_append(current_display_name(), "", current_display_flags(), ITEMREF_SELECT_READER);
|
||||
|
||||
// append the "New Barcode" item
|
||||
if (get_selection() == ITEMREF_NEW_BARCODE)
|
||||
|
@ -176,7 +176,7 @@ void menu_custom_filter::populate()
|
||||
arrow_flags = get_arrow_flags(0, c_mnfct::ui.size() - 1, custfltr::mnfct[x]);
|
||||
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));
|
||||
item_append(fbuff, c_mnfct::ui[custfltr::mnfct[x]], arrow_flags, (void *)(FPTR)(MNFCT_FILTER + x));
|
||||
}
|
||||
|
||||
// add year subitem
|
||||
@ -185,7 +185,7 @@ void menu_custom_filter::populate()
|
||||
arrow_flags = get_arrow_flags(0, c_year::ui.size() - 1, custfltr::year[x]);
|
||||
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));
|
||||
item_append(fbuff, c_year::ui[custfltr::year[x]], arrow_flags, (void *)(FPTR)(YEAR_FILTER + x));
|
||||
}
|
||||
}
|
||||
|
||||
@ -463,7 +463,7 @@ void menu_swcustom_filter::populate()
|
||||
arrow_flags = get_arrow_flags(0, m_filter.publisher.ui.size() - 1, sw_custfltr::mnfct[x]);
|
||||
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));
|
||||
item_append(fbuff, m_filter.publisher.ui[sw_custfltr::mnfct[x]], arrow_flags, (void *)(FPTR)(MNFCT_FILTER + x));
|
||||
}
|
||||
|
||||
// add year subitem
|
||||
@ -472,7 +472,7 @@ void menu_swcustom_filter::populate()
|
||||
arrow_flags = get_arrow_flags(0, m_filter.year.ui.size() - 1, sw_custfltr::year[x]);
|
||||
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));
|
||||
item_append(fbuff, m_filter.year.ui[sw_custfltr::year[x]], arrow_flags, (void *)(FPTR)(YEAR_FILTER + x));
|
||||
}
|
||||
|
||||
// add year subitem
|
||||
@ -481,7 +481,7 @@ void menu_swcustom_filter::populate()
|
||||
arrow_flags = get_arrow_flags(0, m_filter.swlist.name.size() - 1, sw_custfltr::list[x]);
|
||||
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));
|
||||
item_append(fbuff, m_filter.swlist.description[sw_custfltr::list[x]], arrow_flags, (void *)(FPTR)(LIST_FILTER + x));
|
||||
}
|
||||
|
||||
// add device type subitem
|
||||
@ -490,7 +490,7 @@ void menu_swcustom_filter::populate()
|
||||
arrow_flags = get_arrow_flags(0, m_filter.type.ui.size() - 1, sw_custfltr::type[x]);
|
||||
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));
|
||||
item_append(fbuff, m_filter.type.ui[sw_custfltr::type[x]], arrow_flags, (void *)(FPTR)(TYPE_FILTER + x));
|
||||
}
|
||||
|
||||
// add region subitem
|
||||
@ -499,7 +499,7 @@ void menu_swcustom_filter::populate()
|
||||
arrow_flags = get_arrow_flags(0, m_filter.region.ui.size() - 1, sw_custfltr::region[x]);
|
||||
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));
|
||||
item_append(fbuff, m_filter.region.ui[sw_custfltr::region[x]], arrow_flags, (void *)(FPTR)(REGION_FILTER + x));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -345,7 +345,7 @@ void menu_font_ui::populate()
|
||||
|
||||
// add fonts option
|
||||
arrow_flags = get_arrow_flags(0, m_fonts.size() - 1, m_actual);
|
||||
item_append(_("UI Font"), m_fonts[m_actual].second.c_str(), arrow_flags, (void *)(FPTR)MUI_FNT);
|
||||
item_append(_("UI Font"), m_fonts[m_actual].second, arrow_flags, (void *)(FPTR)MUI_FNT);
|
||||
|
||||
#ifdef UI_WINDOWS
|
||||
if (m_fonts[m_actual].first != "default")
|
||||
@ -356,13 +356,13 @@ void menu_font_ui::populate()
|
||||
#endif
|
||||
|
||||
arrow_flags = get_arrow_flags(m_font_min, m_font_max, m_font_size);
|
||||
item_append(_("Lines"), string_format("%2d", m_font_size).c_str(), arrow_flags, (void *)(FPTR)FONT_SIZE);
|
||||
item_append(_("Lines"), string_format("%2d", m_font_size), arrow_flags, (void *)(FPTR)FONT_SIZE);
|
||||
|
||||
item_append(menu_item_type::SEPARATOR);
|
||||
|
||||
// add item
|
||||
arrow_flags = get_arrow_flags(m_info_min, m_info_max, m_info_size);
|
||||
item_append(_("Infos text size"), string_format("%3.2f", m_info_size).c_str(), arrow_flags, (void *)(FPTR)INFOS_SIZE);
|
||||
item_append(_("Infos text size"), string_format("%3.2f", m_info_size), arrow_flags, (void *)(FPTR)INFOS_SIZE);
|
||||
|
||||
item_append(menu_item_type::SEPARATOR);
|
||||
|
||||
@ -833,34 +833,34 @@ void menu_rgb_ui::populate()
|
||||
if (m_lock_ref != RGB_ALPHA)
|
||||
{
|
||||
arrow_flags = get_arrow_flags(0, 255, m_color->a());
|
||||
item_append(_("Alpha"), string_format("%3u", m_color->a()).c_str(), arrow_flags, (void *)(FPTR)RGB_ALPHA);
|
||||
item_append(_("Alpha"), string_format("%3u", m_color->a()), arrow_flags, (void *)(FPTR)RGB_ALPHA);
|
||||
}
|
||||
else
|
||||
item_append(_("Alpha"), s_text.c_str(), 0, (void *)(FPTR)RGB_ALPHA);
|
||||
item_append(_("Alpha"), s_text, 0, (void *)(FPTR)RGB_ALPHA);
|
||||
|
||||
if (m_lock_ref != RGB_RED)
|
||||
{
|
||||
arrow_flags = get_arrow_flags(0, 255, m_color->r());
|
||||
item_append(_("Red"), string_format("%3u", m_color->r()).c_str(), arrow_flags, (void *)(FPTR)RGB_RED);
|
||||
item_append(_("Red"), string_format("%3u", m_color->r()), arrow_flags, (void *)(FPTR)RGB_RED);
|
||||
}
|
||||
else
|
||||
item_append(_("Red"), s_text.c_str(), 0, (void *)(FPTR)RGB_RED);
|
||||
item_append(_("Red"), s_text, 0, (void *)(FPTR)RGB_RED);
|
||||
|
||||
if (m_lock_ref != RGB_GREEN)
|
||||
{
|
||||
arrow_flags = get_arrow_flags(0, 255, m_color->g());
|
||||
item_append(_("Green"), string_format("%3u", m_color->g()).c_str(), arrow_flags, (void *)(FPTR)RGB_GREEN);
|
||||
item_append(_("Green"), string_format("%3u", m_color->g()), arrow_flags, (void *)(FPTR)RGB_GREEN);
|
||||
}
|
||||
else
|
||||
item_append(_("Green"), s_text.c_str(), 0, (void *)(FPTR)RGB_GREEN);
|
||||
item_append(_("Green"), s_text, 0, (void *)(FPTR)RGB_GREEN);
|
||||
|
||||
if (m_lock_ref != RGB_BLUE)
|
||||
{
|
||||
arrow_flags = get_arrow_flags(0, 255, m_color->b());
|
||||
item_append(_("Blue"), string_format("%3u", m_color->b()).c_str(), arrow_flags, (void *)(FPTR)RGB_BLUE);
|
||||
item_append(_("Blue"), string_format("%3u", m_color->b()), arrow_flags, (void *)(FPTR)RGB_BLUE);
|
||||
}
|
||||
else
|
||||
item_append(_("Blue"), s_text.c_str(), 0, (void *)(FPTR)RGB_BLUE);
|
||||
item_append(_("Blue"), s_text, 0, (void *)(FPTR)RGB_BLUE);
|
||||
|
||||
item_append(menu_item_type::SEPARATOR);
|
||||
item_append(_("Choose from palette"), "", 0, (void *)(FPTR)PALETTE_CHOOSE);
|
||||
|
@ -293,7 +293,6 @@ menu_file_selector::menu_file_selector(mame_ui_manager &mui, render_container *c
|
||||
: menu(mui, container)
|
||||
, m_current_directory(current_directory)
|
||||
, m_current_file(current_file)
|
||||
, m_entrylist(nullptr)
|
||||
{
|
||||
m_image = image;
|
||||
m_has_empty = has_empty;
|
||||
@ -384,8 +383,8 @@ bool menu_file_selector::custom_mouse_down()
|
||||
int menu_file_selector::compare_entries(const file_selector_entry *e1, const file_selector_entry *e2)
|
||||
{
|
||||
int result;
|
||||
const char *e1_basename = (e1->basename != nullptr) ? e1->basename : "";
|
||||
const char *e2_basename = (e2->basename != nullptr) ? e2->basename : "";
|
||||
const char *e1_basename = e1->basename.c_str();
|
||||
const char *e2_basename = e2->basename.c_str();
|
||||
|
||||
if (e1->type < e2->type)
|
||||
{
|
||||
@ -420,28 +419,30 @@ int menu_file_selector::compare_entries(const file_selector_entry *e1, const fil
|
||||
// file selector entry to an entry list
|
||||
//-------------------------------------------------
|
||||
|
||||
menu_file_selector::file_selector_entry *menu_file_selector::append_entry(
|
||||
file_selector_entry_type entry_type, const char *entry_basename, const char *entry_fullpath)
|
||||
menu_file_selector::file_selector_entry &menu_file_selector::append_entry(
|
||||
file_selector_entry_type entry_type, const std::string &entry_basename, const std::string &entry_fullpath)
|
||||
{
|
||||
file_selector_entry *entry;
|
||||
file_selector_entry **entryptr;
|
||||
return append_entry(entry_type, std::string(entry_basename), std::string(entry_fullpath));
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// append_entry - appends a new
|
||||
// file selector entry to an entry list
|
||||
//-------------------------------------------------
|
||||
|
||||
menu_file_selector::file_selector_entry &menu_file_selector::append_entry(
|
||||
file_selector_entry_type entry_type, std::string &&entry_basename, std::string &&entry_fullpath)
|
||||
{
|
||||
// allocate a new entry
|
||||
entry = (file_selector_entry *) m_pool_alloc(sizeof(*entry));
|
||||
memset(entry, 0, sizeof(*entry));
|
||||
entry->type = entry_type;
|
||||
entry->basename = (entry_basename != nullptr) ? pool_strdup(entry_basename) : entry_basename;
|
||||
entry->fullpath = (entry_fullpath != nullptr) ? pool_strdup(entry_fullpath) : entry_fullpath;
|
||||
file_selector_entry entry;
|
||||
entry.type = entry_type;
|
||||
entry.basename = std::move(entry_basename);
|
||||
entry.fullpath = std::move(entry_fullpath);
|
||||
|
||||
// find the end of the list
|
||||
entryptr = &m_entrylist;
|
||||
while ((*entryptr != nullptr) && (compare_entries(entry, *entryptr) >= 0))
|
||||
entryptr = &(*entryptr)->next;
|
||||
|
||||
// insert the entry
|
||||
entry->next = *entryptr;
|
||||
*entryptr = entry;
|
||||
return entry;
|
||||
m_entrylist.emplace_back(std::move(entry));
|
||||
return m_entrylist[m_entrylist.size() - 1];
|
||||
}
|
||||
|
||||
|
||||
@ -475,10 +476,10 @@ menu_file_selector::file_selector_entry *menu_file_selector::append_dirent_entry
|
||||
util::zippath_combine(buffer, m_current_directory.c_str(), dirent->name);
|
||||
|
||||
// create the file selector entry
|
||||
entry = append_entry(
|
||||
entry = &append_entry(
|
||||
entry_type,
|
||||
dirent->name,
|
||||
buffer.c_str());
|
||||
std::move(buffer));
|
||||
|
||||
return entry;
|
||||
}
|
||||
@ -546,24 +547,24 @@ void menu_file_selector::populate()
|
||||
err = util::zippath_opendir(path, &directory);
|
||||
|
||||
// clear out the menu entries
|
||||
m_entrylist = nullptr;
|
||||
m_entrylist.clear();
|
||||
|
||||
if (m_has_empty)
|
||||
{
|
||||
// add the "[empty slot]" entry
|
||||
append_entry(SELECTOR_ENTRY_TYPE_EMPTY, nullptr, nullptr);
|
||||
append_entry(SELECTOR_ENTRY_TYPE_EMPTY, "", "");
|
||||
}
|
||||
|
||||
if (m_has_create)
|
||||
{
|
||||
// add the "[create]" entry
|
||||
append_entry(SELECTOR_ENTRY_TYPE_CREATE, nullptr, nullptr);
|
||||
append_entry(SELECTOR_ENTRY_TYPE_CREATE, "", "");
|
||||
}
|
||||
|
||||
if (m_has_softlist)
|
||||
{
|
||||
// add the "[software list]" entry
|
||||
entry = append_entry(SELECTOR_ENTRY_TYPE_SOFTWARE_LIST, nullptr, nullptr);
|
||||
entry = &append_entry(SELECTOR_ENTRY_TYPE_SOFTWARE_LIST, "", "");
|
||||
selected_entry = entry;
|
||||
}
|
||||
|
||||
@ -598,8 +599,8 @@ void menu_file_selector::populate()
|
||||
}
|
||||
|
||||
// append all of the menu entries
|
||||
for (entry = m_entrylist; entry != nullptr; entry = entry->next)
|
||||
append_entry_menu_item(entry);
|
||||
for (auto &entry : m_entrylist)
|
||||
append_entry_menu_item(&entry);
|
||||
|
||||
// set the selection (if we have one)
|
||||
if (selected_entry != nullptr)
|
||||
@ -620,7 +621,6 @@ void menu_file_selector::populate()
|
||||
void menu_file_selector::handle()
|
||||
{
|
||||
osd_file::error err;
|
||||
const file_selector_entry *entry;
|
||||
const file_selector_entry *selected_entry = nullptr;
|
||||
int bestmatch = 0;
|
||||
|
||||
@ -631,7 +631,7 @@ void menu_file_selector::handle()
|
||||
// handle selections
|
||||
if (event->iptkey == IPT_UI_SELECT)
|
||||
{
|
||||
entry = (const file_selector_entry *) event->itemref;
|
||||
auto entry = (const file_selector_entry *) event->itemref;
|
||||
switch (entry->type)
|
||||
{
|
||||
case SELECTOR_ENTRY_TYPE_EMPTY:
|
||||
@ -654,7 +654,7 @@ void menu_file_selector::handle()
|
||||
case SELECTOR_ENTRY_TYPE_DRIVE:
|
||||
case SELECTOR_ENTRY_TYPE_DIRECTORY:
|
||||
// drive/directory - first check the path
|
||||
err = util::zippath_opendir(entry->fullpath, nullptr);
|
||||
err = util::zippath_opendir(entry->fullpath.c_str(), nullptr);
|
||||
if (err != osd_file::error::NONE)
|
||||
{
|
||||
// this path is problematic; present the user with an error and bail
|
||||
@ -709,41 +709,21 @@ void menu_file_selector::handle()
|
||||
const file_selector_entry *cur_selected = (const file_selector_entry *)get_selection();
|
||||
|
||||
// check for entries which matches our m_filename_buffer:
|
||||
// from current entry to the end
|
||||
for (entry = cur_selected; entry != nullptr; entry = entry->next)
|
||||
for (auto &entry : m_entrylist)
|
||||
{
|
||||
if (entry->basename != nullptr && m_filename_buffer[0] != '\0')
|
||||
if (cur_selected != &entry)
|
||||
{
|
||||
int match = 0;
|
||||
for (int i = 0; i < ARRAY_LENGTH(m_filename_buffer); i++)
|
||||
{
|
||||
if (core_strnicmp(entry->basename, m_filename_buffer, i) == 0)
|
||||
if (core_strnicmp(entry.basename.c_str(), m_filename_buffer, i) == 0)
|
||||
match = i;
|
||||
}
|
||||
|
||||
if (match > bestmatch)
|
||||
{
|
||||
bestmatch = match;
|
||||
selected_entry = entry;
|
||||
}
|
||||
}
|
||||
}
|
||||
// and from the first entry to current one
|
||||
for (entry = m_entrylist; entry != cur_selected; entry = entry->next)
|
||||
{
|
||||
if (entry->basename != nullptr && m_filename_buffer[0] != '\0')
|
||||
{
|
||||
int match = 0;
|
||||
for (int i = 0; i < ARRAY_LENGTH(m_filename_buffer); i++)
|
||||
{
|
||||
if (core_strnicmp(entry->basename, m_filename_buffer, i) == 0)
|
||||
match = i;
|
||||
}
|
||||
|
||||
if (match > bestmatch)
|
||||
{
|
||||
bestmatch = match;
|
||||
selected_entry = entry;
|
||||
selected_entry = &entry;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -84,11 +84,9 @@ private:
|
||||
|
||||
struct file_selector_entry
|
||||
{
|
||||
file_selector_entry *next;
|
||||
|
||||
file_selector_entry_type type;
|
||||
const char *basename;
|
||||
const char *fullpath;
|
||||
std::string basename;
|
||||
std::string fullpath;
|
||||
};
|
||||
|
||||
// internal state
|
||||
@ -99,13 +97,14 @@ private:
|
||||
bool m_has_softlist;
|
||||
bool m_has_create;
|
||||
int * m_result;
|
||||
file_selector_entry * m_entrylist;
|
||||
std::vector<file_selector_entry> m_entrylist;
|
||||
std::string m_hover_directory;
|
||||
char m_filename_buffer[1024];
|
||||
|
||||
// methods
|
||||
int compare_entries(const file_selector_entry *e1, const file_selector_entry *e2);
|
||||
file_selector_entry *append_entry(file_selector_entry_type entry_type, const char *entry_basename, const char *entry_fullpath);
|
||||
file_selector_entry &append_entry(file_selector_entry_type entry_type, const std::string &entry_basename, const std::string &entry_fullpath);
|
||||
file_selector_entry &append_entry(file_selector_entry_type entry_type, std::string &&entry_basename, std::string &&entry_fullpath);
|
||||
file_selector_entry *append_dirent_entry(const osd::directory::entry *dirent);
|
||||
void append_entry_menu_item(const file_selector_entry *entry);
|
||||
};
|
||||
|
@ -810,8 +810,6 @@ menu_analog::menu_analog(mame_ui_manager &mui, render_container *container) : me
|
||||
|
||||
void menu_analog::populate()
|
||||
{
|
||||
std::string text;
|
||||
std::string subtext;
|
||||
std::string prev_owner;
|
||||
bool first_entry = true;
|
||||
|
||||
@ -856,6 +854,8 @@ void menu_analog::populate()
|
||||
{
|
||||
analog_item_data *data;
|
||||
UINT32 flags = 0;
|
||||
std::string text;
|
||||
std::string subtext;
|
||||
if (strcmp(field.device().tag(), prev_owner.c_str()) != 0)
|
||||
{
|
||||
if (first_entry)
|
||||
@ -919,7 +919,7 @@ void menu_analog::populate()
|
||||
flags |= FLAG_RIGHT_ARROW;
|
||||
|
||||
/* append a menu item */
|
||||
item_append(text.c_str(), subtext.c_str(), flags, data);
|
||||
item_append(std::move(text), std::move(subtext), flags, data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -775,7 +775,7 @@ void menu_machine_configure::populate()
|
||||
if (!m_bios.empty())
|
||||
{
|
||||
UINT32 arrows = get_arrow_flags(0, m_bios.size() - 1, m_curbios);
|
||||
item_append(_("Driver"), m_bios[m_curbios].first.c_str(), arrows, (void *)(FPTR)BIOS);
|
||||
item_append(_("Driver"), m_bios[m_curbios].first, arrows, (void *)(FPTR)BIOS);
|
||||
}
|
||||
else
|
||||
item_append(_("This machine has no bios."), "", FLAG_DISABLE, nullptr);
|
||||
|
@ -239,12 +239,12 @@ void menu_game_options::populate()
|
||||
arrow_flags = get_arrow_flags(0, inif.total() - 1, inif.cur_file());
|
||||
fbuff = _(" ^!File");
|
||||
convert_command_glyph(fbuff);
|
||||
item_append(fbuff.c_str(), inif.get_file().c_str(), arrow_flags, (void *)(FPTR)FILE_CATEGORY_FILTER);
|
||||
item_append(fbuff, inif.get_file(), arrow_flags, (void *)(FPTR)FILE_CATEGORY_FILTER);
|
||||
|
||||
arrow_flags = get_arrow_flags(0, inif.cat_total() - 1, inif.cur_cat());
|
||||
fbuff = _(" ^!Category");
|
||||
convert_command_glyph(fbuff);
|
||||
item_append(fbuff.c_str(), inif.get_category().c_str(), arrow_flags, (void *)(FPTR)CATEGORY_FILTER);
|
||||
item_append(fbuff, inif.get_category(), arrow_flags, (void *)(FPTR)CATEGORY_FILTER);
|
||||
}
|
||||
// add manufacturer subitem
|
||||
else if (m_main == FILTER_MANUFACTURER && c_mnfct::ui.size() > 0)
|
||||
@ -252,7 +252,7 @@ void menu_game_options::populate()
|
||||
arrow_flags = get_arrow_flags(0, c_mnfct::ui.size() - 1, c_mnfct::actual);
|
||||
fbuff = _("^!Manufacturer");
|
||||
convert_command_glyph(fbuff);
|
||||
item_append(fbuff.c_str(), c_mnfct::ui[c_mnfct::actual].c_str(), arrow_flags, (void *)(FPTR)MANUFACT_CAT_FILTER);
|
||||
item_append(fbuff, c_mnfct::ui[c_mnfct::actual], arrow_flags, (void *)(FPTR)MANUFACT_CAT_FILTER);
|
||||
}
|
||||
// add year subitem
|
||||
else if (m_main == FILTER_YEAR && c_year::ui.size() > 0)
|
||||
@ -260,14 +260,14 @@ void menu_game_options::populate()
|
||||
arrow_flags = get_arrow_flags(0, c_year::ui.size() - 1, c_year::actual);
|
||||
fbuff.assign(_("^!Year"));
|
||||
convert_command_glyph(fbuff);
|
||||
item_append(fbuff.c_str(), c_year::ui[c_year::actual].c_str(), arrow_flags, (void *)(FPTR)YEAR_CAT_FILTER);
|
||||
item_append(fbuff, c_year::ui[c_year::actual], arrow_flags, (void *)(FPTR)YEAR_CAT_FILTER);
|
||||
}
|
||||
// add custom subitem
|
||||
else if (m_main == FILTER_CUSTOM)
|
||||
{
|
||||
fbuff = _("^!Setup custom filter");
|
||||
convert_command_glyph(fbuff);
|
||||
item_append(fbuff.c_str(), "", 0, (void *)(FPTR)CUSTOM_FILTER);
|
||||
item_append(fbuff, "", 0, (void *)(FPTR)CUSTOM_FILTER);
|
||||
}
|
||||
|
||||
item_append(menu_item_type::SEPARATOR);
|
||||
|
@ -106,7 +106,7 @@ void menu_plugin_opt::populate()
|
||||
else if(item.flags == "lr")
|
||||
flags = FLAG_RIGHT_ARROW | FLAG_LEFT_ARROW;
|
||||
|
||||
item_append(item.text.c_str(), item.subtext.c_str(), flags, (void *)i++);
|
||||
item_append(item.text, item.subtext, flags, (void *)i++);
|
||||
}
|
||||
item_append(menu_item_type::SEPARATOR);
|
||||
}
|
||||
|
@ -137,7 +137,7 @@ void menu_selector::populate()
|
||||
find_matches(m_search);
|
||||
|
||||
for (int curitem = 0; m_searchlist[curitem]; ++curitem)
|
||||
item_append(m_searchlist[curitem]->c_str(), "", 0, (void *)m_searchlist[curitem]);
|
||||
item_append(*m_searchlist[curitem], "", 0, (void *)m_searchlist[curitem]);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -148,7 +148,7 @@ void menu_selector::populate()
|
||||
selected = added;
|
||||
|
||||
added++;
|
||||
item_append(m_str_items[index].c_str(), "", 0, (void *)&m_str_items[index]);
|
||||
item_append(m_str_items[index], "", 0, (void *)&m_str_items[index]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -587,7 +587,7 @@ void menu_select_game::populate()
|
||||
{
|
||||
if (old_item_selected == -1 && mfavorite.shortname == reselect_last::driver)
|
||||
old_item_selected = curitem;
|
||||
item_append(mfavorite.longname.c_str(), mfavorite.devicetype.c_str(),
|
||||
item_append(mfavorite.longname, mfavorite.devicetype,
|
||||
mfavorite.parentname.empty() ? flags_ui : (FLAG_INVERT | flags_ui), (void *)&mfavorite);
|
||||
}
|
||||
curitem++;
|
||||
|
@ -477,7 +477,7 @@ void menu_select_software::populate()
|
||||
else if (m_displaylist[curitem]->shortname == reselect_last::software && m_displaylist[curitem]->listname == reselect_last::swlist)
|
||||
old_software = m_has_empty_start ? curitem + 1 : curitem;
|
||||
|
||||
item_append(m_displaylist[curitem]->longname.c_str(), m_displaylist[curitem]->devicetype.c_str(),
|
||||
item_append(m_displaylist[curitem]->longname, m_displaylist[curitem]->devicetype,
|
||||
m_displaylist[curitem]->parentname.empty() ? flags_ui : (FLAG_INVERT | flags_ui), (void *)m_displaylist[curitem]);
|
||||
}
|
||||
}
|
||||
@ -487,7 +487,7 @@ void menu_select_software::populate()
|
||||
find_matches(m_search, VISIBLE_GAMES_IN_SEARCH);
|
||||
|
||||
for (int curitem = 0; m_searchlist[curitem] != nullptr; ++curitem)
|
||||
item_append(m_searchlist[curitem]->longname.c_str(), m_searchlist[curitem]->devicetype.c_str(),
|
||||
item_append(m_searchlist[curitem]->longname, m_searchlist[curitem]->devicetype,
|
||||
m_searchlist[curitem]->parentname.empty() ? flags_ui : (FLAG_INVERT | flags_ui),
|
||||
(void *)m_searchlist[curitem]);
|
||||
}
|
||||
@ -1938,7 +1938,7 @@ software_parts::~software_parts()
|
||||
void software_parts::populate()
|
||||
{
|
||||
for (auto & elem : m_parts)
|
||||
item_append(elem.first.c_str(), elem.second.c_str(), 0, (void *)&elem);
|
||||
item_append(elem.first, elem.second, 0, (void *)&elem);
|
||||
|
||||
item_append(menu_item_type::SEPARATOR);
|
||||
customtop = ui().get_line_height() + (3.0f * UI_BOX_TB_BORDER);
|
||||
|
@ -152,7 +152,7 @@ void menu_sliders::populate()
|
||||
flags |= FLAG_LEFT_ARROW;
|
||||
if (curval < slider->maxval)
|
||||
flags |= FLAG_RIGHT_ARROW;
|
||||
item_append(slider->description, tempstring.c_str(), flags, (void *)slider, menu_item_type::SLIDER);
|
||||
item_append(slider->description, tempstring, flags, (void *)slider, menu_item_type::SLIDER);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -175,7 +175,7 @@ void menu_sliders::populate()
|
||||
flags |= FLAG_LEFT_ARROW;
|
||||
if (curval < slider->maxval)
|
||||
flags |= FLAG_RIGHT_ARROW;
|
||||
item_append(slider->description, tempstring.c_str(), flags, (void *)slider, menu_item_type::SLIDER);
|
||||
item_append(slider->description, tempstring, flags, (void *)slider, menu_item_type::SLIDER);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -168,7 +168,7 @@ void menu_slot_devices::populate()
|
||||
opt_name.append(_(" [internal]"));
|
||||
}
|
||||
|
||||
item_append(slot.device().tag() + 1, opt_name.c_str(), (slot.fixed() || slot_get_length(slot) == 0) ? 0 : (FLAG_LEFT_ARROW | FLAG_RIGHT_ARROW), (void *)&slot);
|
||||
item_append(slot.device().tag() + 1, opt_name, (slot.fixed() || slot_get_length(slot) == 0) ? 0 : (FLAG_LEFT_ARROW | FLAG_RIGHT_ARROW), (void *)&slot);
|
||||
}
|
||||
item_append(menu_item_type::SEPARATOR);
|
||||
item_append(_("Reset"), "", 0, (void *)1);
|
||||
|
@ -131,7 +131,7 @@ void menu_sound_options::populate()
|
||||
|
||||
// add options items
|
||||
item_append(_("Sound"), m_sound ? _("On") : _("Off"), m_sound ? FLAG_RIGHT_ARROW : FLAG_LEFT_ARROW, (void *)(FPTR)ENABLE_SOUND);
|
||||
item_append(_("Sample Rate"), string_format("%d", m_sample_rate).c_str(), arrow_flags, (void *)(FPTR)SAMPLE_RATE);
|
||||
item_append(_("Sample Rate"), string_format("%d", m_sample_rate), arrow_flags, (void *)(FPTR)SAMPLE_RATE);
|
||||
item_append(_("Use External Samples"), m_samples ? _("On") : _("Off"), m_samples ? FLAG_RIGHT_ARROW : FLAG_LEFT_ARROW, (void *)(FPTR)ENABLE_SAMPLES);
|
||||
item_append(menu_item_type::SEPARATOR);
|
||||
|
||||
|
@ -90,7 +90,7 @@ void menu_software_parts::populate()
|
||||
menu_part_name.append(" (").append(swpart.feature("part_id")).append(")");
|
||||
entry->type = T_ENTRY;
|
||||
entry->part = &swpart;
|
||||
item_append(m_info->shortname(), menu_part_name.c_str(), 0, entry);
|
||||
item_append(m_info->shortname(), menu_part_name, 0, entry);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -59,7 +59,7 @@ void menu_tape_control::populate()
|
||||
if (current_device())
|
||||
{
|
||||
// name of tape
|
||||
item_append(current_display_name().c_str(), current_device()->exists() ? current_device()->filename() : "No Tape Image loaded", current_display_flags(), TAPECMD_SELECT);
|
||||
item_append(current_display_name(), current_device()->exists() ? current_device()->filename() : "No Tape Image loaded", current_display_flags(), TAPECMD_SELECT);
|
||||
|
||||
if (current_device()->exists())
|
||||
{
|
||||
|
@ -187,7 +187,7 @@ void menu_video_options::populate()
|
||||
/* create a string for the item, replacing underscores with spaces */
|
||||
tempstring.assign(name);
|
||||
strreplace(tempstring, "_", " ");
|
||||
item_append(tempstring.c_str(), "", 0, (void *)(FPTR)(VIDEO_ITEM_VIEW + viewnum));
|
||||
item_append(tempstring, "", 0, (void *)(FPTR)(VIDEO_ITEM_VIEW + viewnum));
|
||||
}
|
||||
|
||||
/* add a separator */
|
||||
|
Loading…
Reference in New Issue
Block a user