Mailing List archive

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

[vdr] Submenus in plugins



Hi,

Anyone have any ideas for how plugins can use submenus? I'd like an
menu structure that's arbitrarily deep, at least two submenus. Creating
the initial menu for my plugin works well, my plugin just returns an
object that subclasses cOsdMenu in the MainMenuAction() of the plugin. 

The menu then processes keypresses in its ProcessKey() method, and that
also works nicely. But when the user selects an item that is supposed to
open a submenu, how should that be done? The submenu is also an instance
of the same cOsdMenu as my "toplevel" menu. How is that submenu made to be
the current one? My current code tries to do roughly this:

eOSState Menu::ProcessKey (eKeys key) {
    switch () {
    case kRight:
        // find the submenu
        Menu * submenu = ...;

        // display it
        submenu->Display ();

        // continue with the OSD active
        return osContinue;
    }
}

That seems to work somehow, but not really fully. Is this the proper way
to do it, just call Display() for the submenus? What about closing a
submenu. I want the user to be able to navigate up in the hierarchy by
pressing kLeft. My current code tries to do this (insert into the same
switch() above):

    case kLeft:
       // does the current submenu have a parent?
       if ( current_has_parent() ) {
           // yes, find and activate
           m_parent->Display()
           return osContinue;
       }
       else {
           // no parent, we're up back at our plugin's toplevel menu
           Interface->Close();
           return osEnd;
       }
       break;

But this does not work at all. I always end up having the normal faded OSD
background remain on the screen, it never gets cleared away, not until VDR
is restarted. So obvioulsy I do something that's wrong, but still not
wrong enough to crash. What would be the proper way for a cOsdMenu to
close the OSD? I've seen most plugins just return osEnd and be done with
it. Another plugin I've done that uses a custom raw OSD display also
returns osEnd from ProcessKey() and it works nicely.

Any hints?


-- 
By reading this message, you may be causing Armageddon. Needless to say,
Armageddon will wipe out your hard drive and damage your computer.
                                -- Email hoax as seen on Hoaxbusters.com
				



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



Home | Main Index | Thread Index