142 if (
digit == 0 &&
'1' <= *s && *s <=
'9' && *(s + 1) ==
' ')
171 status = s ? strdup(s) : NULL;
190 void cOsdMenu::SetHelp(
const char *Red,
const char *Green,
const char *Yellow,
const char *Blue)
253 if (current < 0 && item->Selectable())
269 bool CurrentSelectable = (i ==
current) && item->Selectable();
270 item->SetMenuItem(
displayMenu, i -
first, CurrentSelectable, item->Selectable());
271 if (CurrentSelectable)
307 if (
cMenuEditItem *MenuEditItem = dynamic_cast<cMenuEditItem *>(item)) {
308 if (!MenuEditItem->DisplayHelp(
Current))
319 int Index = Item->
Index();
320 int Offset = Index -
first;
351 int last =
Count() - 1;
354 while (--tmpCurrent !=
current) {
355 if (tmpCurrent < 0) {
363 tmpCurrent = last + 1;
370 if (
first <= tmpCurrent && tmpCurrent <= lastOnScreen)
377 else if (
current > lastOnScreen) {
389 int last =
Count() - 1;
392 while (++tmpCurrent !=
current) {
393 if (tmpCurrent > last) {
408 if (
first <= tmpCurrent && tmpCurrent <= lastOnScreen)
428 int oldFirst =
first;
431 int last =
Count() - 1;
439 if (tmpCurrent < 0) {
444 current = tmpCurrent <= last ? tmpCurrent : -1;
462 int oldFirst =
first;
465 int last =
Count() - 1;
473 if (tmpCurrent > last) {
478 current = tmpCurrent > 0 ? tmpCurrent : -1;
497 SetStatus(
tr(
"Up/Dn for new location - OK to move"));
501 #define MENUKEY_TIMEOUT 1500 506 bool highlight =
false;
519 const char *s = item->Text();
522 if (s && (s =
skipspace(s))[0] !=
'\0' &&
'0' <= s[i] && s[i] <=
'9') {
524 item_nr = item_nr * 10 + (s[i] -
'0');
526 while ( !((s[++i] ==
'\t')||(s[i] ==
' ')) && (s[i] !=
'\0') && (
'0' <= s[i]) && (s[i] <=
'9'));
527 if ((Key ==
kOk) && (item_nr ==
key_nr)) {
535 else if (Key !=
kOk) {
536 if (!highlight && (item_nr == (Key -
k0))) {
540 if (!match && (
key_nr == -1) && ((item_nr / 10) == (Key -
k0))) {
544 else if (((
key_nr == -1) && (item_nr == (Key -
k0))) || (!match && (
key_nr >= 0) && (item_nr == (10 *
key_nr + Key -
k0)))) {
553 if ((!match) && (Key !=
kNone))
static void MsgOsdCurrentItem(const char *Text)
const cOsdItem * Get(int Index) const
Returns the list element at the given Index, or NULL if no such element exists.
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 bool OsdSizeChanged(int &State)
Checks if the OSD size has changed and a currently displayed OSD needs to be redrawn.
static void MsgOsdHelpKeys(const char *Red, const char *Green, const char *Yellow, const char *Blue)
static void MsgOsdTitle(const char *Title)
void SetText(const char *Text, bool Copy=true)
void SetSelectable(bool Selectable)
void Ins(cListObject *Object, cListObject *Before=NULL)
bool Put(uint64_t Code, bool Repeat=false, bool Release=false)
const cOsdItem * Last(void) const
Returns the last element in this list, or NULL if the list is empty.
const cOsdItem * Prev(const cOsdItem *Object) const
virtual eOSState ProcessKey(eKeys Key)
const cOsdItem * First(void) const
Returns the first element in this list, or NULL if the list is empty.
void Del(cListObject *Object, bool DeleteObject=true)
static void MsgOsdClear(void)
bool Selectable(void) const
virtual void Move(int From, int To)
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
const cOsdItem * Next(const cOsdItem *Object) const
< Returns the element immediately before Object in this list, or NULL if Object is the first element ...