Improved displaying 'sub-title' and 'bottom text' in the CAM menu

This commit is contained in:
Klaus Schmidinger 2005-10-02 09:59:30 +02:00
parent 704e17859f
commit 23aa374e3d
3 changed files with 22 additions and 9 deletions

View File

@ -3868,3 +3868,4 @@ Video Disk Recorder Revision History
Richter). Richter).
- Fixed setting current menu item if the first one is non-selectable. - Fixed setting current menu item if the first one is non-selectable.
- cOsdItem::cOsdItem() now has a 'Selectable' parameter. - cOsdItem::cOsdItem() now has a 'Selectable' parameter.
- Improved displaying 'sub-title' and 'bottom text' in the CAM menu.

27
menu.c
View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: menu.c 1.364 2005/10/01 10:12:32 kls Exp $ * $Id: menu.c 1.365 2005/10/02 09:59:30 kls Exp $
*/ */
#include "menu.h" #include "menu.h"
@ -1287,18 +1287,28 @@ eOSState cMenuCommands::ProcessKey(eKeys Key)
cMenuCam::cMenuCam(cCiMenu *CiMenu) cMenuCam::cMenuCam(cCiMenu *CiMenu)
:cOsdMenu("") :cOsdMenu("")
{ {
dsyslog("CAM: Menu ------------------");
ciMenu = CiMenu; ciMenu = CiMenu;
selected = false; selected = false;
offset = 0;
if (ciMenu->Selectable()) if (ciMenu->Selectable())
SetHasHotkeys(); SetHasHotkeys();
SetTitle(ciMenu->TitleText() ? ciMenu->TitleText() : "CAM"); SetTitle(*ciMenu->TitleText() ? ciMenu->TitleText() : "CAM");
for (int i = 0; i < ciMenu->NumEntries(); i++) dsyslog("CAM: %s", ciMenu->TitleText());
if (*ciMenu->SubTitleText()) {
Add(new cOsdItem(ciMenu->SubTitleText(), osUnknown, false));
offset = 1;
dsyslog("CAM: %s", ciMenu->SubTitleText());
}
for (int i = 0; i < ciMenu->NumEntries(); i++) {
Add(new cOsdItem(hk(ciMenu->Entry(i)))); Add(new cOsdItem(hk(ciMenu->Entry(i))));
//XXX implement a clean way of displaying this: dsyslog("CAM: %s", ciMenu->Entry(i));
Add(new cOsdItem(ciMenu->SubTitleText())); }
Add(new cOsdItem(ciMenu->BottomText())); if (*ciMenu->BottomText()) {
Add(new cOsdItem(ciMenu->BottomText(), osUnknown, false));
dsyslog("CAM: %s", ciMenu->BottomText());
}
Display(); Display();
dsyslog("CAM: Menu - %s", ciMenu->TitleText());
} }
cMenuCam::~cMenuCam() cMenuCam::~cMenuCam()
@ -1311,7 +1321,8 @@ cMenuCam::~cMenuCam()
eOSState cMenuCam::Select(void) eOSState cMenuCam::Select(void)
{ {
if (ciMenu->Selectable()) { if (ciMenu->Selectable()) {
ciMenu->Select(Current()); ciMenu->Select(Current() - offset);
dsyslog("CAM: select %d", Current() - offset);
selected = true; selected = true;
} }
return osEnd; return osEnd;

3
menu.h
View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: menu.h 1.74 2005/09/25 09:03:32 kls Exp $ * $Id: menu.h 1.75 2005/10/02 09:59:30 kls Exp $
*/ */
#ifndef __MENU_H #ifndef __MENU_H
@ -120,6 +120,7 @@ class cMenuCam : public cOsdMenu {
private: private:
cCiMenu *ciMenu; cCiMenu *ciMenu;
bool selected; bool selected;
int offset;
eOSState Select(void); eOSState Select(void);
public: public:
cMenuCam(cCiMenu *CiMenu); cMenuCam(cCiMenu *CiMenu);