Exemple #1
0
//-------------------------------------------------
//  populate
//-------------------------------------------------
void ui_menu_custom_filter::populate()
{
	// add main filter
	UINT32 arrow_flags = get_arrow_flags((int)FILTER_ALL, (int)FILTER_UNAVAILABLE, custfltr::main);
	item_append(_("Main filter"), main_filters::text[custfltr::main], arrow_flags, (void *)(FPTR)MAIN_FILTER);

	// add other filters
	for (int x = 1; x <= custfltr::numother; x++)
	{
		item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);

		// add filter items
		arrow_flags = get_arrow_flags((int)FILTER_UNAVAILABLE + 1, (int)FILTER_LAST - 1, custfltr::other[x]);
		item_append(_("Other filter"), main_filters::text[custfltr::other[x]], arrow_flags, (void *)(FPTR)(OTHER_FILTER + x));

		if (m_added)
			selected = item.size() - 2;

		// add manufacturer subitem
		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");
			convert_command_glyph(fbuff);
			item_append(fbuff.c_str(), c_mnfct::ui[custfltr::mnfct[x]].c_str(), arrow_flags, (void *)(FPTR)(MNFCT_FILTER + x));
		}

		// add year subitem
		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");
			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(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);

	if (custfltr::numother > 0)
		item_append(_("Remove last filter"), nullptr, 0, (void *)(FPTR)REMOVE_FILTER);

	if (custfltr::numother < MAX_CUST_FILTER - 2)
		item_append(_("Add filter"), nullptr, 0, (void *)(FPTR)ADD_FILTER);

	item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
	customtop = machine().ui().get_line_height() + 3.0f * UI_BOX_TB_BORDER;
}
Exemple #2
0
void ui_menu_dats_view::get_data()
{
	std::vector<int> xstart;
	std::vector<int> xend;
	std::string buffer;
	std::vector<std::string> m_item;
	if (m_items_list[actual].option == UI_COMMAND_LOAD)
	{
		machine().datfile().command_sub_menu(m_driver, m_item);
		if (!m_item.empty())
		{
			for (size_t x = 0; x < m_item.size(); ++x)
			{
				std::string t_buffer;
				buffer.append(m_item[x]).append("\n");
				machine().datfile().load_command_info(t_buffer, m_item[x]);
				if (!t_buffer.empty())
					buffer.append(t_buffer).append("\n");
			}
			convert_command_glyph(buffer);
		}
	}
	else
		machine().datfile().load_data_info(m_driver, buffer, m_items_list[actual].option);

	int totallines = machine().ui().wrap_text(container, buffer.c_str(), 0.0f, 0.0f, 1.0f - (4.0f * UI_BOX_LR_BORDER), xstart, xend);
	for (int x = 0; x < totallines; ++x)
	{
		std::string tempbuf(buffer.substr(xstart[x], xend[x] - xstart[x]));
		item_append(tempbuf.c_str(), nullptr, (MENU_FLAG_UI_DATS | MENU_FLAG_DISABLE), (void *)(FPTR)(x + 1));

	}
}
Exemple #3
0
//-------------------------------------------------
//  populate
//-------------------------------------------------
void ui_menu_swcustom_filter::populate()
{
	// add main filter
	UINT32 arrow_flags = get_arrow_flags((int)UI_SW_ALL, (int)UI_SW_UNAVAILABLE, sw_custfltr::main);
	item_append(_("Main filter"), sw_filters::text[sw_custfltr::main], arrow_flags, (void *)(FPTR)MAIN_FILTER);

	// add other filters
	for (int x = 1; x <= sw_custfltr::numother; x++)
	{
		item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);

		// add filter items
		arrow_flags = get_arrow_flags((int)UI_SW_UNAVAILABLE + 1, (int)UI_SW_LAST - 1, sw_custfltr::other[x]);
		item_append(_("Other filter"), sw_filters::text[sw_custfltr::other[x]], arrow_flags, (void *)(FPTR)(OTHER_FILTER + x));

		if (m_added)
			selected = item.size() - 2;

		// add publisher subitem
		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");
			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));
		}

		// add year subitem
		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");
			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));
		}

		// add year subitem
		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");
			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));
		}

		// add device type subitem
		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");
			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));
		}

		// add region subitem
		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");
			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(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);

	if (sw_custfltr::numother > 0)
		item_append(_("Remove last filter"), nullptr, 0, (void *)(FPTR)REMOVE_FILTER);

	if (sw_custfltr::numother < MAX_CUST_FILTER - 2)
		item_append(_("Add filter"), nullptr, 0, (void *)(FPTR)ADD_FILTER);

	item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);

	customtop = machine().ui().get_line_height() + 3.0f * UI_BOX_TB_BORDER;
}
Exemple #4
0
void menu_game_options::populate(float &customtop, float &custombottom)
{
	if (machine().options().ui() != emu_options::UI_SIMPLE)
	{
		// set filter arrow
		std::string fbuff;

		// add filter item
		uint32_t arrow_flags = get_arrow_flags<uint16_t>(FILTER_FIRST, FILTER_LAST, m_main);
		item_append(_("Filter"), main_filters::text[m_main], arrow_flags, (void *)(uintptr_t)FILTER_MENU);

		// add category subitem
		if (m_main == FILTER_CATEGORY && mame_machine_manager::instance()->inifile().total() > 0)
		{
			inifile_manager &inif = mame_machine_manager::instance()->inifile();

			arrow_flags = get_arrow_flags(uint16_t(0), uint16_t(inif.total() - 1), inif.cur_file());
			fbuff = _(" ^!File");
			convert_command_glyph(fbuff);
			item_append(fbuff, inif.get_file(), arrow_flags, (void *)(uintptr_t)FILE_CATEGORY_FILTER);

			arrow_flags = get_arrow_flags(uint16_t(0), uint16_t(inif.cat_total() - 1), inif.cur_cat());
			fbuff = _(" ^!Category");
			convert_command_glyph(fbuff);
			item_append(fbuff, inif.get_category(), arrow_flags, (void *)(uintptr_t)CATEGORY_FILTER);
		}
		// add manufacturer subitem
		else if (m_main == FILTER_MANUFACTURER && c_mnfct::ui.size() > 0)
		{
			arrow_flags = get_arrow_flags(uint16_t(0), uint16_t(c_mnfct::ui.size() - 1), c_mnfct::actual);
			fbuff = _("^!Manufacturer");
			convert_command_glyph(fbuff);
			item_append(fbuff, c_mnfct::ui[c_mnfct::actual], arrow_flags, (void *)(uintptr_t)MANUFACT_CAT_FILTER);
		}
		// add year subitem
		else if (m_main == FILTER_YEAR && c_year::ui.size() > 0)
		{
			arrow_flags = get_arrow_flags(uint16_t(0), uint16_t(c_year::ui.size() - 1), c_year::actual);
			fbuff.assign(_("^!Year"));
			convert_command_glyph(fbuff);
			item_append(fbuff, c_year::ui[c_year::actual], arrow_flags, (void *)(uintptr_t)YEAR_CAT_FILTER);
		}
		// add custom subitem
		else if (m_main == FILTER_CUSTOM)
		{
			fbuff = _("^!Setup custom filter");
			convert_command_glyph(fbuff);
			item_append(fbuff, "", 0, (void *)(uintptr_t)CUSTOM_FILTER);
		}

		item_append(menu_item_type::SEPARATOR);

		// add options items
		item_append(_("Customize UI"), "", 0, (void *)(uintptr_t)CUSTOM_MENU);
		item_append(_("Configure Directories"), "", 0, (void *)(uintptr_t)CONF_DIR);
	}
	item_append(_(submenu::video_options[0].description), "", 0, (void *)(uintptr_t)DISPLAY_MENU);
	item_append(_("Sound Options"), "", 0, (void *)(uintptr_t)SOUND_MENU);
	item_append(_(submenu::misc_options[0].description), "", 0, (void *)(uintptr_t)MISC_MENU);
	item_append(_(submenu::control_options[0].description), "", 0, (void *)(uintptr_t)CONTROLLER_MENU);
	item_append(_("General Inputs"), "", 0, (void *)(uintptr_t)CGI_MENU);
	item_append(_(submenu::advanced_options[0].description), "", 0, (void *)(uintptr_t)ADVANCED_MENU);
	item_append(menu_item_type::SEPARATOR);
	item_append(_("Save Configuration"), "", 0, (void *)(uintptr_t)SAVE_CONFIG);

	custombottom = 2.0f * ui().get_line_height() + 3.0f * UI_BOX_TB_BORDER;
	customtop = ui().get_line_height() + 3.0f * UI_BOX_TB_BORDER;
}