highlight a listbox item on mouse enter

For help with anything that CEGUI doesn't offer straight out-of-the-box, e.g.:
- Implementation of new features, such as new Core classes, widgets, WindowRenderers, etc. ...
- Modification of any existing features for specific purposes
- Integration of CEGUI in new engines or frameworks and writing of new plugins (Renderer, Parser, ...) or modules

Moderators: CEGUI MVP, CEGUI Team

Rincevent
Not too shy to talk
Not too shy to talk
Posts: 22
Joined: Thu Oct 08, 2009 20:42

highlight a listbox item on mouse enter

Postby Rincevent » Sun Dec 13, 2009 14:56

I was looking for a way to to highlight a listbox item when the mouse pointer is over it.

I actually found a way to do so by using the following work-around:
- set the selection brush to hihlight my listbox item doing so: setSelectionBrushImage("TaharezLook", "MultiListSelectionBrush");
- catch the mouse move event of the listbox
- in the mouse move function, find the item currently under the mouse pointer and select it manually

However there is one problem with this way of doing things: the method "getItemAtPoint" I would need from the listbox is currently protected.

So my question is:
Is there a better way to do what I am trying to? Or if not, would it be possible to set the method "getItemAtPoint" to public?

Thanks,

Rincevent

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: highlight a listbox item on mouse enter

Postby CrazyEddie » Sun Dec 13, 2009 16:42

Is there a better way to do what I am trying to?

Probably not. You might be able to make use of ComboDropList, since it uses the behaviour that you desire, though I can't recall the implications of using this widget when it's not attached to a Combobox (IIRC, people have used it before as a standalone widget).

Or if not, would it be possible to set the method "getItemAtPoint" to public?

This request came up a few weeks ago in relation to the ComboDropList. We had some discussion about it, and decided making this happen is possible, though with a couple of small tweaks here and there. Ultimately the change did not get made, but I will add it to mantis and we'll make it so this time.

CE.


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 9 guests