summaryrefslogtreecommitdiff
path: root/osdbase.c
diff options
context:
space:
mode:
Diffstat (limited to 'osdbase.c')
-rw-r--r--osdbase.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/osdbase.c b/osdbase.c
index 98307cd..9646bcc 100644
--- a/osdbase.c
+++ b/osdbase.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: osdbase.c 1.20 2005/06/18 10:30:51 kls Exp $
+ * $Id: osdbase.c 1.22 2005/10/02 15:00:40 kls Exp $
*/
#include "osdbase.h"
@@ -25,12 +25,12 @@ cOsdItem::cOsdItem(eOSState State)
fresh = true;
}
-cOsdItem::cOsdItem(const char *Text, eOSState State)
+cOsdItem::cOsdItem(const char *Text, eOSState State, bool Selectable)
{
text = NULL;
offset = -1;
state = State;
- selectable = true;
+ selectable = Selectable;
fresh = true;
SetText(Text);
}
@@ -196,8 +196,11 @@ void cOsdMenu::Display(void)
int count = Count();
if (count > 0) {
int ni = 0;
- for (cOsdItem *item = First(); item; item = Next(item))
+ for (cOsdItem *item = First(); item; item = Next(item)) {
cStatus::MsgOsdItem(item->Text(), ni++);
+ if (current < 0 && item->Selectable())
+ current = item->Index();
+ }
if (current < 0)
current = 0; // just for safety - there HAS to be a current item!
if (current - first >= displayMenuItems || current < first) {
@@ -210,8 +213,9 @@ void cOsdMenu::Display(void)
int i = first;
int n = 0;
for (cOsdItem *item = Get(first); item; item = Next(item)) {
- displayMenu->SetItem(item->Text(), i - first, i == current, item->Selectable());
- if (i == current)
+ bool CurrentSelectable = (i == current) && item->Selectable();
+ displayMenu->SetItem(item->Text(), i - first, CurrentSelectable, item->Selectable());
+ if (CurrentSelectable)
cStatus::MsgOsdCurrentItem(item->Text());
if (++n == displayMenuItems)
break;