widget/menu.*: add keyval_ext type

instead of adding unneeded default values to all menuchooser options
just to cater for two special cases, add an extra version that does
not need a locale setting but instead takes a char* instead.

git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@129 e54a6e83-5905-42d5-8d5c-058d10e6a962
This commit is contained in:
seife
2009-12-31 09:34:53 +00:00
parent 7a554d8f54
commit 7dcf8fe14d
12 changed files with 373 additions and 295 deletions

View File

@@ -223,23 +223,44 @@ class CMenuOptionNumberChooser : public CAbstractMenuOptionChooser
class CMenuOptionChooser : public CAbstractMenuOptionChooser
{
public:
struct keyval_ext
{
int key;
neutrino_locale_t value;
const char *valname;
};
struct keyval
{
const int key;
const neutrino_locale_t value;
const char * valname;
};
private:
const struct keyval * options;
std::vector<keyval_ext> options;
unsigned number_of_options;
CChangeObserver * observ;
std::string optionNameString;
bool pulldown;
public:
CMenuOptionChooser(const neutrino_locale_t OptionName, int * const OptionValue, const struct keyval * const Options, const unsigned Number_Of_Options, const bool Active = false, CChangeObserver * const Observ = NULL, const neutrino_msg_t DirectKey = CRCInput::RC_nokey, const std::string & IconName= "", bool Pulldown = false);
CMenuOptionChooser(const char* OptionName, int * const OptionValue, const struct keyval * const Options, const unsigned Number_Of_Options, const bool Active = false, CChangeObserver * const Observ = NULL, const neutrino_msg_t DirectKey = CRCInput::RC_nokey, const std::string & IconName= "", bool Pulldown = false);
CMenuOptionChooser(const neutrino_locale_t OptionName, int * const OptionValue, const struct keyval * const Options,
const unsigned Number_Of_Options, const bool Active = false, CChangeObserver * const Observ = NULL,
const neutrino_msg_t DirectKey = CRCInput::RC_nokey, const std::string & IconName= "",
bool Pulldown = false);
CMenuOptionChooser(const neutrino_locale_t OptionName, int * const OptionValue, const struct keyval_ext * const Options,
const unsigned Number_Of_Options, const bool Active = false, CChangeObserver * const Observ = NULL,
const neutrino_msg_t DirectKey = CRCInput::RC_nokey, const std::string & IconName= "",
bool Pulldown = false);
CMenuOptionChooser(const char* OptionName, int * const OptionValue, const struct keyval * const Options,
const unsigned Number_Of_Options, const bool Active = false, CChangeObserver * const Observ = NULL,
const neutrino_msg_t DirectKey = CRCInput::RC_nokey, const std::string & IconName= "",
bool Pulldown = false);
CMenuOptionChooser(const char* OptionName, int * const OptionValue, const struct keyval_ext * const Options,
const unsigned Number_Of_Options, const bool Active = false, CChangeObserver * const Observ = NULL,
const neutrino_msg_t DirectKey = CRCInput::RC_nokey, const std::string & IconName= "",
bool Pulldown = false);
~CMenuOptionChooser();
void setOptionValue(const int newvalue);
int getOptionValue(void) const;