Page 1 of 1

highlight a listbox item on mouse enter

Posted: Sun Dec 13, 2009 14:56
by Rincevent
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

Re: highlight a listbox item on mouse enter

Posted: Sun Dec 13, 2009 16:42
by CrazyEddie
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.