CMenuItem: add members set/get info icon inside menu items

This commit is contained in:
2017-09-17 13:49:56 +02:00
parent be671bcdc9
commit f0660dc66c
2 changed files with 10 additions and 5 deletions

View File

@@ -69,10 +69,7 @@ CMenuItem::CMenuItem(bool Active, neutrino_msg_t DirectKey, const char * const I
else else
setIconName(); setIconName();
if (IconName_Info_right && *IconName_Info_right) setInfoIconRight(IconName_Info_right);
iconName_Info_right = IconName_Info_right;
else
iconName_Info_right = NULL;
hintIcon = NULL; hintIcon = NULL;
@@ -156,6 +153,13 @@ void CMenuItem::disableByCondition(const menu_item_disable_cond_t& condition)
} }
} }
void CMenuItem::setInfoIconRight(const char * const IconName_Info_right){
if (IconName_Info_right && *IconName_Info_right)
iconName_Info_right = IconName_Info_right;
else
iconName_Info_right = NULL;
}
void CMenuItem::setMarked(const bool Marked) void CMenuItem::setMarked(const bool Marked)
{ {
marked = Marked; marked = Marked;

View File

@@ -197,6 +197,8 @@ class CMenuItem : public CComponentsSignals
void activateNotify(void); void activateNotify(void);
virtual void disableByCondition(const menu_item_disable_cond_t& condition); virtual void disableByCondition(const menu_item_disable_cond_t& condition);
void setParentWidget(CMenuWidget* parent){parent_widget = parent;} void setParentWidget(CMenuWidget* parent){parent_widget = parent;}
void setInfoIconRight(const char * const IconName_Info_right);
const char* getInfoIconRight(){return iconName_Info_right;}
}; };
class CMenuSeparator : public CMenuItem class CMenuSeparator : public CMenuItem
@@ -689,7 +691,6 @@ class CLockedMenuForwarder : public CMenuForwarder, public CPINProtection
: CMenuForwarder(Text, Active, Option, Target, ActionKey, DirectKey, IconName, IconName_Info_right) ,CPINProtection(_validPIN) : CMenuForwarder(Text, Active, Option, Target, ActionKey, DirectKey, IconName, IconName_Info_right) ,CPINProtection(_validPIN)
{ {
Ask = ask; Ask = ask;
//if we in ask mode then show NEUTRINO_ICON_SCRAMBLED as default info icon or no icon, //if we in ask mode then show NEUTRINO_ICON_SCRAMBLED as default info icon or no icon,
//but use always an info icon if defined in parameter 'IconName_Info_right' //but use always an info icon if defined in parameter 'IconName_Info_right'
if (IconName_Info_right || ask) if (IconName_Info_right || ask)