FireBirdLib - Topfield TMS PVR TAP Programming Library
OSDMemoInitialize.c
Go to the documentation of this file.
1#include <string.h>
2#include "FBLib_TMSOSDMenu.h"
3
4void OSDMemoInitialize(bool ScrollLoop, const char *TitleLeft, const char *TitleRight, const char *Text)
5{
6 tMenu *pMenu;
7
9
10 OSDMenuInitialize(FALSE, FALSE, FALSE, ScrollLoop, TitleLeft, TitleRight);
11 pMenu = &Menu[CurrentMenuLevel];
13 pMenu->NrLines = 15;
14
15 if(!Text || !Text[0])
16 {
17 TRACEEXIT();
18 return;
19 }
20
21 pMenu->MemoText = TAP_MemAlloc(strlen(Text) + 2);
22 memset(pMenu->MemoText, 0, strlen(Text) + 2);
23 strcpy(pMenu->MemoText, Text);
24 StrReplace(pMenu->MemoText, "\x8d", "\r");
25 StrReplace(pMenu->MemoText, "\x8a", "\n");
26 StrReplace(pMenu->MemoText, "\r\n", "\n");
27 if (pMenu->MemoText[strlen(pMenu->MemoText) - 1] != '\n') strcat(pMenu->MemoText, "\n");
28
30
31 TRACEEXIT();
32}
void OSDMemoFormatText(void)
tMenu Menu[NRMENULEVELS]
Definition: OSDMenuInit.c:6
@ OMDM_Memo
dword CurrentMenuLevel
Definition: OSDMenuInit.c:7
void OSDMemoInitialize(bool ScrollLoop, const char *TitleLeft, const char *TitleRight, const char *Text)
bool StrReplace(char *String, const char *Find, const char *Replace)
Definition: StrReplace.c:4
#define TRACEEXIT()
Definition: libFireBird.h:1244
void OSDMenuInitialize(bool AllowScrollingOfLongText, bool HasValueColumn, bool NumberedItems, bool ScrollLoop, const char *TitleLeft, const char *TitleRight)
#define TRACEENTER()
Definition: libFireBird.h:1243
char * MemoText
tOSDMenuDisplayMode OSDMenuDisplayMode