FireBirdLib - Topfield TMS PVR TAP Programming Library
OSDDrawScrollBar.c
Go to the documentation of this file.
1
#include "
FBLib_TMSOSDMenu.h
"
2
3
void
OSDDrawScrollBar
(
void
)
4
{
5
TRACEENTER
();
6
7
tMenu
*pMenu;
8
word extralines = 0, cutY;
9
int
n, l,
Y
;
10
11
pMenu = &
Menu
[
CurrentMenuLevel
];
12
13
if
(pMenu->
OSDMenuDisplayMode
==
OMDM_Standard
|| pMenu->
OSDMenuDisplayMode
==
OMDM_ListBox
)
14
{
15
switch
(pMenu->
NrLines
)
16
{
17
case
18:
18
extralines = 8;
19
break
;
20
21
case
15:
22
extralines = 5;
23
break
;
24
}
25
}
26
27
cutY = 96 +
_ScrollBarVisible_Gd
.height - 16;
// same for ScrollBarInvisible
28
29
if
(pMenu->
NrItems
< pMenu->
NrLines
+ 1)
30
{
31
TAP_Osd_PutGd(
OSDRgn
, pMenu->
XPos
+ pMenu->
Width
+ 1, 96, &
_ScrollBarInvisible_Gd
, FALSE);
32
33
if
(extralines) TAP_Osd_Copy(
OSDRgn
,
OSDRgn
, pMenu->
XPos
+ pMenu->
Width
+ 1, cutY,
_ScrollBarInvisible_Gd
.width, 16, pMenu->
XPos
+ pMenu->
Width
+ 1, cutY + extralines, FALSE);
34
}
35
else
36
{
37
TAP_Osd_PutGd(
OSDRgn
, pMenu->
XPos
+ pMenu->
Width
+ 1, 96, &
_ScrollBarVisible_Gd
, FALSE);
38
39
if
(extralines) TAP_Osd_Copy(
OSDRgn
,
OSDRgn
, pMenu->
XPos
+ pMenu->
Width
+ 1, cutY,
_ScrollBarVisible_Gd
.width, 16, pMenu->
XPos
+ pMenu->
Width
+ 1, cutY + extralines, FALSE);
40
41
n = (pMenu->
OSDMenuDisplayMode
==
OMDM_Text
? pMenu->
NrLines
: 1);
42
l =
_ScrollBarVisible_Gd
.height + extralines - 2 * 12 -
_ScrollBarKnob_Gd
.height;
43
Y
= 96 + 12 + (pMenu->
CurrentSelection
* l) / (pMenu->
NrItems
- n);
44
45
TAP_Osd_PutGd(
OSDRgn
, pMenu->
XPos
+ pMenu->
Width
+ 2,
Y
, &
_ScrollBarKnob_Gd
, FALSE);
46
}
47
48
TRACEEXIT
();
49
}
FBLib_TMSOSDMenu.h
_ScrollBarInvisible_Gd
TYPE_GrData _ScrollBarInvisible_Gd
Menu
tMenu Menu[NRMENULEVELS]
Definition:
OSDMenuInit.c:6
OMDM_Text
@ OMDM_Text
Definition:
FBLib_TMSOSDMenu.h:63
OMDM_Standard
@ OMDM_Standard
Definition:
FBLib_TMSOSDMenu.h:60
OMDM_ListBox
@ OMDM_ListBox
Definition:
FBLib_TMSOSDMenu.h:61
_ScrollBarKnob_Gd
TYPE_GrData _ScrollBarKnob_Gd
CurrentMenuLevel
dword CurrentMenuLevel
Definition:
OSDMenuInit.c:7
_ScrollBarVisible_Gd
TYPE_GrData _ScrollBarVisible_Gd
OSDRgn
word OSDRgn
Definition:
OSDMenuInit.c:4
OSDDrawScrollBar
void OSDDrawScrollBar(void)
Definition:
OSDDrawScrollBar.c:3
TRACEEXIT
#define TRACEEXIT()
Definition:
libFireBird.h:1244
Y
@ Y
Definition:
libFireBird.h:291
TRACEENTER
#define TRACEENTER()
Definition:
libFireBird.h:1243
tMenu
Definition:
FBLib_TMSOSDMenu.h:67
tMenu::CurrentSelection
int CurrentSelection
Definition:
FBLib_TMSOSDMenu.h:74
tMenu::XPos
dword XPos
Definition:
FBLib_TMSOSDMenu.h:68
tMenu::Width
dword Width
Definition:
FBLib_TMSOSDMenu.h:69
tMenu::NrLines
int NrLines
Definition:
FBLib_TMSOSDMenu.h:70
tMenu::OSDMenuDisplayMode
tOSDMenuDisplayMode OSDMenuDisplayMode
Definition:
FBLib_TMSOSDMenu.h:96
tMenu::NrItems
int NrItems
Definition:
FBLib_TMSOSDMenu.h:72
TMSOSDMenu
OSDDrawScrollBar.c
Generated on Fri Apr 29 2022 13:34:01 for FireBirdLib - Topfield TMS PVR TAP Programming Library by
1.9.3