FireBirdLib - Topfield TMS PVR TAP Programming Library
OSDMenuButtonAdd.c
Go to the documentation of this file.
1
#include <string.h>
2
#include "
FBLib_TMSOSDMenu.h
"
3
4
void
OSDMenuButtonAdd
(dword Line,
tButtonIcon
ButtonIcon, TYPE_GrData *ButtonGd,
const
char
*Text)
5
{
6
TRACEENTER
();
7
8
tMenu
*pMenu;
9
TYPE_GrData *IconGd;
10
11
pMenu = &
Menu
[
CurrentMenuLevel
];
12
13
IconGd =
OSDMenuGetIconPointer
(ButtonIcon, ButtonGd);
14
if
((Line == 0) || (Line > 3) || (!IconGd) || (!Text) || (pMenu->
NrButtons
>=
MAXBUTTONS
) || (pMenu->
OSDMenuDisplayMode
==
OMDM_ListBox
&& Line == 3))
15
{
16
TRACEEXIT
();
17
return
;
18
}
19
20
pMenu->
Buttons
[pMenu->
NrButtons
].
X
= pMenu->
ButtonXStart
[Line];
21
22
switch
(Line)
23
{
24
case
1: pMenu->
Buttons
[pMenu->
NrButtons
].
Y
= 487;
break
;
25
case
2: pMenu->
Buttons
[pMenu->
NrButtons
].
Y
= 511;
break
;
26
case
3: pMenu->
Buttons
[pMenu->
NrButtons
].
Y
= 535;
break
;
27
}
28
pMenu->
Buttons
[pMenu->
NrButtons
].
pButtonGd
= IconGd;
29
strncpy(pMenu->
Buttons
[pMenu->
NrButtons
].
Text
, Text,
STDSTRINGSIZE
);
30
pMenu->
Buttons
[pMenu->
NrButtons
].
Text
[
STDSTRINGSIZE
- 1] =
'\0'
;
31
pMenu->
Buttons
[pMenu->
NrButtons
].
Color
=
ButtonColor
;
32
pMenu->
NrButtons
++;
33
34
ButtonsDirty
= TRUE;
35
36
pMenu->
ButtonXStart
[Line] = pMenu->
ButtonXStart
[Line] + IconGd->width +
FMUC_GetStringWidth
(Text, pMenu->
FontButtons
) + 8;
37
38
TRACEEXIT
();
39
}
FBLib_TMSOSDMenu.h
MAXBUTTONS
#define MAXBUTTONS
Definition:
FBLib_TMSOSDMenu.h:10
Menu
tMenu Menu[NRMENULEVELS]
Definition:
OSDMenuInit.c:6
OMDM_ListBox
@ OMDM_ListBox
Definition:
FBLib_TMSOSDMenu.h:61
STDSTRINGSIZE
#define STDSTRINGSIZE
Definition:
FBLib_TMSOSDMenu.h:8
CurrentMenuLevel
dword CurrentMenuLevel
Definition:
OSDMenuInit.c:7
ButtonsDirty
bool ButtonsDirty
Definition:
FBLib_TMSOSDMenu.h:223
ButtonColor
dword ButtonColor
Definition:
OSDMenuInit.c:8
FMUC_GetStringWidth
dword FMUC_GetStringWidth(const char *Text, tFontDataUC *FontData)
Definition:
FMUC_GetStringWidth.c:4
OSDMenuButtonAdd
void OSDMenuButtonAdd(dword Line, tButtonIcon ButtonIcon, TYPE_GrData *ButtonGd, const char *Text)
Definition:
OSDMenuButtonAdd.c:4
OSDMenuGetIconPointer
TYPE_GrData * OSDMenuGetIconPointer(tButtonIcon ButtonIcon, TYPE_GrData *UserDefinedButton)
Definition:
OSDMenuGetIconPointer.c:3
tButtonIcon
tButtonIcon
Definition:
libFireBird.h:2803
TRACEEXIT
#define TRACEEXIT()
Definition:
libFireBird.h:1244
TRACEENTER
#define TRACEENTER()
Definition:
libFireBird.h:1243
tButtons::X
dword X
Definition:
FBLib_TMSOSDMenu.h:51
tButtons::pButtonGd
TYPE_GrData * pButtonGd
Definition:
FBLib_TMSOSDMenu.h:53
tButtons::Text
char Text[STDSTRINGSIZE]
Definition:
FBLib_TMSOSDMenu.h:55
tButtons::Color
dword Color
Definition:
FBLib_TMSOSDMenu.h:54
tButtons::Y
dword Y
Definition:
FBLib_TMSOSDMenu.h:52
tMenu
Definition:
FBLib_TMSOSDMenu.h:67
tMenu::NrButtons
dword NrButtons
Definition:
FBLib_TMSOSDMenu.h:84
tMenu::OSDMenuDisplayMode
tOSDMenuDisplayMode OSDMenuDisplayMode
Definition:
FBLib_TMSOSDMenu.h:96
tMenu::Buttons
tButtons Buttons[MAXBUTTONS]
Definition:
FBLib_TMSOSDMenu.h:83
tMenu::ButtonXStart
dword ButtonXStart[4]
Definition:
FBLib_TMSOSDMenu.h:85
tMenu::FontButtons
tFontDataUC * FontButtons
Definition:
FBLib_TMSOSDMenu.h:102
TMSOSDMenu
OSDMenuButtonAdd.c
Generated on Fri Apr 29 2022 13:34:01 for FireBirdLib - Topfield TMS PVR TAP Programming Library by
1.9.3