AnsweredAssumed Answered

EGUI: Changing text colour of a menu entry and changing icon "on-the-fly"?

Question asked by Robert Wood on May 25, 2013
Latest reply on May 26, 2013 by Robert Wood

Folks,

 

I have a menu with several items in it. As I scroll through it, the selected (focus?) position sets that line as black text on a white back ground rather than white text on a black background - which is fine. However, I would like, when the user hits enter, for that particular menu entry to have red text as it will be the selected menu item. Then as focus changes, the text will always be red, but the background will change between white and black.

 

The setting of the focus seems to be done in some fairly complex looking code in:

 

static void D4D_MenuOnDraw(D4D_MESSAGE* pMsg)

 

I could add some extra code to this to do what I want. I don't really want to go hacking that if I can avoid it.

 

So, can I actually do what I want to? Ideally, I suppose, I'd like an API call along the lines of:

 

SetMenuTextColour(D4D_MENU* pMenu, D4D_MENU_INDEX index, struct D4D_CLR_SCHEME_S *ColourScheme);

 

So, I would pass a pointer to my menu, which entry on the screen should be highlighted and which colour scheme should be used. As far as I can tell -and I could well be completely wrong - in the normal colour scheme, you can only have two text colours: highlighted and non-highlighted.

 

Is this at all possible? If so, would someone be able to give me a pointer as to how to do it?

 

Also, in a similar way, if I have a screen with some entries on it that are declared with a little icon, is it possible to change the icon as the user selects something on the screen? I suppose it's a little like have a check box and indeed, doing it with a check box would also be acceptable I guess.

 

Many thanks.

Outcomes