Page 1 of 1

MultiColumnList double click on empty space

Posted: Sun Nov 20, 2011 18:22
by saejox
Hi,

I want double click to work only on items in the list. Since list items are not windows i cant get their location.

Do you know how to accomplish this?

thanks.

Re: MultiColumnList double click on empty space

Posted: Mon Nov 21, 2011 09:04
by CrazyEddie
You'd have to take the mouse location at the time of the double-click event and calculate which item (if any) it was over, and ignore it if it was none.

There is a function defined for MultiColumnList that returns the item given a (window local) point. Unfortunately this function is currently protected :roll: So, you have some options: i) write custom code based on the protected member function, ii) make the function public and recompile CEGUI, iii) create a MCL subclass with a function that exposes the required behaviour (likely by calling the protected function), then register and use that MCL subclass in place of the stock MCL (this wiki article shows the technique I mean, though it does not specifically provide the behaviour you need: http://www.cegui.org.uk/wiki/index.php/ ... andard_one).

You should probably add a request to the CEGUI project on our mantis tracker (http://mantis.cegui.org.uk) asking for this functionality to be exposed for users ;)

CE.