FireBirdLib - Topfield TMS PVR TAP Programming Library
OSDMenuSelectItem.c
Go to the documentation of this file.
1#include "FBLib_TMSOSDMenu.h"
2
3bool OSDMenuSelectItem(int ItemIndex)
4{
6
7 tMenu *pMenu;
8
9 pMenu = &Menu[CurrentMenuLevel];
10
11 if(pMenu->NrItems == 0)
12 {
13 TRACEEXIT();
14 return FALSE;
15 }
16
17 if(ItemIndex < 0) ItemIndex = 0;
18 if(ItemIndex >= (int)pMenu->NrItems) ItemIndex = (int)pMenu->NrItems - 1;
19
20 if(ItemIndex != (int)pMenu->CurrentSelection)
21 {
22 if(!pMenu->Item[ItemIndex].Selectable)
23 {
24 TRACEEXIT();
25 return FALSE;
26 }
27
28 pMenu->CurrentSelection = ItemIndex;
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 OSDMenuSelectItem(int ItemIndex)
#define TRACEEXIT()
Definition: libFireBird.h:1244
#define TRACEENTER()
Definition: libFireBird.h:1243
bool Selectable
int CurrentSelection
tItem * Item