mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-28 16:01:10 +02:00
neutrino menu: make setSelected()also usable if widget index is in use
setSelected() had no effect with widget index
git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-beta@2037 e54a6e83-5905-42d5-8d5c-058d10e6a962
Origin commit data
------------------
Branch: ni/coolstream
Commit: c12fe22766
Author: Thilo Graf <dbt@novatux.de>
Date: 2012-01-06 (Fri, 06 Jan 2012)
Origin message was:
------------------
*neutrino menu: make setSelected()also usable if widget index is in use
setSelected() had no effect with widget index
git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-beta@2037 e54a6e83-5905-42d5-8d5c-058d10e6a962
------------------
This commit was generated by Migit
This commit is contained in:
@@ -306,13 +306,14 @@ CMenuWidget::CMenuWidget()
|
|||||||
sb_width = 0;
|
sb_width = 0;
|
||||||
savescreen = false;
|
savescreen = false;
|
||||||
background = NULL;
|
background = NULL;
|
||||||
|
preselected = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
CMenuWidget::CMenuWidget(const neutrino_locale_t Name, const std::string & Icon, const int mwidth, const mn_widget_id_t &w_index)
|
CMenuWidget::CMenuWidget(const neutrino_locale_t Name, const std::string & Icon, const int mwidth, const mn_widget_id_t &w_index)
|
||||||
{
|
{
|
||||||
name = Name;
|
name = Name;
|
||||||
nameString = g_Locale->getText(Name);
|
nameString = g_Locale->getText(Name);
|
||||||
|
preselected = -1;
|
||||||
Init(Icon, mwidth, w_index);
|
Init(Icon, mwidth, w_index);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -320,7 +321,7 @@ CMenuWidget::CMenuWidget(const char* Name, const std::string & Icon, const int m
|
|||||||
{
|
{
|
||||||
name = NONEXISTANT_LOCALE;
|
name = NONEXISTANT_LOCALE;
|
||||||
nameString = Name;
|
nameString = Name;
|
||||||
|
preselected = -1;
|
||||||
Init(Icon, mwidth, w_index);
|
Init(Icon, mwidth, w_index);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -340,8 +341,13 @@ void CMenuWidget::Init(const std::string & Icon, const int mwidth, const mn_widg
|
|||||||
//ok
|
//ok
|
||||||
widget_index = w_index;
|
widget_index = w_index;
|
||||||
}
|
}
|
||||||
preselected = NO_WIDGET_ID;
|
|
||||||
|
//set default preselected if value = -1 (no selected). If value has changed, e.g. with setSelected(), then use current value
|
||||||
|
preselected = preselected != -1 ? preselected : -1;
|
||||||
|
|
||||||
|
//overwrite preselected value with global select value
|
||||||
selected = (widget_index == NO_WIDGET_ID ? preselected : mglobal->v_selected[widget_index]);
|
selected = (widget_index == NO_WIDGET_ID ? preselected : mglobal->v_selected[widget_index]);
|
||||||
|
|
||||||
|
|
||||||
min_width = 0;
|
min_width = 0;
|
||||||
width = 0; /* is set in paint() */
|
width = 0; /* is set in paint() */
|
||||||
|
Reference in New Issue
Block a user