137 if (
digit == 0 &&
'1' <= *s && *s <=
'9' && *(s + 1) ==
' ')
166 status = s ? strdup(s) : NULL;
185 void cOsdMenu::SetHelp(
const char *Red,
const char *Green,
const char *Yellow,
const char *Blue)
245 if (current < 0 && item->Selectable())
261 bool CurrentSelectable = (i ==
current) && item->Selectable();
262 item->SetMenuItem(
displayMenu, i -
first, CurrentSelectable, item->Selectable());
263 if (CurrentSelectable)
296 if (
cMenuEditItem *MenuEditItem = dynamic_cast<cMenuEditItem *>(item)) {
297 if (!MenuEditItem->DisplayHelp(
Current))
308 int Index = Item->
Index();
309 int Offset = Index -
first;
338 int last =
Count() - 1;
341 while (--tmpCurrent !=
current) {
342 if (tmpCurrent < 0) {
350 tmpCurrent = last + 1;
357 if (
first <= tmpCurrent && tmpCurrent <= lastOnScreen)
364 else if (
current > lastOnScreen) {
376 int last =
Count() - 1;
379 while (++tmpCurrent !=
current) {
380 if (tmpCurrent > last) {
395 if (
first <= tmpCurrent && tmpCurrent <= lastOnScreen)
415 int oldFirst =
first;
418 int last =
Count() - 1;
426 if (tmpCurrent < 0) {
431 current = tmpCurrent <= last ? tmpCurrent : -1;
449 int oldFirst =
first;
452 int last =
Count() - 1;
460 if (tmpCurrent > last) {
465 current = tmpCurrent > 0 ? tmpCurrent : -1;
484 SetStatus(
tr(
"Up/Dn for new location - OK to move"));
488 #define MENUKEY_TIMEOUT 1500 493 bool highlight =
false;
506 const char *s = item->Text();
509 if (s && (s =
skipspace(s))[0] !=
'\0' &&
'0' <= s[i] && s[i] <=
'9') {
511 item_nr = item_nr * 10 + (s[i] -
'0');
513 while ( !((s[++i] ==
'\t')||(s[i] ==
' ')) && (s[i] !=
'\0') && (
'0' <= s[i]) && (s[i] <=
'9'));
514 if ((Key ==
kOk) && (item_nr ==
key_nr)) {
522 else if (Key !=
kOk) {
523 if (!highlight && (item_nr == (Key -
k0))) {
527 if (!match && (
key_nr == -1) && ((item_nr / 10) == (Key -
k0))) {
531 else if (((
key_nr == -1) && (item_nr == (Key -
k0))) || (!match && (
key_nr >= 0) && (item_nr == (10 *
key_nr + Key -
k0)))) {
540 if ((!match) && (Key !=
kNone))
cOsdItem * First(void) const
static void MsgOsdCurrentItem(const char *Text)
cOsdItem(eOSState State=osUnknown)
void Add(cListObject *Object, cListObject *After=NULL)
static cString sprintf(const char *fmt,...) __attribute__((format(printf
virtual cSkinDisplayMenu * DisplayMenu(void)=0
Creates and returns a new object for displaying a menu.
void SetFresh(bool Fresh)
static void MsgOsdHelpKeys(const char *Red, const char *Green, const char *Yellow, const char *Blue)
static void MsgOsdTitle(const char *Title)
cOsdItem * Next(const cOsdItem *object) const
void SetText(const char *Text, bool Copy=true)
void SetSelectable(bool Selectable)
void Ins(cListObject *Object, cListObject *Before=NULL)
cOsdItem * Last(void) const
bool Put(uint64_t Code, bool Repeat=false, bool Release=false)
virtual eOSState ProcessKey(eKeys Key)
cOsdItem * Get(int Index) const
void Del(cListObject *Object, bool DeleteObject=true)
static void MsgOsdClear(void)
bool Selectable(void) const
virtual void Move(int From, int To)
cOsdItem * Prev(const cOsdItem *object) const
cSkin * Current(void)
Returns a pointer to the current skin.
static void MsgOsdItem(const char *Text, int Index)
virtual void SetMenuItem(cSkinDisplayMenu *DisplayMenu, int Index, bool Current, bool Selectable)
const char * Text(void) const
bool TimedOut(void) const