Skip to main content
Topic: menu_item.h API (Read 2180 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;
    }

 
SimplePortal 1.0.0 RC1 © 2008-2019