mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-28 07:51:19 +02:00
menu: add overloaded version for CMenuOptionStringChooser
This commit is contained in:
@@ -1456,7 +1456,23 @@ int CMenuOptionChooser::getWidth(void)
|
|||||||
CMenuOptionStringChooser::CMenuOptionStringChooser(const neutrino_locale_t OptionName, char* OptionValue, bool Active, CChangeObserver* Observ, const neutrino_msg_t DirectKey, const std::string & IconName, bool Pulldown)
|
CMenuOptionStringChooser::CMenuOptionStringChooser(const neutrino_locale_t OptionName, char* OptionValue, bool Active, CChangeObserver* Observ, const neutrino_msg_t DirectKey, const std::string & IconName, bool Pulldown)
|
||||||
{
|
{
|
||||||
height = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight();
|
height = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight();
|
||||||
optionName = OptionName;
|
optionNameString = g_Locale->getText(OptionName);
|
||||||
|
optionName = OptionName;
|
||||||
|
active = Active;
|
||||||
|
optionValue = OptionValue;
|
||||||
|
observ = Observ;
|
||||||
|
|
||||||
|
directKey = DirectKey;
|
||||||
|
iconName = IconName;
|
||||||
|
can_arrow = true;
|
||||||
|
pulldown = Pulldown;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMenuOptionStringChooser::CMenuOptionStringChooser(const char* OptionName, char* OptionValue, bool Active, CChangeObserver* Observ, const neutrino_msg_t DirectKey, const std::string & IconName, bool Pulldown)
|
||||||
|
{
|
||||||
|
height = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight();
|
||||||
|
optionNameString = OptionName;
|
||||||
|
optionName = NONEXISTANT_LOCALE;
|
||||||
active = Active;
|
active = Active;
|
||||||
optionValue = OptionValue;
|
optionValue = OptionValue;
|
||||||
observ = Observ;
|
observ = Observ;
|
||||||
@@ -1495,7 +1511,7 @@ int CMenuOptionStringChooser::exec(CMenuTarget* parent)
|
|||||||
if (parent)
|
if (parent)
|
||||||
parent->hide();
|
parent->hide();
|
||||||
|
|
||||||
CMenuWidget* menu = new CMenuWidget(optionName, NEUTRINO_ICON_SETTINGS);
|
CMenuWidget* menu = new CMenuWidget(optionNameString.c_str(), NEUTRINO_ICON_SETTINGS);
|
||||||
menu->addIntroItems(NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, CMenuWidget::BTN_TYPE_CANCEL);
|
menu->addIntroItems(NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, CMenuWidget::BTN_TYPE_CANCEL);
|
||||||
//if(parent) menu->move(20, 0);
|
//if(parent) menu->move(20, 0);
|
||||||
CMenuSelectorTarget * selector = new CMenuSelectorTarget(&select);
|
CMenuSelectorTarget * selector = new CMenuSelectorTarget(&select);
|
||||||
@@ -1544,7 +1560,7 @@ int CMenuOptionStringChooser::exec(CMenuTarget* parent)
|
|||||||
|
|
||||||
int CMenuOptionStringChooser::paint( bool selected )
|
int CMenuOptionStringChooser::paint( bool selected )
|
||||||
{
|
{
|
||||||
const char * l_optionName = g_Locale->getText(optionName);
|
const char * l_optionName = optionNameString.c_str();
|
||||||
|
|
||||||
//paint item
|
//paint item
|
||||||
prepareItem(selected, height);
|
prepareItem(selected, height);
|
||||||
|
@@ -355,6 +355,7 @@ class CMenuOptionChooser : public CAbstractMenuOptionChooser
|
|||||||
class CMenuOptionStringChooser : public CMenuItem
|
class CMenuOptionStringChooser : public CMenuItem
|
||||||
{
|
{
|
||||||
neutrino_locale_t optionName;
|
neutrino_locale_t optionName;
|
||||||
|
std::string optionNameString;
|
||||||
int height;
|
int height;
|
||||||
char * optionValue;
|
char * optionValue;
|
||||||
std::vector<std::string> options;
|
std::vector<std::string> options;
|
||||||
@@ -363,6 +364,8 @@ class CMenuOptionStringChooser : public CMenuItem
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
CMenuOptionStringChooser(const neutrino_locale_t OptionName, char* OptionValue, bool Active = false, CChangeObserver* Observ = NULL, const neutrino_msg_t DirectKey = CRCInput::RC_nokey, const std::string & IconName= "", bool Pulldown = false);
|
CMenuOptionStringChooser(const neutrino_locale_t OptionName, char* OptionValue, bool Active = false, CChangeObserver* Observ = NULL, const neutrino_msg_t DirectKey = CRCInput::RC_nokey, const std::string & IconName= "", bool Pulldown = false);
|
||||||
|
CMenuOptionStringChooser(const char* OptionName, char* OptionValue, bool Active = false, CChangeObserver* Observ = NULL, const neutrino_msg_t DirectKey = CRCInput::RC_nokey, const std::string & IconName= "", bool Pulldown = false);
|
||||||
|
|
||||||
~CMenuOptionStringChooser();
|
~CMenuOptionStringChooser();
|
||||||
|
|
||||||
void addOption(const char * value);
|
void addOption(const char * value);
|
||||||
|
Reference in New Issue
Block a user