Selecting list items under the mouse

Vadim Zeitlin vadim at wxwindows.org
Thu Aug 3 16:27:00 PDT 2006


On Thu, 3 Aug 2006 14:37:43 +1000 Gian Lorenzetto <gian at anatomics.com> wrote:

GL> My current approach is to use the HitTest() method of listctrl to get
GL> the item index and then select the item, only I can't work out how to
GL> get the mouse move events from the listctrl. Am I going about this the
GL> wrong way? Should I be subclassing the listctrl and catching the mouse
GL> events there?

 This is the standard solution, yes. If you don't want to create a class
just for this (although I don't see why: a control highlighting its
elements when mouse is over them seems to merit a separate class IMHO) you
can also Connect() the wxEVT_MOTION event to a method of another class
taking care to pass the correct pointer as eventSink parameter.

 Regards,
VZ

-- 
TT-Solutions: wxWidgets consultancy and technical support
               http://www.tt-solutions.com/





More information about the wx-users mailing list