[wx-dev] Re: Need to handle wxEVT_MOUSE_CAPTURE_LOST in wxGrid subwindow?

Vadim Zeitlin vadim at wxwindows.org
Sun Mar 4 14:17:58 PST 2007


On Sat, 03 Mar 2007 08:41:22 +0100 "Knut P. Lehre" <knutpl at broadpark.no> wrote:

KPL> If wxGridWindow captures the mouse (see example in wxGrid::ChangeCursorMode() which
KPL> contains a "win = m_gridWin;" followed later by a "win->CaptureMouse();"), why is there
KPL> no EVT_MOUSE_CAPTURE_LOST handler? Is this a bug?

 Yes, it is.

KPL> Adding this patch to 2.8.0 prevents the assertion error message in my app:
KPL> 
KPL> Index: grid.cpp
KPL> ===================================================================
KPL> RCS file: /pack/cvsroots/wxwidgets/wxWidgets/src/generic/grid.cpp,v
KPL> retrieving revision 1.417
KPL> diff -r1.417 grid.cpp
KPL> 223a224
KPL> >     void OnMouseCaptureLost( wxMouseCaptureLostEvent &event ){}
KPL> 3987a3989
KPL> >     EVT_MOUSE_CAPTURE_LOST( wxGridWindow::OnMouseCaptureLost )

 This does suppress the assert but it still leaves the bug in. For example,
the grid still wouldn't "notice" that the column is not being resized any
more and so on. I've tried to really fix it and the results of this are in
the cvs now, please test them. This is probably still not ideal but much
better than before, at least column resizing is indeed cancelled if
something steals mouse from the grid while it's in progress.

 Regards,
VZ





More information about the wx-dev mailing list