mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-28 16:01:20 +02:00
merge neutrino-mp menu/buttons/icons changes, (C) martii
This commit is contained in:
@@ -39,12 +39,12 @@
|
||||
#include <driver/framebuffer.h>
|
||||
#include <driver/rcinput.h>
|
||||
#include <system/localize.h>
|
||||
#include <gui/widget/buttons.h>
|
||||
#include <gui/widget/icons.h>
|
||||
#include <gui/color.h>
|
||||
#include <gui/components/cc.h>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#if ENABLE_LUA
|
||||
extern "C" {
|
||||
#include <lua.h>
|
||||
@@ -73,7 +73,7 @@ class CChangeObserver
|
||||
{
|
||||
public:
|
||||
virtual ~CChangeObserver(){}
|
||||
virtual bool changeNotify(const neutrino_locale_t /*OptionName*/, void */*Data*/)
|
||||
virtual bool changeNotify(const neutrino_locale_t /*OptionName*/, void * /*Data*/)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -101,6 +101,8 @@ class CMenuTarget
|
||||
|
||||
class CMenuItem
|
||||
{
|
||||
private:
|
||||
void setIconName();
|
||||
protected:
|
||||
int x, y, dx, offx, name_start_x, icon_frame_w;
|
||||
bool used;
|
||||
@@ -108,28 +110,32 @@ class CMenuItem
|
||||
|
||||
void initItemColors(const bool select_mode);
|
||||
#if ENABLE_LUA
|
||||
lua_State *luaState;
|
||||
std::string luaAction;
|
||||
std::string luaId;
|
||||
lua_State *luaState;
|
||||
std::string luaAction;
|
||||
std::string luaId;
|
||||
#endif
|
||||
neutrino_locale_t name;
|
||||
std::string nameString;
|
||||
|
||||
neutrino_locale_t name;
|
||||
std::string nameString;
|
||||
neutrino_locale_t desc;
|
||||
std::string descString;
|
||||
public:
|
||||
bool active;
|
||||
bool marked;
|
||||
int height;
|
||||
bool active;
|
||||
bool marked;
|
||||
bool inert;
|
||||
bool isStatic;
|
||||
bool directKeyOK;
|
||||
neutrino_msg_t directKey;
|
||||
neutrino_msg_t msg;
|
||||
std::string iconName;
|
||||
std::string selected_iconName;
|
||||
std::string iconName_Info_right;
|
||||
std::string hintIcon;
|
||||
const char * iconName;
|
||||
const char * selected_iconName;
|
||||
const char * iconName_Info_right;
|
||||
const char * hintIcon;
|
||||
std::string hintText;
|
||||
neutrino_locale_t hint;
|
||||
|
||||
CMenuItem();
|
||||
CMenuItem(bool Active = true, neutrino_msg_t DirectKey = CRCInput::RC_nokey, const char * const IconName= NULL, const char * const IconName_Info_right = NULL, bool IsStatic = false);
|
||||
|
||||
virtual ~CMenuItem(){}
|
||||
|
||||
virtual void isUsed(void)
|
||||
@@ -140,17 +146,14 @@ class CMenuItem
|
||||
virtual void init(const int X, const int Y, const int DX, const int OFFX);
|
||||
|
||||
virtual int paint (bool selected = false) = 0;
|
||||
virtual int getHeight(void) const = 0;
|
||||
virtual int getHeight(void);
|
||||
virtual int getWidth(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
virtual int getYPosition(void) const { return y; }
|
||||
|
||||
virtual bool isSelectable(void) const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
virtual bool isSelectable(void) const { return active; }
|
||||
|
||||
virtual int exec(CMenuTarget* /*parent*/)
|
||||
{
|
||||
@@ -160,34 +163,35 @@ class CMenuItem
|
||||
virtual void setMarked(const bool Marked);
|
||||
virtual void setInert(const bool Inert);
|
||||
|
||||
virtual void paintItemButton(const bool select_mode, const int &item_height, const std::string& icon_Name = NEUTRINO_ICON_BUTTON_RIGHT);
|
||||
virtual void paintItemButton(const bool select_mode, int item_height, const char * const icon_Name = NEUTRINO_ICON_BUTTON_RIGHT);
|
||||
|
||||
virtual void prepareItem(const bool select_mode, const int &item_height);
|
||||
|
||||
virtual void setItemButton(const std::string& icon_Name, const bool is_select_button = false);
|
||||
virtual void setItemButton(const char * const icon_Name, const bool is_select_button = false);
|
||||
|
||||
virtual void paintItemCaption(const bool select_mode, const int &item_height, const char * left_text=NULL, const char * right_text=NULL, const fb_pixel_t right_bgcol=0);
|
||||
virtual void paintItemCaption(const bool select_mode, const char * right_text=NULL, const fb_pixel_t right_bgcol=0);
|
||||
|
||||
virtual void paintItemSlider( const bool select_mode, const int &item_height, const int &optionvalue, const int &factor, const char * left_text=NULL, const char * right_text=NULL);
|
||||
|
||||
virtual int isMenueOptionChooser(void) const{return 0;}
|
||||
void setHint(const std::string icon, const neutrino_locale_t text) { hintIcon = icon; hint = text; }
|
||||
void setHint(const std::string icon, const std::string text) { hintIcon = icon; hintText = text; }
|
||||
|
||||
void setHint(const char * const icon, const neutrino_locale_t text) { hintIcon = (icon && *icon) ? icon : NULL; hint = text; }
|
||||
void setHint(const char * const icon, const std::string text) { hintIcon = (icon && *icon) ? icon : NULL; hintText = text; }
|
||||
#if ENABLE_LUA
|
||||
void setLua(lua_State *_luaState, std::string &_luaAction, std::string &_luaId) { luaState = _luaState; luaAction = _luaAction; luaId = _luaId; };
|
||||
#endif
|
||||
virtual const char *getName();
|
||||
virtual void setName(const std::string& text);
|
||||
virtual void setName(const neutrino_locale_t text);
|
||||
|
||||
virtual const char *getDescription();
|
||||
virtual void setDescription(const std::string& text);
|
||||
virtual void setDescription(const neutrino_locale_t text);
|
||||
virtual int getDescriptionHeight(void);
|
||||
};
|
||||
|
||||
class CMenuSeparator : public CMenuItem
|
||||
{
|
||||
private:
|
||||
int type;
|
||||
void initVarMenuSeparator( const int Type,
|
||||
const std::string& string_Text,
|
||||
const neutrino_locale_t locale_Text,
|
||||
bool IsStatic);
|
||||
|
||||
public:
|
||||
|
||||
@@ -204,15 +208,14 @@ class CMenuSeparator : public CMenuItem
|
||||
|
||||
|
||||
CMenuSeparator(const int Type = 0, const neutrino_locale_t Text = NONEXISTANT_LOCALE, bool IsStatic = false);
|
||||
CMenuSeparator(const int Type, const std::string& Text, bool IsStatic = false);
|
||||
CMenuSeparator(const int Type, const std::string Text, bool IsStatic = false);
|
||||
virtual ~CMenuSeparator(){}
|
||||
|
||||
int paint(bool selected=false);
|
||||
int getHeight(void) const;
|
||||
int getHeight(void);
|
||||
int getWidth(void);
|
||||
|
||||
void setName(const std::string& text);
|
||||
void setName(const neutrino_locale_t text);
|
||||
bool isSelectable(void) const { return false; }
|
||||
};
|
||||
|
||||
class CMenuForwarder : public CMenuItem
|
||||
@@ -220,125 +223,57 @@ class CMenuForwarder : public CMenuItem
|
||||
std::string actionKey;
|
||||
|
||||
protected:
|
||||
const char * option;
|
||||
const std::string * option_string;
|
||||
std::string option_string;
|
||||
const std::string * option_string_ptr;
|
||||
CMenuTarget * jumpTarget;
|
||||
|
||||
virtual std::string getOption(void);
|
||||
|
||||
void initVarMenuForwarder( const std::string& string_text,
|
||||
const neutrino_locale_t& locale_text,
|
||||
const bool Active,
|
||||
const std::string * Option_string,
|
||||
const char * const Option_cstring,
|
||||
CMenuTarget* Target,
|
||||
const char * const ActionKey,
|
||||
neutrino_msg_t DirectKey,
|
||||
const char * const IconName,
|
||||
const char * const IconName_Info_right,
|
||||
bool IsStatic);
|
||||
|
||||
public:
|
||||
|
||||
CMenuForwarder( const neutrino_locale_t Text,
|
||||
const bool Active,
|
||||
const std::string &Option,
|
||||
CMenuTarget* Target=NULL,
|
||||
const char * const ActionKey = NULL,
|
||||
const neutrino_msg_t DirectKey = CRCInput::RC_nokey,
|
||||
const char * const IconName = NULL,
|
||||
const char * const IconName_Info_right = NULL,
|
||||
bool IsStatic = false);
|
||||
|
||||
CMenuForwarder( const std::string& Text,
|
||||
const bool Active,
|
||||
const std::string &Option,
|
||||
CMenuTarget* Target=NULL,
|
||||
const char * const ActionKey = NULL,
|
||||
const neutrino_msg_t DirectKey = CRCInput::RC_nokey,
|
||||
const char * const IconName = NULL,
|
||||
const char * const IconName_Info_right = NULL,
|
||||
bool IsStatic = false);
|
||||
|
||||
CMenuForwarder( const neutrino_locale_t Text,
|
||||
const bool Active = true,
|
||||
const char * const Option=NULL,
|
||||
CMenuTarget* Target=NULL,
|
||||
const char * const ActionKey = NULL,
|
||||
const neutrino_msg_t DirectKey = CRCInput::RC_nokey,
|
||||
const char * const IconName = NULL,
|
||||
const char * const IconName_Info_right = NULL,
|
||||
bool IsStatic = false);
|
||||
|
||||
CMenuForwarder( const std::string& Text,
|
||||
const bool Active = true,
|
||||
const char * const Option=NULL,
|
||||
CMenuTarget* Target=NULL,
|
||||
const char * const ActionKey = NULL,
|
||||
const neutrino_msg_t DirectKey = CRCInput::RC_nokey,
|
||||
const char * const IconName = NULL,
|
||||
const char * const IconName_Info_right = NULL,
|
||||
bool IsStatic = false);
|
||||
|
||||
CMenuForwarder(const neutrino_locale_t Text, const bool Active, const std::string &Option,
|
||||
CMenuTarget* Target=NULL, const char * const ActionKey = NULL, const neutrino_msg_t DirectKey = CRCInput::RC_nokey,
|
||||
const char * const IconName = NULL, const char * const IconName_Info_right = NULL, bool IsStatic = false);
|
||||
CMenuForwarder(const std::string & Text, const bool Active, const std::string &Option,
|
||||
CMenuTarget* Target=NULL, const char * const ActionKey = NULL, const neutrino_msg_t DirectKey = CRCInput::RC_nokey,
|
||||
const char * const IconName = NULL, const char * const IconName_Info_right = NULL, bool IsStatic = false);
|
||||
CMenuForwarder(const neutrino_locale_t Text, const bool Active = true, const char * const Option=NULL,
|
||||
CMenuTarget* Target=NULL, const char * const ActionKey = NULL, const neutrino_msg_t DirectKey = CRCInput::RC_nokey,
|
||||
const char * const IconName = NULL, const char * const IconName_Info_right = NULL, bool IsStatic = false);
|
||||
CMenuForwarder(const std::string & Text, const bool Active = true, const char * const Option=NULL,
|
||||
CMenuTarget* Target=NULL, const char * const ActionKey = NULL, const neutrino_msg_t DirectKey = CRCInput::RC_nokey,
|
||||
const char * const IconName = NULL, const char * const IconName_Info_right = NULL, bool IsStatic = false);
|
||||
|
||||
virtual ~CMenuForwarder(){}
|
||||
|
||||
int paint(bool selected=false);
|
||||
int getHeight(void) const;
|
||||
int getWidth(void);
|
||||
neutrino_locale_t getTextLocale() const {return name;}
|
||||
CMenuTarget* getTarget() const {return jumpTarget;}
|
||||
const char *getActionKey(){return actionKey.c_str();}
|
||||
|
||||
int exec(CMenuTarget* parent);
|
||||
bool isSelectable(void) const { return active; }
|
||||
void setOption(const std::string &Option);
|
||||
void setOption(const char * const Option);
|
||||
void setName(const std::string& text);
|
||||
void setName(const neutrino_locale_t text);
|
||||
};
|
||||
|
||||
class CMenuDForwarder : public CMenuForwarder
|
||||
{
|
||||
public:
|
||||
CMenuDForwarder(const neutrino_locale_t Text,
|
||||
const bool Active,
|
||||
const std::string &Option,
|
||||
CMenuTarget* Target=NULL,
|
||||
const char * const ActionKey = NULL,
|
||||
const neutrino_msg_t DirectKey = CRCInput::RC_nokey,
|
||||
const char * const IconName = NULL,
|
||||
const char * const IconName_Info_right = NULL)
|
||||
CMenuDForwarder(const neutrino_locale_t Text, const bool Active, const std::string &Option,
|
||||
CMenuTarget* Target=NULL, const char * const ActionKey = NULL, const neutrino_msg_t DirectKey = CRCInput::RC_nokey,
|
||||
const char * const IconName = NULL, const char * const IconName_Info_right = NULL)
|
||||
: CMenuForwarder(Text, Active, Option, Target, ActionKey, DirectKey, IconName, IconName_Info_right) { };
|
||||
|
||||
CMenuDForwarder(const std::string& Text,
|
||||
const bool Active,
|
||||
const std::string &Option,
|
||||
CMenuTarget* Target=NULL,
|
||||
const char * const ActionKey = NULL,
|
||||
const neutrino_msg_t DirectKey = CRCInput::RC_nokey,
|
||||
const char * const IconName = NULL,
|
||||
const char * const IconName_Info_right = NULL)
|
||||
CMenuDForwarder(const std::string & Text, const bool Active, const std::string &Option,
|
||||
CMenuTarget* Target=NULL, const char * const ActionKey = NULL, const neutrino_msg_t DirectKey = CRCInput::RC_nokey,
|
||||
const char * const IconName = NULL, const char * const IconName_Info_right = NULL)
|
||||
: CMenuForwarder(Text, Active, Option, Target, ActionKey, DirectKey, IconName, IconName_Info_right) { };
|
||||
|
||||
CMenuDForwarder(const neutrino_locale_t Text,
|
||||
const bool Active=true,
|
||||
const char * const Option=NULL,
|
||||
CMenuTarget* Target=NULL,
|
||||
const char * const ActionKey = NULL,
|
||||
const neutrino_msg_t DirectKey = CRCInput::RC_nokey,
|
||||
const char * const IconName = NULL,
|
||||
const char * const IconName_Info_right = NULL)
|
||||
CMenuDForwarder(const neutrino_locale_t Text, const bool Active=true, const char * const Option=NULL,
|
||||
CMenuTarget* Target=NULL, const char * const ActionKey = NULL, const neutrino_msg_t DirectKey = CRCInput::RC_nokey,
|
||||
const char * const IconName = NULL, const char * const IconName_Info_right = NULL)
|
||||
: CMenuForwarder(Text, Active, Option, Target, ActionKey, DirectKey, IconName, IconName_Info_right) { };
|
||||
|
||||
CMenuDForwarder(const std::string& Text,
|
||||
bool Active=true,
|
||||
const char * const Option=NULL,
|
||||
CMenuTarget* Target=NULL,
|
||||
const char * const ActionKey = NULL,
|
||||
const neutrino_msg_t DirectKey = CRCInput::RC_nokey,
|
||||
const char * const IconName = NULL,
|
||||
const char * const IconName_Info_right = NULL)
|
||||
CMenuDForwarder(const std::string & Text, const bool Active=true, const char * const Option=NULL,
|
||||
CMenuTarget* Target=NULL, const char * const ActionKey = NULL, const neutrino_msg_t DirectKey = CRCInput::RC_nokey,
|
||||
const char * const IconName = NULL, const char * const IconName_Info_right = NULL)
|
||||
: CMenuForwarder(Text, Active, Option, Target, ActionKey, DirectKey, IconName, IconName_Info_right) { };
|
||||
|
||||
~CMenuDForwarder() { delete jumpTarget; }
|
||||
@@ -347,17 +282,11 @@ class CMenuDForwarder : public CMenuForwarder
|
||||
class CAbstractMenuOptionChooser : public CMenuItem
|
||||
{
|
||||
protected:
|
||||
int height;
|
||||
int * optionValue;
|
||||
|
||||
int getHeight(void) const{return height;}
|
||||
|
||||
bool isSelectable(void) const{return active;}
|
||||
public:
|
||||
CAbstractMenuOptionChooser()
|
||||
CAbstractMenuOptionChooser(bool Active, const neutrino_msg_t DirectKey, const char * const IconName, const char *const IconName_Info_right = NULL, bool IsStatic = false) : CMenuItem(Active, DirectKey, IconName, IconName_Info_right, IsStatic)
|
||||
{
|
||||
name = NONEXISTANT_LOCALE;
|
||||
height = 0;
|
||||
optionValue = NULL;
|
||||
}
|
||||
~CAbstractMenuOptionChooser(){}
|
||||
@@ -380,40 +309,17 @@ private:
|
||||
std::string numberFormat;
|
||||
std::string (*numberFormatFunction)(int num);
|
||||
|
||||
void initMenuOptionNumberChooser( const std::string &s_name,
|
||||
const neutrino_locale_t l_name,
|
||||
int * const OptionValue,
|
||||
const bool Active,
|
||||
const int min_value,
|
||||
const int max_value,
|
||||
CChangeObserver * const Observ,
|
||||
const int print_offset,
|
||||
const int special_value,
|
||||
const neutrino_locale_t special_value_name,
|
||||
bool sliderOn);
|
||||
|
||||
public:
|
||||
CMenuOptionNumberChooser(const neutrino_locale_t name,
|
||||
int * const OptionValue,
|
||||
const bool Active,
|
||||
const int min_value,
|
||||
const int max_value,
|
||||
CChangeObserver * const Observ = NULL,
|
||||
const int print_offset = 0,
|
||||
const int special_value = 0,
|
||||
const neutrino_locale_t special_value_name = NONEXISTANT_LOCALE,
|
||||
bool sliderOn = false );
|
||||
|
||||
CMenuOptionNumberChooser(const std::string &name,
|
||||
int * const OptionValue,
|
||||
const bool Active,
|
||||
const int min_value,
|
||||
const int max_value,
|
||||
CChangeObserver * const Observ = NULL,
|
||||
const int print_offset = 0,
|
||||
const int special_value = 0,
|
||||
const neutrino_locale_t special_value_name = NONEXISTANT_LOCALE,
|
||||
bool sliderOn = false );
|
||||
CMenuOptionNumberChooser(const neutrino_locale_t name, int * const OptionValue, const bool Active,
|
||||
const int min_value, const int max_value, CChangeObserver * const Observ = NULL,
|
||||
const neutrino_msg_t DirectKey = CRCInput::RC_nokey, const char * const IconName = NULL,
|
||||
const int print_offset = 0,
|
||||
const int special_value = 0, const neutrino_locale_t special_value_name = NONEXISTANT_LOCALE, bool sliderOn = false );
|
||||
CMenuOptionNumberChooser(const std::string &name, int * const OptionValue, const bool Active,
|
||||
const int min_value, const int max_value, CChangeObserver * const Observ = NULL,
|
||||
const neutrino_msg_t DirectKey = CRCInput::RC_nokey, const char * const IconName = NULL,
|
||||
const int print_offset = 0,
|
||||
const int special_value = 0, const neutrino_locale_t special_value_name = NONEXISTANT_LOCALE, bool sliderOn = false );
|
||||
|
||||
int paint(bool selected);
|
||||
|
||||
@@ -426,7 +332,7 @@ private:
|
||||
};
|
||||
|
||||
class CMenuOptionChooserOptions
|
||||
{
|
||||
{
|
||||
public:
|
||||
int key;
|
||||
std::string valname;
|
||||
@@ -447,168 +353,119 @@ struct CMenuOptionChooserCompareItem: public std::binary_function <const CMenuOp
|
||||
|
||||
class CMenuOptionChooser : public CAbstractMenuOptionChooser
|
||||
{
|
||||
public:
|
||||
struct keyval
|
||||
{
|
||||
const int key;
|
||||
const neutrino_locale_t value;
|
||||
};
|
||||
|
||||
struct keyval_ext
|
||||
{
|
||||
int key;
|
||||
neutrino_locale_t value;
|
||||
const char *valname;
|
||||
keyval_ext & operator=(const keyval &p)
|
||||
public:
|
||||
struct keyval
|
||||
{
|
||||
key = p.key;
|
||||
value = p.value;
|
||||
valname = NULL;
|
||||
return *this;
|
||||
}
|
||||
};
|
||||
const int key;
|
||||
const neutrino_locale_t value;
|
||||
};
|
||||
struct keyval_ext
|
||||
{
|
||||
int key;
|
||||
neutrino_locale_t value;
|
||||
const char *valname;
|
||||
keyval_ext & operator=(const keyval &p)
|
||||
{
|
||||
key = p.key;
|
||||
value = p.value;
|
||||
valname = NULL;
|
||||
return *this;
|
||||
}
|
||||
};
|
||||
|
||||
private:
|
||||
std::vector<keyval_ext> options;
|
||||
std::vector<CMenuOptionChooserOptions*> option_chooser_options_v;
|
||||
unsigned number_of_options;
|
||||
CChangeObserver * observ;
|
||||
bool pulldown;
|
||||
bool optionsSort;
|
||||
private:
|
||||
std::vector<keyval_ext> options;
|
||||
std::vector<CMenuOptionChooserOptions*> option_chooser_options_v;
|
||||
unsigned number_of_options;
|
||||
CChangeObserver * observ;
|
||||
bool pulldown;
|
||||
bool optionsSort;
|
||||
|
||||
void clearChooserOptions();
|
||||
void initVarOptionChooser( const std::string &OptionName,
|
||||
const neutrino_locale_t Name,
|
||||
int * const OptionValue,
|
||||
const bool Active,
|
||||
CChangeObserver * const Observ,
|
||||
neutrino_msg_t DirectKey,
|
||||
const std::string & IconName,
|
||||
bool Pulldown,
|
||||
bool OptionsSort
|
||||
void clearChooserOptions();
|
||||
void initVarOptionChooser( const std::string &OptionName,
|
||||
const neutrino_locale_t Name,
|
||||
int * const OptionValue,
|
||||
const bool Active,
|
||||
CChangeObserver * const Observ,
|
||||
neutrino_msg_t DirectKey,
|
||||
const char * IconName,
|
||||
bool Pulldown,
|
||||
bool OptionsSort
|
||||
);
|
||||
|
||||
public:
|
||||
CMenuOptionChooser( const neutrino_locale_t Name,
|
||||
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= "",
|
||||
|
||||
public:
|
||||
CMenuOptionChooser(const neutrino_locale_t Name, 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 char * const IconName = NULL,
|
||||
bool Pulldown = false, bool OptionsSort = false);
|
||||
CMenuOptionChooser(const neutrino_locale_t Name, 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 char * const IconName = NULL,
|
||||
bool Pulldown = false, bool OptionsSort = false);
|
||||
CMenuOptionChooser(const std::string &Name, 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 char * const IconName = NULL,
|
||||
bool Pulldown = false, bool OptionsSort = false);
|
||||
CMenuOptionChooser(const std::string &Name, 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 char * const IconName = NULL,
|
||||
bool Pulldown = false, bool OptionsSort = false);
|
||||
CMenuOptionChooser(const neutrino_locale_t Name, int * const OptionValue, std::vector<keyval_ext> &Options,
|
||||
const bool Active = false, CChangeObserver * const Observ = NULL,
|
||||
const neutrino_msg_t DirectKey = CRCInput::RC_nokey, const char * const IconName = NULL,
|
||||
bool Pulldown = false, bool OptionsSort = false);
|
||||
CMenuOptionChooser(const std::string &Name, int * const OptionValue, std::vector<keyval_ext> &Options,
|
||||
const bool Active = false, CChangeObserver * const Observ = NULL,
|
||||
const neutrino_msg_t DirectKey = CRCInput::RC_nokey, const char * const IconName = NULL,
|
||||
bool Pulldown = false, bool OptionsSort = false);
|
||||
~CMenuOptionChooser();
|
||||
|
||||
CMenuOptionChooser( const neutrino_locale_t Name,
|
||||
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,
|
||||
bool OptionsSort = false);
|
||||
void setOption(const int newvalue);
|
||||
int getOption(void) const;
|
||||
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);
|
||||
|
||||
CMenuOptionChooser( const std::string &Name,
|
||||
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,
|
||||
bool OptionsSort = false);
|
||||
int paint(bool selected);
|
||||
|
||||
CMenuOptionChooser( const std::string &Name,
|
||||
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,
|
||||
bool OptionsSort = false);
|
||||
|
||||
CMenuOptionChooser( const neutrino_locale_t Name,
|
||||
int * const OptionValue,
|
||||
std::vector<keyval_ext> &Options,
|
||||
const bool Active = false,
|
||||
CChangeObserver * const Observ = NULL,
|
||||
const neutrino_msg_t DirectKey = CRCInput::RC_nokey,
|
||||
const std::string & IconName= "",
|
||||
bool Pulldown = false,
|
||||
bool OptionsSort = false);
|
||||
|
||||
CMenuOptionChooser( const std::string &Name,
|
||||
int * const OptionValue,
|
||||
std::vector<keyval_ext> &Options,
|
||||
const bool Active = false,
|
||||
CChangeObserver * const Observ = NULL,
|
||||
const neutrino_msg_t DirectKey = CRCInput::RC_nokey,
|
||||
const std::string & IconName= "",
|
||||
bool Pulldown = false,
|
||||
bool OptionsSort = false);
|
||||
|
||||
~CMenuOptionChooser();
|
||||
|
||||
void setOption(const int newvalue);
|
||||
int getOption(void) const;
|
||||
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 exec(CMenuTarget* parent);
|
||||
int isMenueOptionChooser(void) const{return 1;}
|
||||
int exec(CMenuTarget* parent);
|
||||
int isMenueOptionChooser(void) const{return 1;}
|
||||
};
|
||||
|
||||
class CMenuOptionStringChooser : public CMenuItem
|
||||
{
|
||||
private:
|
||||
int height;
|
||||
std::string * optionValueString;
|
||||
std::string * optionValuePtr;
|
||||
std::string title;
|
||||
std::string optionValue;
|
||||
std::vector<std::string> options;
|
||||
CChangeObserver * observ;
|
||||
bool pulldown;
|
||||
|
||||
void initVarMenuOptionStringChooser( const std::string &string_Name,
|
||||
const neutrino_locale_t locale_Name,
|
||||
std::string* OptionValue,
|
||||
bool Active,
|
||||
CChangeObserver* Observ,
|
||||
const neutrino_msg_t DirectKey,
|
||||
const std::string & IconName,
|
||||
bool Pulldown);
|
||||
public:
|
||||
CMenuOptionStringChooser( const neutrino_locale_t Name,
|
||||
std::string* OptionValue,
|
||||
bool Active = false,
|
||||
CChangeObserver* Observ = NULL,
|
||||
const neutrino_msg_t DirectKey = CRCInput::RC_nokey,
|
||||
const std::string & IconName= "",
|
||||
bool Pulldown = false);
|
||||
|
||||
CMenuOptionStringChooser( const std::string &Name,
|
||||
std::string* 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 Name, std::string* OptionValue, bool Active = false,
|
||||
CChangeObserver* Observ = NULL, const neutrino_msg_t DirectKey = CRCInput::RC_nokey,
|
||||
const char * const IconName = NULL, bool Pulldown = false);
|
||||
CMenuOptionStringChooser(const std::string &Name, std::string* OptionValue, bool Active = false,
|
||||
CChangeObserver* Observ = NULL, const neutrino_msg_t DirectKey = CRCInput::RC_nokey,
|
||||
const char * const IconName = NULL, bool Pulldown = false);
|
||||
|
||||
~CMenuOptionStringChooser();
|
||||
|
||||
void addOption(const std::string &value);
|
||||
void removeOptions(){options.clear();};
|
||||
void removeOptions(){options.clear();}
|
||||
void setOptions(std::vector<std::string> &vec) { options = vec; }
|
||||
void setTitle(std::string &Title);
|
||||
void setTitle(const neutrino_locale_t Title);
|
||||
int paint(bool selected);
|
||||
int getHeight(void) const { return height; }
|
||||
bool isSelectable(void) const { return active; }
|
||||
void sortOptions();
|
||||
int exec(CMenuTarget* parent);
|
||||
int isMenueOptionChooser(void) const{return 1;}
|
||||
void setOptionValue(std::string &val) {
|
||||
if (!optionValuePtr) optionValuePtr = &optionValue;
|
||||
*optionValuePtr = val;
|
||||
}
|
||||
std::string getOptionValue() { return *optionValuePtr; }
|
||||
};
|
||||
|
||||
class CMenuGlobal
|
||||
@@ -633,7 +490,7 @@ class CMenuWidget : public CMenuTarget
|
||||
bool show_details_line;
|
||||
protected:
|
||||
std::string nameString;
|
||||
neutrino_locale_t name;
|
||||
neutrino_locale_t name;
|
||||
CFrameBuffer *frameBuffer;
|
||||
std::vector<CMenuItem*> items;
|
||||
std::vector<int> page_start;
|
||||
@@ -652,24 +509,24 @@ class CMenuWidget : public CMenuTarget
|
||||
int selected;
|
||||
int iconOffset;
|
||||
int sb_width;
|
||||
int sb_height;
|
||||
fb_pixel_t *background;
|
||||
int full_width, full_height;
|
||||
bool savescreen;
|
||||
bool has_hints; // is any items has hints
|
||||
bool hint_painted; // is hint painted
|
||||
|
||||
int fbutton_width;
|
||||
int fbutton_height;
|
||||
int fbutton_count;
|
||||
const struct button_label *fbutton_labels;
|
||||
|
||||
unsigned int item_start_y;
|
||||
unsigned int current_page;
|
||||
unsigned int total_pages;
|
||||
bool exit_pressed;
|
||||
bool from_wizard;
|
||||
bool fade;
|
||||
bool washidden;
|
||||
unsigned int item_start_y;
|
||||
unsigned int current_page;
|
||||
unsigned int total_pages;
|
||||
bool exit_pressed;
|
||||
bool from_wizard;
|
||||
bool fade;
|
||||
bool washidden;
|
||||
|
||||
void Init(const std::string & Icon, const int mwidth, const mn_widget_id_t &w_index);
|
||||
virtual void paintItems();
|
||||
@@ -682,7 +539,7 @@ class CMenuWidget : public CMenuTarget
|
||||
public:
|
||||
CMenuWidget();
|
||||
/* mwidth (minimum width) in percent of screen width */
|
||||
CMenuWidget(const char* Name, const std::string & Icon = "", const int mwidth = 30, const mn_widget_id_t &w_index = NO_WIDGET_ID);
|
||||
CMenuWidget(const std::string &Name, const std::string & Icon = "", const int mwidth = 30, const mn_widget_id_t &w_index = NO_WIDGET_ID);
|
||||
CMenuWidget(const neutrino_locale_t Name, const std::string & Icon = "", const int mwidth = 30, const mn_widget_id_t &w_index = NO_WIDGET_ID);
|
||||
~CMenuWidget();
|
||||
|
||||
@@ -690,10 +547,10 @@ class CMenuWidget : public CMenuTarget
|
||||
|
||||
enum
|
||||
{
|
||||
BTN_TYPE_BACK = 0,
|
||||
BTN_TYPE_CANCEL = 1,
|
||||
BTN_TYPE_NEXT = 3,
|
||||
BTN_TYPE_NO = -1
|
||||
BTN_TYPE_BACK = 0,
|
||||
BTN_TYPE_CANCEL = 1,
|
||||
BTN_TYPE_NEXT = 3,
|
||||
BTN_TYPE_NO = -1
|
||||
};
|
||||
virtual void addIntroItems(neutrino_locale_t subhead_text = NONEXISTANT_LOCALE, neutrino_locale_t section_text = NONEXISTANT_LOCALE, int buttontype = BTN_TYPE_BACK );
|
||||
bool hasItem();
|
||||
@@ -706,7 +563,7 @@ class CMenuWidget : public CMenuTarget
|
||||
virtual void paint();
|
||||
virtual void hide();
|
||||
virtual int exec(CMenuTarget* parent, const std::string & actionKey);
|
||||
virtual std::string getName();
|
||||
virtual const char *getName();
|
||||
void setSelected(const int &Preselected){ preselected = Preselected; };
|
||||
int getSelected()const { return selected; };
|
||||
void move(int xoff, int yoff);
|
||||
@@ -782,8 +639,6 @@ class CLockedMenuForwarder : public CMenuForwarder, public CPINProtection
|
||||
//but use always an info icon if defined in parameter 'IconName_Info_right'
|
||||
if (IconName_Info_right || ask)
|
||||
iconName_Info_right = IconName_Info_right ? IconName_Info_right : NEUTRINO_ICON_LOCK;
|
||||
else
|
||||
iconName_Info_right = "";
|
||||
};
|
||||
|
||||
virtual int exec(CMenuTarget* parent);
|
||||
@@ -791,12 +646,30 @@ class CLockedMenuForwarder : public CMenuForwarder, public CPINProtection
|
||||
|
||||
class CMenuSelectorTarget : public CMenuTarget
|
||||
{
|
||||
public:
|
||||
CMenuSelectorTarget(int *select) {m_select = select;};
|
||||
int exec(CMenuTarget* parent, const std::string & actionKey);
|
||||
public:
|
||||
CMenuSelectorTarget(int *select) {m_select = select;};
|
||||
int exec(CMenuTarget* parent, const std::string & actionKey);
|
||||
|
||||
private:
|
||||
int *m_select;
|
||||
private:
|
||||
int *m_select;
|
||||
};
|
||||
|
||||
class CMenuProgressbar : public CMenuItem
|
||||
{
|
||||
private:
|
||||
CProgressBar scale;
|
||||
void init (const neutrino_locale_t Loc, const std::string & Text);
|
||||
public:
|
||||
|
||||
CMenuProgressbar(const neutrino_locale_t Text);
|
||||
CMenuProgressbar(const std::string & Text);
|
||||
virtual ~CMenuProgressbar(){}
|
||||
|
||||
int paint(bool selected=false);
|
||||
int getWidth(void);
|
||||
int getHeight(void);
|
||||
int exec(CMenuTarget *parent);
|
||||
CProgressBar *getScale() { return &scale; }
|
||||
};
|
||||
|
||||
extern CMenuSeparator * const GenericMenuSeparator;
|
||||
|
Reference in New Issue
Block a user