Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: menu_item.h API (Read 3249 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

menu_item.h API

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)

menu_item.h API

Reply #1
Already implemented as the return value for get_display_data().

menu_item.h API

Reply #2
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.

 

menu_item.h API

Reply #3
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

menu_item.h API

Reply #4
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.

menu_item.h API

Reply #5
So, the last question remains,

Is there a way to add separators in

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