Hi Sergey,
Summary of the problem. Drag-and-drop an object (B) into a TRichViewEdit (RV).
If dropped into text or an inactive cell of a table, the order of events is: RV.OnDragDrop followed by B.OnEndDrag (which seems to be the correct order).
If dropped into active cell, the order of events is reversed: B.OnEndDrag followed by RV.OnDragDrop. This looks like a bug to me.
The above usually doesn't cause any noticeable problems – except if dragging a custom drag object from some component that deletes the "Source" drag object in response to the OnEndDrag event. In my case, this happens to be ExpressQuantumGrid. The net result is therefore a deleted "Source" object by the time I get the RV.OnDragDrop event. But only when dropping into an active cell. By this I mean: the cell that the cursor was in before I started the drag operation.
Thank you,
Michel
Wrong Event Order Dropping Into Active Cell
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Yep, I probably can.
As to control over these events, I have an intuitive feeling that perhaps the out-of-order firing is caused by what RV code does when re-entering into an active InplaceEditor. I have no idea what this might be though. In my (limited) experience, something like an innocent Application.ProcessMessages() could cause strange side-effects. Or playing with WM_SETREDRAW in the "wrong" place.
Can't think of anything else...
Michel
As to control over these events, I have an intuitive feeling that perhaps the out-of-order firing is caused by what RV code does when re-entering into an active InplaceEditor. I have no idea what this might be though. In my (limited) experience, something like an innocent Application.ProcessMessages() could cause strange side-effects. Or playing with WM_SETREDRAW in the "wrong" place.
Can't think of anything else...
Michel