Mailing List archive

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

[vdr] Re: Small OSD menu example?



On Wed, 4 Jun 2003, Klaus Schmidinger wrote:

>Jan Ekholm wrote:
>> 
>> On Wed, 4 Jun 2003, Klaus Schmidinger wrote:
>> 
>> >Jan Ekholm wrote:
>> >>
>> >> ...
>> >> Nobody interested in a free shipped CD/DVD in response to some example
>> >> code? :) I've given up on trying to get my brain to craft up the menus. I
>> >> can do a huge "flat" menu, but I'd prefer nested menus as they'd make the
>> >> system just so much more useful.
>> >
>> >Why don't you just take a look at how, for instance, cMenuSetup is implemented?
>> 
>> I've done that in the past. One thing that didn't really get clear to me,
>> and which is pretty fundamental is wether the whole menu structure is
>> defined at once, or in parts as needed? Ie. when the OSD is first
>> activated, are all the deepest down menus and items already created, or do
>> they get created when the user enters a particular submenu? The former
>> would let VDR take care of all the navigation etc, while the latter forces
>> the plugin to keep track of where in the hierarchy the user currently is.
>
>Menus are created as necessary. See  cMenuSetup::ProcessKey().

I *finally* got it all working. I scrapped my old code and started again
with a bare implementation picked from menu.c. After some heavy
comparisons between the old code and the new thing that works, I noticed
that one thing that did not work at all was giving cOsdItem:s custom
colors. My menu is basially a directory representation, with "files" and
"directories". I show the "files" together with the "directories", but
wanted to use another color for them, so I had code like this:

class MenuItem : public cOsdItem {...}

MenuItem::MenuItem () {
    if ( item_is_directory )
        SetColor ( clrCyan, clrBackground );
    else 
        SetColor ( clrWhite, clrBackground );

    SetText ( item_text );
}

That however never really worked out, the first menu item was always
missing (blank) and the selection bar never was shown. All example of
SetColor() in the VDR sources seem to do the same, as does the MP3 plugin,
so I'm a bit confused. But I can live without colors, just have to postfix
each "dir" with a "/" and the "files" with something else to make it
visible to the user what is what.

-- 
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 ecartis@linuxtv.org with "unsubscribe vdr" as subject.



Home | Main Index | Thread Index