Kirix Support Forums

BUG - [ 1834906 ] wxAssertFailure wxEVT_MOUSE_CAPTURE_LOST

Please post any wxAUI patches or modifications you've created here. Thanks!

BUG - [ 1834906 ] wxAssertFailure wxEVT_MOUSE_CAPTURE_LOST

Postby NinjaNL on Thu Nov 29, 2007 5:16 am

auibook.h - line 475 add text
Code: Select all
   void OnCaptureLost(wxMouseCaptureLostEvent& event);


auibook.cpp - line 2191 add text
Code: Select all
    EVT_MOUSE_CAPTURE_LOST(wxAuiTabCtrl::OnCaptureLost)


auibook.cpp - line +- 2625 add text

Code: Select all
void wxAuiTabCtrl::OnCaptureLost(wxMouseCaptureLostEvent&
WXUNUSED(event))
{
}



This simply creates a "placeholder" for the event, which removes the error generated, since the AUINotebook now handles the event. (OK it's about as useful as a damp rag but it solves the problem)

HTH
Mal
NinjaNL
Registered User
 
Posts: 40
Joined: Thu Jun 14, 2007 6:53 am

Re: BUG - [ 1834906 ] wxAssertFailure wxEVT_MOUSE_CAPTURE_LOST

Postby NinjaNL on Thu Nov 29, 2007 7:47 am

Code: Select all
Index: include/wx/aui/auibook.h
===================================================================
--- include/wx/aui/auibook.h   (revision 50326)
+++ include/wx/aui/auibook.h   (working copy)
@@ -474,6 +474,7 @@
     void OnSetFocus(wxFocusEvent& event);
     void OnKillFocus(wxFocusEvent& event);
     void OnChar(wxKeyEvent& event);
+   void OnCaptureLost(wxMouseCaptureLostEvent& event);

protected:

Index: src/aui/auibook.cpp
===================================================================
--- src/aui/auibook.cpp   (revision 50326)
+++ src/aui/auibook.cpp   (working copy)
@@ -2186,6 +2186,7 @@
     EVT_SET_FOCUS(wxAuiTabCtrl::OnSetFocus)
     EVT_KILL_FOCUS(wxAuiTabCtrl::OnKillFocus)
     EVT_CHAR(wxAuiTabCtrl::OnChar)
+    EVT_MOUSE_CAPTURE_LOST(wxAuiTabCtrl::OnCaptureLost)
END_EVENT_TABLE()


@@ -2619,6 +2620,11 @@
         event.Skip();
}

+void wxAuiTabCtrl::OnCaptureLost(wxMouseCaptureLostEvent& WXUNUSED(event))
+{
+}
+
+
// wxTabFrame is an interesting case.  It's important that all child pages
// of the multi-notebook control are all actually children of that control
// (and not grandchildren).  wxTabFrame facilitates this.  There is one
NinjaNL
Registered User
 
Posts: 40
Joined: Thu Jun 14, 2007 6:53 am

Re: BUG - [ 1834906 ] wxAssertFailure wxEVT_MOUSE_CAPTURE_LOST

Postby Ben on Fri Nov 30, 2007 8:38 am

How do I reproduce the problem?

Thanks much,
Ben
Ben Williams
Kirix Support Team
User avatar
Ben
Kirix Support Team
 
Posts: 525
Joined: Mon Dec 19, 2005 6:29 am

Re: BUG - [ 1834906 ] wxAssertFailure wxEVT_MOUSE_CAPTURE_LOST

Postby NinjaNL on Fri Nov 30, 2007 9:12 am

http://sourceforge.net/tracker/index.php?func=detail&aid=1834906&group_id=9863&atid=109863

Basically it is a debug build, add an event handler for AUI Notebook Page Changed event, and in the handler add the following code

Code: Select all
wxMessageDialog dialog(this,_T("This is an error"),_T("Error"),wxOK);
dialog.ShowModal();<-----happens here


The first time there is a notebook page change you should get the wxAssertFailure message.

The fix simply adds a handler (that swallows the event). Now whenever the wxEVT_MOUSE_CAPTURE_LOST event is fired, it is handled, so wxWidgets no longer generates the assert.

Best
Mal
NinjaNL
Registered User
 
Posts: 40
Joined: Thu Jun 14, 2007 6:53 am

Re: BUG - [ 1834906 ] wxAssertFailure wxEVT_MOUSE_CAPTURE_LOST

Postby Ben on Thu Dec 06, 2007 9:17 am

Wonderful. Thanks for the report.

Best,
Ben
Ben Williams
Kirix Support Team
User avatar
Ben
Kirix Support Team
 
Posts: 525
Joined: Mon Dec 19, 2005 6:29 am

Re: BUG - [ 1834906 ] wxAssertFailure wxEVT_MOUSE_CAPTURE_LOST

Postby Ben on Sun Aug 03, 2008 8:58 am

Patch applied to 2.8 and trunk. Thanks.
Ben Williams
Kirix Support Team
User avatar
Ben
Kirix Support Team
 
Posts: 525
Joined: Mon Dec 19, 2005 6:29 am

Return to wxAUI Patches & Modifications