FireBirdLib - Topfield TMS PVR TAP Programming Library
OSDMenuItemModifySelectable.c
Go to the documentation of this file.
1#include "FBLib_TMSOSDMenu.h"
2
3bool OSDMenuItemModifySelectable(int ItemIndex, bool Selectable)
4{
6
7 tMenu *pMenu;
8
9 pMenu = &Menu[CurrentMenuLevel];
10
11 if((ItemIndex < 0) || (ItemIndex >= pMenu->NrItems))
12 {
13 TRACEEXIT();
14 return FALSE;
15 }
16
17 pMenu->Item[ItemIndex].Selectable = Selectable;
18
19 if((pMenu->CurrentSelection == ItemIndex) && (Selectable == FALSE))
20 {
21 //TODO: check if there is at least one selectable item
22 // scroll up until hit
23 // else scroll down until hit
24 if(pMenu->CurrentSelection > 0)
25 pMenu->CurrentSelection--;
26 else
27 pMenu->CurrentSelection++;
28
29 ListDirty = TRUE;
30 }
31
32 TRACEEXIT();
33 return TRUE;
34}
tMenu Menu[NRMENULEVELS]
Definition: OSDMenuInit.c:6
dword CurrentMenuLevel
Definition: OSDMenuInit.c:7
bool ListDirty
bool OSDMenuItemModifySelectable(int ItemIndex, bool Selectable)
#define TRACEEXIT()
Definition: libFireBird.h:1244
#define TRACEENTER()
Definition: libFireBird.h:1243
bool Selectable
int CurrentSelection
tItem * Item