FireBirdLib - Topfield TMS PVR TAP Programming Library
OSDMenuFindPreviousSelectableEntry.c
Go to the documentation of this file.
1
#include "
FBLib_TMSOSDMenu.h
"
2
3
int
OSDMenuFindPreviousSelectableEntry
(
int
CurrentSelection)
4
{
5
TRACEENTER
();
6
7
tMenu
*pMenu;
8
int
i, Cnt;
9
10
pMenu = &
Menu
[
CurrentMenuLevel
];
11
12
if
((CurrentSelection < 0) && !pMenu->
ScrollLoop
)
13
{
14
TRACEEXIT
();
15
return
-1;
16
}
17
18
//Count the number of selectable EndMessageWin
19
Cnt = 0;
20
for
(i = 0; i < pMenu->
NrItems
; i++)
21
{
22
if
(pMenu->
Item
[i].
Selectable
) Cnt++;
23
}
24
if
(Cnt == 0)
25
{
26
TRACEEXIT
();
27
return
-1;
28
}
29
30
do
31
{
32
CurrentSelection--;
33
if
(CurrentSelection < 0)
34
{
35
if
(pMenu->
ScrollLoop
)
36
CurrentSelection = pMenu->
NrItems
- 1;
37
else
38
{
39
TRACEEXIT
();
40
return
-1;
41
}
42
}
43
}
while
(!pMenu->
Item
[CurrentSelection].
Selectable
);
44
45
46
TRACEEXIT
();
47
return
CurrentSelection;
48
}
FBLib_TMSOSDMenu.h
Menu
tMenu Menu[NRMENULEVELS]
Definition:
OSDMenuInit.c:6
CurrentMenuLevel
dword CurrentMenuLevel
Definition:
OSDMenuInit.c:7
OSDMenuFindPreviousSelectableEntry
int OSDMenuFindPreviousSelectableEntry(int CurrentSelection)
Definition:
OSDMenuFindPreviousSelectableEntry.c:3
TRACEEXIT
#define TRACEEXIT()
Definition:
libFireBird.h:1244
TRACEENTER
#define TRACEENTER()
Definition:
libFireBird.h:1243
tItem::Selectable
bool Selectable
Definition:
FBLib_TMSOSDMenu.h:40
tMenu
Definition:
FBLib_TMSOSDMenu.h:67
tMenu::Item
tItem * Item
Definition:
FBLib_TMSOSDMenu.h:71
tMenu::NrItems
int NrItems
Definition:
FBLib_TMSOSDMenu.h:72
tMenu::ScrollLoop
bool ScrollLoop
Definition:
FBLib_TMSOSDMenu.h:80
TMSOSDMenu
OSDMenuFindPreviousSelectableEntry.c
Generated on Fri Apr 29 2022 13:34:01 for FireBirdLib - Topfield TMS PVR TAP Programming Library by
1.9.3