FireBirdLib - Topfield TMS PVR TAP Programming Library
OSDMenuScrollPageDown.c
Go to the documentation of this file.
1#include "FBLib_TMSOSDMenu.h"
2
4{
6
7 tMenu *pMenu;
8 int ret, x;
9
10 pMenu = &Menu[CurrentMenuLevel];
11
12 if((pMenu->CurrentSelection == (pMenu->NrItems - 1)) && pMenu->ScrollLoop)
13 {
15 }
16 else if(pMenu->CurrentSelection == (pMenu->CurrentTopIndex + pMenu->NrLines - 1))
17 {
18 x = pMenu->CurrentSelection + pMenu->NrLines - 1;
19 if(x >= pMenu->NrItems) x = pMenu->NrItems - 2;
20 if(x < (pMenu->NrItems - 1))
22 else
23 ret = x;
24 }
25 else
26 {
27 x = pMenu->CurrentSelection + pMenu->NrLines - 2 - (pMenu->CurrentSelection - pMenu->CurrentTopIndex);
28 if(x >= pMenu->NrItems) x = pMenu->NrItems - 2;
30 }
31
32 if(ret == -1)
33 {
34 TRACEEXIT();
35 return -1;
36 }
37
38 pMenu->CurrentSelection = ret;
39 ListDirty = TRUE;
40
41 TRACEEXIT();
42 return ret;
43}
tMenu Menu[NRMENULEVELS]
Definition: OSDMenuInit.c:6
dword CurrentMenuLevel
Definition: OSDMenuInit.c:7
bool ListDirty
int OSDMenuScrollPageDown(void)
int OSDMenuFindNextSelectableEntry(int CurrentSelection)
#define TRACEEXIT()
Definition: libFireBird.h:1244
#define TRACEENTER()
Definition: libFireBird.h:1243
int CurrentSelection
int CurrentTopIndex
bool ScrollLoop