summaryrefslogtreecommitdiff
path: root/menu.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2005-10-03 11:26:07 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2005-10-03 11:26:07 +0200
commit4acbc0fd47b808eb01ec1b71642db44827bf4124 (patch)
treef90cdd8dd4fa65cbff77bffeda44324f5a5efc74 /menu.c
parentc03de9e15e86ae91e82a05a6cc00a2291c2ebef0 (diff)
downloadvdr-4acbc0fd47b808eb01ec1b71642db44827bf4124.tar.gz
vdr-4acbc0fd47b808eb01ec1b71642db44827bf4124.tar.bz2
The 'sub-title' and 'bottom text' in the CAM menu can now consist of several lines
Diffstat (limited to 'menu.c')
-rw-r--r--menu.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/menu.c b/menu.c
index ea187084..df61061b 100644
--- a/menu.c
+++ b/menu.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: menu.c 1.371 2005/10/02 14:53:48 kls Exp $
+ * $Id: menu.c 1.372 2005/10/03 10:41:26 kls Exp $
*/
#include "menu.h"
@@ -1297,16 +1297,16 @@ cMenuCam::cMenuCam(cCiMenu *CiMenu)
SetTitle(*ciMenu->TitleText() ? ciMenu->TitleText() : "CAM");
dsyslog("CAM: '%s'", ciMenu->TitleText());
if (*ciMenu->SubTitleText()) {
- Add(new cOsdItem(ciMenu->SubTitleText(), osUnknown, false));
- offset = 1;
dsyslog("CAM: '%s'", ciMenu->SubTitleText());
+ AddMultiLineItem(ciMenu->SubTitleText());
+ offset = Count();
}
for (int i = 0; i < ciMenu->NumEntries(); i++) {
Add(new cOsdItem(hk(ciMenu->Entry(i)), osUnknown, ciMenu->Selectable()));
dsyslog("CAM: '%s'", ciMenu->Entry(i));
}
if (*ciMenu->BottomText()) {
- Add(new cOsdItem(ciMenu->BottomText(), osUnknown, false));
+ AddMultiLineItem(ciMenu->BottomText());
dsyslog("CAM: '%s'", ciMenu->BottomText());
}
Display();
@@ -1319,6 +1319,19 @@ cMenuCam::~cMenuCam()
delete ciMenu;
}
+void cMenuCam::AddMultiLineItem(const char *s)
+{
+ while (s && *s) {
+ const char *p = strchr(s, '\n');
+ int l = p ? p - s : strlen(s);
+ cOsdItem *item = new cOsdItem;
+ item->SetSelectable(false);
+ item->SetText(strndup(s, l), false);
+ Add(item);
+ s = p ? p + 1 : p;
+ }
+}
+
eOSState cMenuCam::Select(void)
{
if (ciMenu->Selectable()) {