From cc24a339d8c0517259084b5c178d784626ba965c Mon Sep 17 00:00:00 2001 From: ImJezze Date: Sun, 21 Feb 2016 11:48:45 +0100 Subject: Merge remote-tracking branch 'refs/remotes/mamedev/master' Second attempt --- src/emu/ui/selector.h | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 src/emu/ui/selector.h (limited to 'src/emu/ui/selector.h') diff --git a/src/emu/ui/selector.h b/src/emu/ui/selector.h new file mode 100644 index 00000000000..595ca1f578d --- /dev/null +++ b/src/emu/ui/selector.h @@ -0,0 +1,51 @@ +// license:BSD-3-Clause +// copyright-holders:Dankan1890 +/*************************************************************************** + + ui/selector.h + + Internal UI user interface. + +***************************************************************************/ + +#pragma once + +#ifndef __UI_SELECTOR_H__ +#define __UI_SELECTOR_H__ + +enum +{ + SELECTOR_INIFILE = 1, + SELECTOR_CATEGORY, + SELECTOR_GAME, + SELECTOR_SOFTWARE +}; + +//------------------------------------------------- +// class selector menu +//------------------------------------------------- + +class ui_menu_selector : public ui_menu +{ +public: + ui_menu_selector(running_machine &machine, render_container *container, std::vector _sel, UINT16 &_actual, int _category = 0, int _hover = 0); + virtual ~ui_menu_selector(); + virtual void populate() override; + virtual void handle() override; + virtual void custom_render(void *selectedref, float top, float bottom, float x, float y, float x2, float y2) override; + + virtual bool menu_has_search_active() override { return (m_search[0] != 0); } + +private: + enum { VISIBLE_GAMES_IN_SEARCH = 200 }; + char m_search[40]; + UINT16 &m_selector; + int m_category, m_hover; + bool m_first_pass; + std::vector m_str_items; + std::string *m_searchlist[VISIBLE_GAMES_IN_SEARCH + 1]; + + void find_matches(const char *str); +}; + +#endif /* __UI_SELECTOR_H__ */ -- cgit v1.2.3-70-g09d2