Need to handle wxEVT_MOUSE_CAPTURE_LOST in wxGrid subwindow?

olivier.corrio at gmail.com olivier.corrio at gmail.com
Mon Mar 5 01:23:26 PST 2007


Hi,
i m not sure but in the documentation it is said that
wxMouseCaptureLostEvent is only on wxMSW.
Regards Olivier

On 2 mar, 12:31, knu... at broadpark.no ("Knut P. Lehre") wrote:
> VZ> You shouldn't have to handle the mouse lost event resulting from the mouse
> VZ>capture done by wxGrid itself, the control should do it on its own. If you
> VZ>can still reproduce the bug with wx 2.8.2-rc1 please let us know about how
> VZ>exactly can it be seen.
>
> I havent tested 2.8.2 yet, but look in CVS at grid.cpp rev 1417:
> BEGIN_EVENT_TABLE( wxGridWindow, wxWindow )
>     EVT_PAINT( wxGridWindow::OnPaint )
>     EVT_MOUSEWHEEL( wxGridWindow::OnMouseWheel )
>     EVT_MOUSE_EVENTS( wxGridWindow::OnMouseEvent )
>     EVT_KEY_DOWN( wxGridWindow::OnKeyDown )
>     EVT_KEY_UP( wxGridWindow::OnKeyUp )
>     EVT_CHAR( wxGridWindow::OnChar )
>     EVT_SET_FOCUS( wxGridWindow::OnFocus )
>     EVT_KILL_FOCUS( wxGridWindow::OnFocus )
>     EVT_ERASE_BACKGROUND( wxGridWindow::OnEraseBackground )
> END_EVENT_TABLE()
>
> If wxGridWindow captures the mouse (see example in wxGrid::ChangeCursorMode() which contains a "win = m_gridWin;" followed later by a "win->CaptureMouse();"), why is there no EVT_MOUSE_CAPTURE_LOST handler? Is this a bug?
> Adding this patch to 2.8.0 prevents the assertion error message in my app:
>
> Index: grid.cpp
> ===================================================================
> RCS file: /pack/cvsroots/wxwidgets/wxWidgets/src/generic/grid.cpp,v
> retrieving revision 1.417
> diff -r1.417 grid.cpp
> 223a224
>
> >     void OnMouseCaptureLost( wxMouseCaptureLostEvent &event ){}
> 3987a3989
> >     EVT_MOUSE_CAPTURE_LOST( wxGridWindow::OnMouseCaptureLost )
>
> KPL
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wx-users-unsubscr... at lists.wxwidgets.org
> For additional commands, e-mail: wx-users-h... at lists.wxwidgets.org








More information about the wx-users mailing list