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;
332 int last =
Count() - 1;
335 while (--tmpCurrent !=
current) {
336 if (tmpCurrent < 0) {
344 tmpCurrent = last + 1;
351 if (
first <= tmpCurrent && tmpCurrent <= lastOnScreen)
358 else if (
current > lastOnScreen) {
371 int last =
Count() - 1;
374 while (++tmpCurrent !=
current) {
375 if (tmpCurrent > last) {
376 if (
first < last - displayMenuItems) {
378 first = last - displayMenuItems + 1;
390 if (
first <= tmpCurrent && tmpCurrent <= lastOnScreen)
395 if (
first + displayMenuItems > last)
396 first =
max(0, last - displayMenuItems + 1);
411 int oldFirst =
first;
414 int last =
Count() - 1;
422 if (tmpCurrent < 0) {
427 current = tmpCurrent <= last ? tmpCurrent : -1;
446 int oldFirst =
first;
449 int last =
Count() - 1;
457 if (tmpCurrent > last) {
462 current = tmpCurrent > 0 ? tmpCurrent : -1;
481 SetStatus(
tr(
"Up/Dn for new location - OK to move"));
485 #define MENUKEY_TIMEOUT 1500
490 bool highlight =
false;
503 const char *s = item->Text();
506 if (s && (s =
skipspace(s)) !=
'\0' &&
'0' <= s[i] && s[i] <=
'9') {
508 item_nr = item_nr * 10 + (s[i] -
'0');
510 while ( !((s[++i] ==
'\t')||(s[i] ==
' ')) && (s[i] !=
'\0') && (
'0' <= s[i]) && (s[i] <=
'9'));
511 if ((Key ==
kOk) && (item_nr ==
key_nr)) {
519 else if (Key !=
kOk) {
520 if (!highlight && (item_nr == (Key -
k0))) {
524 if (!match && (
key_nr == -1) && ((item_nr / 10) == (Key -
k0))) {
528 else if (((
key_nr == -1) && (item_nr == (Key -
k0))) || (!match && (
key_nr >= 0) && (item_nr == (10 * key_nr + Key -
k0)))) {
537 if ((!match) && (Key !=
kNone))