Wrong Event Order Dropping Into Active Cell

General TRichView support forum. Please post your questions here
Post Reply
Michel
Posts: 92
Joined: Fri Oct 14, 2005 2:56 pm
Contact:

Wrong Event Order Dropping Into Active Cell

Post by Michel »

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
Sergey Tkachenko
Site Admin
Posts: 17315
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Hmm, I am not sure that I have control over these events.
May be you can invent a workaround for your application?
Michel
Posts: 92
Joined: Fri Oct 14, 2005 2:56 pm
Contact:

Post by Michel »

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
Post Reply