Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[vdr] Re: help on ProcessKey!!!




tala vir wrote:

eOSState cMyMenu::ProcessKey(eKeys Key)
{
        eOSState state = cOsdMenu::ProcessKey(Key);
        printf("state=%d", state);
        if(Key == kOk)
        {
                cMyItem* ci = (cMyItem
*)Get(Current());
                SetTitle(ci->getCode());
        }
        return osContinue;
}

Well, this piece of code is a bit tricky.

with:
eOSState state = cOsdMenu::ProcessKey(Key);

you call the ProcessKey function of the cOsdMenu class. It will manage the arrows and the back key. The 'navigation' in the menu will be ready out of the box. Perhaps you have a problem: you don't see the 'SetTitle' changing the title in the menu. I don't know if this is a bug or a feature, but you have to call Display() after SetTitle. If you use SetStatus you don't need it.

The rest of the code is ok I think, however I could suggest you to change it a bit:


eOSState cMyMenu::ProcessKey(eKeys Key)
{
if(Key == kOk)
{
cMyItem* ci = (cMyItem*)Get(Current());
SetTitle(ci->getCode());
Display();
return osContinue;
}
return cOsdMenu::ProcessKey(Key);
}


Hopep this helps. If there is somebody else that wants to expand the example even further....


bye
as




--

How to build a lirc receiver
http://www.manoweb.com/alesan/lirc




--
Info:
To unsubscribe send a mail to listar@linuxtv.org with "unsubscribe vdr" as subject.



Home | Main Index | Thread Index