summaryrefslogtreecommitdiffstatshomepage
path: root/src/frontend/mame/ui/menu.h
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 /src/frontend/mame/ui/menu.h
parentf4871c88cb9d09ceb6689d8d2d3b10ddb133d225 (diff)
Encapsulate a bit more of the menu base class to control when layout changes can happen
Diffstat (limited to 'src/frontend/mame/ui/menu.h')
-rw-r--r--src/frontend/mame/ui/menu.h24
1 files changed, 15 insertions, 9 deletions
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