QUOTE(kode54 @ Feb 27 2004, 09:58 PM)
Er, what? The value returned by enum_item is only used for configuration, unless you don't bother to override get_display_data.
that was the important hint! thanx!
my final code (will convert all pipes in a menu item to slashes):
CODE
virtual bool get_display_data( unsigned n, const ptr_list_base<metadb_handle> & data,string_base & out, unsigned & displayflags, const GUID & caller )
{
if( n < 0 || n > get_num_items() || !is_available( n ) ) return false;
string8 temp;
enum_item( n, temp );
// Find last slash
const char * ptr = strrchr( temp, '/' );
if( ptr )
{
ptr++;
}
else
{
ptr = temp;
}
// Pipe to slash
temp.replace_char( '|','/' );
out.set_string(ptr);
displayflags = ( is_checked( n ) ? FLAG_CHECKED : 0) | ( is_disabled( n ) ? FLAG_DISABLED_GRAYED : 0 );
return true;
}