45 text = Copy ? strdup(Text ? Text :
"") : (
char *)Text;
60 DisplayMenu->
SetItem(
Text(), Index, Current, Selectable);
131 if (
digit == 0 &&
'1' <= *s && *s <=
'9' && *(s + 1) ==
' ')
160 status = s ? strdup(s) : NULL;
167 title = strdup(Title);
179 void cOsdMenu::SetHelp(
const char *Red,
const char *Green,
const char *Yellow,
const char *Blue)
238 if (current < 0 && item->Selectable())
254 bool CurrentSelectable = (i ==
current) && item->Selectable();
255 item->SetMenuItem(
displayMenu, i -
first, CurrentSelectable, item->Selectable());
256 if (CurrentSelectable)
289 if (
cMenuEditItem *MenuEditItem = dynamic_cast<cMenuEditItem *>(item)) {
290 if (!MenuEditItem->DisplayHelp())
301 int Index = Item->
Index();
302 int Offset = Index -
first;
331 int last =
Count() - 1;
334 while (--tmpCurrent !=
current) {
335 if (tmpCurrent < 0) {
343 tmpCurrent = last + 1;
350 if (
first <= tmpCurrent && tmpCurrent <= lastOnScreen)
357 else if (
current > lastOnScreen) {
369 int last =
Count() - 1;
372 while (++tmpCurrent !=
current) {
373 if (tmpCurrent > last) {
374 if (
first < last - displayMenuItems) {
376 first = last - displayMenuItems + 1;
388 if (
first <= tmpCurrent && tmpCurrent <= lastOnScreen)
393 if (
first + displayMenuItems > last)
394 first =
max(0, last - displayMenuItems + 1);
408 int oldFirst =
first;
411 int last =
Count() - 1;
419 if (tmpCurrent < 0) {
424 current = tmpCurrent <= last ? tmpCurrent : -1;
442 int oldFirst =
first;
445 int last =
Count() - 1;
453 if (tmpCurrent > last) {
458 current = tmpCurrent > 0 ? tmpCurrent : -1;
477 SetStatus(
tr(
"Up/Dn for new location - OK to move"));
481 #define MENUKEY_TIMEOUT 1500
486 bool highlight =
false;
499 const char *s = item->Text();
502 if (s && (s =
skipspace(s)) !=
'\0' &&
'0' <= s[i] && s[i] <=
'9') {
504 item_nr = item_nr * 10 + (s[i] -
'0');
506 while ( !((s[++i] ==
'\t')||(s[i] ==
' ')) && (s[i] !=
'\0') && (
'0' <= s[i]) && (s[i] <=
'9'));
507 if ((Key ==
kOk) && (item_nr ==
key_nr)) {
515 else if (Key !=
kOk) {
516 if (!highlight && (item_nr == (Key -
k0))) {
520 if (!match && (
key_nr == -1) && ((item_nr / 10) == (Key -
k0))) {
524 else if (((
key_nr == -1) && (item_nr == (Key -
k0))) || (!match && (
key_nr >= 0) && (item_nr == (10 * key_nr + Key -
k0)))) {
533 if ((!match) && (Key !=
kNone))
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
cOsdItem * Get(int Index) const
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)
cOsdItem * Last(void) const
const char * Text(void) const
bool Selectable(void) const
cOsdItem * Next(const cOsdItem *object) const
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)
virtual eOSState ProcessKey(eKeys Key)
cOsdItem * First(void) const
void Del(cListObject *Object, bool DeleteObject=true)
static void MsgOsdClear(void)
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)
cOsdItem * Prev(const cOsdItem *object) const