HydrogenAudio

Hosted Forums => foobar2000 => Development - (fb2k) => Topic started by: danZ on 2003-09-11 20:27:06

Title: menu_item.h API
Post by: danZ on 2003-09-11 20:27:06
an
bool is_enabled();

method on the menu items would be useful to allow items to be turned on/off based on other state information in the player or component.

Can you add a separator programmatically from the menu_item interface?

ie. from

virtual const char * enum_item(int n)
Title: menu_item.h API
Post by: kode54 on 2003-09-12 07:54:51
Already implemented as the return value for get_display_data().
Title: menu_item.h API
Post by: danZ on 2003-09-12 22:24:04
Quote
Already implemented as the return value for get_display_data().

Sorry, I don't see how I use that to disable (MF_GRAYED style) one of my menu items.

For is_checked() I get a chance for each item in my menu instance to set or not set the check mark.  I'd like the same thing for enabling or disabling the item.
Title: menu_item.h API
Post by: Florian on 2003-09-13 11:12:43
Quote
Sorry, I don't see how I use that to disable (MF_GRAYED style) one of my menu items.

Maybe you can override
Code: [Select]
virtual enabled_state get_enabled_state(int idx)
and return MENU_DEFAULT_OFF when you don't want to display a specific menu item (but yes I know - that's not MF_GRAYED).

~ Florian
Title: menu_item.h API
Post by: danZ on 2003-09-13 17:01:01
Quote
Quote
Sorry, I don't see how I use that to disable (MF_GRAYED style) one of my menu items.

Maybe you can override
Code: [Select]
virtual enabled_state get_enabled_state(int idx)
and return MENU_DEFAULT_OFF when you don't want to display a specific menu item (but yes I know - that's not MF_GRAYED).

~ Florian

Damn, I totally overlooked that as I was looking down in the derived object's interface.

Thanks.
Title: menu_item.h API
Post by: danZ on 2003-09-13 17:11:03
So, the last question remains,

Is there a way to add separators in

Code: [Select]
    virtual const char * enum_item(int n) 
    {
 return NULL;
    }