QUOTE(hartwork @ Feb 26 2004, 02:54 AM)
the problem is i don't know
* what get_display_data() really does
* what all the params are good for
does it also replace is_checked() and get_enum()?
See below for explanation.
QUOTE
the sdk contains this code from you (foo_vis_vu_meter\main.cpp):
What SDK are you talking about here? Nevertheless, if you use that code from foo_vis_vu_meter, you will get the same behaviour for your menu_item as with the default implementation, except that disabled commands will be grayed out as well.
QUOTE
ps: kannst mir auch ne mail auf deutsch schreiben - ich komm aus berlin

For the sake of the other forum users, I'll try to answer questions asked here by posting (in English) rather than sending an email.
Now for the details about get_display_data:
get_display_data() determines how a command should be displayed, that is the displayed name and whether the command is checked/disabled/grayed out. is_available/is_checked/is_disabled are helper methods used by get_display_data (to get a uniform implementation). get_display_data does not replace enum_item, as that is used to identify a command. However, the default implementation of get_display_data derives the display name of a from the identifier given by enum_item.
The parameters of get_display_data are:
- n - index of the command for which information is retrieved
- data - a list of metadb_handle pointers*
- out - in case the command is available, get_display_data has to store the name of the command in out
- displayflags - get_display_data can store a combination of the FLAG_* enum values in displayflags to change the appearance of a command in the menu (like adding a check mark, or making the command disabled or grayed out)
- caller - (only in the overloaded version in menu_item) identifies how the command was called*
*: the data and caller parameters are mainly for use with context menu items. I don't know what their values are for main menu items, so unless Peter says otherwise, you should consider them to have an undefined value for main menu items (i.e. don't use them).
The return value of get_display_data indicates, whether the command is available. Commands that are not available are not shown in the menu.
The default implementation of get_display_data does the following:
- assert that n is a valid command index
- check whether the command indicated by n is available using is_available; if it is not, return false
- derive the display name of the command from the identifier given by enum_item (either the whole identifier, or if the identifier contains a slash, the part of the identifier after the last slash)
- determine displayflags using is_checked and is_disabled
- return true
I hope that clears things up a bit.