Fix scrolling in slider list, nw

This commit is contained in:
therealmogminer@gmail.com 2016-03-17 15:48:32 +01:00
parent 493cf7289b
commit d7dc173df9
7 changed files with 6 additions and 17 deletions

View File

@ -108,20 +108,14 @@ void ui_menu_sliders::handle()
/* if we got here via up or page up, select the previous item */
if (menu_event->iptkey == IPT_UI_UP || menu_event->iptkey == IPT_UI_PAGE_UP)
{
do
{
selected = (selected + item.size() - 1) % item.size();
} while(((slider_state&)item[selected]).hidden);
validate_selection(-1);
selected = (selected + item.size() - 1) % item.size();
validate_selection(-1);
}
/* otherwise select the next item */
else if (menu_event->iptkey == IPT_UI_DOWN || menu_event->iptkey == IPT_UI_PAGE_DOWN)
{
do
{
selected = (selected + 1) % item.size();
} while(((slider_state&)item[selected]).hidden);
selected = (selected + 1) % item.size();
validate_selection(1);
}
}

View File

@ -1941,7 +1941,6 @@ static slider_state *slider_alloc(running_machine &machine, const char *title, I
state->incval = incval;
state->update = update;
state->arg = arg;
state->hidden = false;
state->id = -1;
strcpy(state->description, title);

View File

@ -103,7 +103,6 @@ struct slider_state
INT32 defval; /* default value */
INT32 maxval; /* maximum value */
INT32 incval; /* increment value */
bool hidden; /* hidden or not */
int id;
char description[1]; /* textual description */
};

View File

@ -63,7 +63,6 @@ slider_state* bgfx_slider::create_core_slider(running_machine& machine)
state->incval = m_step;
state->update = update_trampoline;
state->arg = this;
state->hidden = false;
state->id = 0; // fixme
strcpy(state->description, m_description.c_str());

View File

@ -2222,7 +2222,6 @@ static slider_state *slider_alloc(running_machine &machine, int id, const char *
state->incval = incval;
state->update = update;
state->arg = arg;
state->hidden = false;
state->id = id;
strcpy(state->description, title);

View File

@ -39,7 +39,7 @@ public:
virtual int create() override;
virtual slider_state* get_slider_list() override;
virtual bool multi_window_sliders() { return true; }
virtual bool multi_window_sliders() override { return true; }
virtual int draw(const int update) override;
#ifdef OSD_SDL

View File

@ -273,7 +273,6 @@ void windows_osd_interface::build_slider_list()
{
m_sliders = nullptr;
slider_state *curr = m_sliders;
int index = 0;
for (win_window_info *info = win_window_list; info != nullptr; info = info->m_next)
{
slider_state *window_sliders = info->m_renderer->get_slider_list();
@ -281,7 +280,8 @@ void windows_osd_interface::build_slider_list()
{
if (m_sliders == nullptr)
{
m_sliders = curr = window_sliders;
m_sliders = window_sliders;
curr = m_sliders;
}
else
{
@ -291,7 +291,6 @@ void windows_osd_interface::build_slider_list()
}
curr->next = window_sliders;
}
index++;
}
}
}