Main Menu: try to add dynamic possibility to disable items on runtime

The issue is that it's not really possible to disable/enable menu items on
runtime with an existant menu widget instance eg with personalized menu items.

Here we need a dynamic solution to disable items depends on stb-mode (mode_ts, mode_tv etc)
This should be solved here with an additional parameter for personalized items.

New paramter is named: disable_condition
Possible alvailable values at the moment are:

  DCOND_MODE_NONE as default

  DCOND_MODE_TV
  DCOND_MODE_RADIO
  DCOND_MODE_TS

includes some improvements by Sven

- menue: remove old_iconName handling
  ... icons should be painted on deactivated items too

- menue: try to fix position <-> selection missmatch
This commit is contained in:
2015-12-13 16:06:38 +01:00
committed by M. Liebmann
parent 6b6dff36d6
commit 1f95f38d32
6 changed files with 127 additions and 44 deletions

View File

@@ -111,6 +111,7 @@ typedef struct menu_item_t
int* personalize_mode;
int item_mode;
CMenuItem *observer_Item;
int condition;
}menu_item_struct_t;
typedef struct observ_menu_item_t
@@ -242,8 +243,8 @@ class CPersonalizeGui : public CMenuTarget, public CChangeObserver, public CPINP
int getItemsCount(CMenuWidget *widget);
int getItemsCount(const int& widget_id);
void setShortcut(const int& short_cut = 1) {shortcut = short_cut;};
void addItem(CMenuWidget *widget, CMenuItem *menu_Item, const int *personalize_mode = NULL, const bool defaultselected = false, const int& item_mode = PERSONALIZE_SHOW_AS_ITEM_OPTION, CMenuItem *observer_Item = NULL);
void addItem(const int& widget_id, CMenuItem *menu_Item, const int *personalize_mode = NULL, const bool defaultselected = false, const int& item_mode = PERSONALIZE_SHOW_AS_ITEM_OPTION, CMenuItem *observer_Item = NULL);
void addItem(CMenuWidget *widget, CMenuItem *menu_Item, const int *personalize_mode = NULL, const bool defaultselected = false, const int& item_mode = PERSONALIZE_SHOW_AS_ITEM_OPTION, CMenuItem *observer_Item = NULL, const menu_item_disable_cond_t& disable_condition = DCOND_MODE_NONE );
void addItem(const int& widget_id, CMenuItem *menu_Item, const int *personalize_mode = NULL, const bool defaultselected = false, const int& item_mode = PERSONALIZE_SHOW_AS_ITEM_OPTION, CMenuItem *observer_Item = NULL, const menu_item_disable_cond_t& disable_condition = DCOND_MODE_NONE );
void addIntroItems(CMenuWidget *widget);
void addIntroItems(const int& widget_id);
void addSeparator(CMenuWidget &menu, const neutrino_locale_t locale_text = NONEXISTANT_LOCALE, const int& item_mode = PERSONALIZE_SHOW_AS_ITEM_OPTION);