Bugs item #1583135, was opened at 2006-10-23 13:24
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=462816&aid=1583135&group_id=51305

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: treelistctrl
Group: CVS HEAD
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Carl Godkin (cgodkin)
Assigned to: Otto Wyss (wyo)
Summary: assertion in DoNotifyWindowAboutCaptureLost in wxMSW 2.7.1 

Initial Comment:
I wrote to wx-users about an assert I started getting
after we upgraded to wx 2.7.1.  I think what I wrote
and what Vadim replied explain the problem, so I'll
just cut & paste...

---Carl---8<--------------------------------

I'm having trouble with drag and drop now that I've
upgraded to wx 2.7.1.

I get an assertion when I start to drag an item in my
application.  Long ago
when I was trying to get this behavior going, Otto
kindly pointed me at his
wyoFiler application where he had implemented drag &
drop with a
wxTreeListCtrl, which is just what I needed.

I just downloaded the latest version of wyoFiler and
built it with wxMSW 2.7.1
and that application crashes the same way when starting
to drag an item.

Anyway, both applications assert when I call
wxDropSource::DoDragDrop()
with this message:
..\..\src\common\wincmn.cpp(2405): assert
"wxAssertFailure" failed in
DoNotifyWindowAboutCaptureLost(): window that captured
the mouse
didn't process wxEVT_MOUSE_CAPTURE_LOST

I never heard of this event before and I don't have all
that clear an
understanding of what I need to do in order to get drag
& drop going
again in my application.


----Vadim---8<-----------------------------
 Usually when you capture the mouse you call
CaptureMouse() and then, at
some later time, ReleaseMouse() and you suppose that
you do have the mouse
capture in between. Unfortunately, this is too
simplistic as your
application may also lose capture before you call
ReleaseMouse() because,
for example, user pressed some special key combination
or even because
another application popped up a message box
unexpectedly. This is what this
event notifies you about. And you must handle it as the
application should
really know whether it really has capture or not (e.g.
a control which
captures the mouse and loses the capture must snap back
to its normal
state) and you must not call ReleaseMouse() if you had
already lost
capture.

---Carl---8<--------------------------------

I simply added an event handler for
wxMouseCaptureLostEvent to
the wxTreeListCtrl's wxTreeListMainWindow and I no
longer get the
assertion.

The handler does nothing which I think is OK because
ReleaseMouse()
is always called like this in wxTreeListCtrl:
    if (HasCapture()) ReleaseMouse();


------

Thanks!

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=462816&aid=1583135&group_id=51305

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
wxCode-users mailing list
wxCode-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxcode-users

Reply via email to