mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-27 15:32:59 +02:00
gui/widget/menue.cpp: add CMenuOptionChooser::setOptions
This commit is contained in:
@@ -1350,9 +1350,7 @@ CMenuOptionChooser::CMenuOptionChooser(const neutrino_locale_t OptionName, int *
|
|||||||
for (unsigned int i = 0; i < number_of_options; i++)
|
for (unsigned int i = 0; i < number_of_options; i++)
|
||||||
{
|
{
|
||||||
struct keyval_ext opt;
|
struct keyval_ext opt;
|
||||||
opt.key = Options[i].key;
|
opt = Options[i];
|
||||||
opt.value = Options[i].value;
|
|
||||||
opt.valname = NULL;
|
|
||||||
options.push_back(opt);
|
options.push_back(opt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1373,9 +1371,7 @@ CMenuOptionChooser::CMenuOptionChooser(const std::string &OptionName, int * cons
|
|||||||
for (unsigned int i = 0; i < number_of_options; i++)
|
for (unsigned int i = 0; i < number_of_options; i++)
|
||||||
{
|
{
|
||||||
struct keyval_ext opt;
|
struct keyval_ext opt;
|
||||||
opt.key = Options[i].key;
|
opt = Options[i];
|
||||||
opt.value = Options[i].value;
|
|
||||||
opt.valname = NULL;
|
|
||||||
options.push_back(opt);
|
options.push_back(opt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1450,10 +1446,33 @@ CMenuOptionChooser::CMenuOptionChooser(const std::string &OptionName, int * cons
|
|||||||
|
|
||||||
CMenuOptionChooser::~CMenuOptionChooser()
|
CMenuOptionChooser::~CMenuOptionChooser()
|
||||||
{
|
{
|
||||||
options.clear();
|
|
||||||
clearChooserOptions();
|
clearChooserOptions();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CMenuOptionChooser::setOptions(const struct keyval * const Options, const unsigned Number_Of_Options)
|
||||||
|
{
|
||||||
|
options.clear();
|
||||||
|
number_of_options = Number_Of_Options;
|
||||||
|
for (unsigned int i = 0; i < number_of_options; i++)
|
||||||
|
{
|
||||||
|
struct keyval_ext opt;
|
||||||
|
opt = Options[i];
|
||||||
|
options.push_back(opt);
|
||||||
|
}
|
||||||
|
if (used && x != -1)
|
||||||
|
paint(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
void CMenuOptionChooser::setOptions(const struct keyval_ext * const Options, const unsigned Number_Of_Options)
|
||||||
|
{
|
||||||
|
options.clear();
|
||||||
|
number_of_options = Number_Of_Options;
|
||||||
|
for (unsigned int i = 0; i < number_of_options; i++)
|
||||||
|
options.push_back(Options[i]);
|
||||||
|
if (used && x != -1)
|
||||||
|
paint(false);
|
||||||
|
}
|
||||||
|
|
||||||
void CMenuOptionChooser::setOption(const int newvalue)
|
void CMenuOptionChooser::setOption(const int newvalue)
|
||||||
{
|
{
|
||||||
*optionValue = newvalue;
|
*optionValue = newvalue;
|
||||||
|
@@ -353,17 +353,24 @@ struct CMenuOptionChooserCompareItem: public std::binary_function <const CMenuOp
|
|||||||
class CMenuOptionChooser : public CAbstractMenuOptionChooser
|
class CMenuOptionChooser : public CAbstractMenuOptionChooser
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
struct keyval
|
||||||
|
{
|
||||||
|
const int key;
|
||||||
|
const neutrino_locale_t value;
|
||||||
|
};
|
||||||
|
|
||||||
struct keyval_ext
|
struct keyval_ext
|
||||||
{
|
{
|
||||||
int key;
|
int key;
|
||||||
neutrino_locale_t value;
|
neutrino_locale_t value;
|
||||||
const char *valname;
|
const char *valname;
|
||||||
};
|
keyval_ext & operator=(const keyval &p)
|
||||||
|
{
|
||||||
struct keyval
|
key = p.key;
|
||||||
{
|
value = p.value;
|
||||||
const int key;
|
valname = NULL;
|
||||||
const neutrino_locale_t value;
|
return *this;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@@ -406,6 +413,8 @@ class CMenuOptionChooser : public CAbstractMenuOptionChooser
|
|||||||
void setOption(const int newvalue);
|
void setOption(const int newvalue);
|
||||||
int getOption(void) const;
|
int getOption(void) const;
|
||||||
int getWidth(void);
|
int getWidth(void);
|
||||||
|
void setOptions(const struct keyval * const Options, const unsigned Number_Of_Options);
|
||||||
|
void setOptions(const struct keyval_ext * const Options, const unsigned Number_Of_Options);
|
||||||
|
|
||||||
int paint(bool selected);
|
int paint(bool selected);
|
||||||
std::string getOptionName()const {return nameString;};
|
std::string getOptionName()const {return nameString;};
|
||||||
|
Reference in New Issue
Block a user