Posted 12 years ago by Peter Chapman
Version: 4.0.0250
Avatar
Dear Actipro,

I've got a problem with catching mouse events. I've got an MDI application, and one of the windows may contain a syntax editor. A user may drag an item off one window, and onto the syntax editor.

I want to handle a MouseHover event, so when the user drags an item and hovers it over the syntax editor, i can bring this window to the front.

My problem is that MouseHover or Editor.ViewMouseHover don't fire on mouse hover if it's a drag operation.

In addition, the PasteDragDrop handler does not have a DragOver source, so the best i can come up with is to handle the PasteDragDrop when the source is PasteDragDropSource.DragEnter and kick off a timer thread that will check if the mouse is still within bounds after half a second (somehow).

A PasteDragDrop.DragLeave would have helped.

Any ideas?

Comments (7)

Posted 12 years ago by Kelly Leahy - Software Architect, Milliman
Avatar
I'm confused... You can't just use the regular winforms DragOver event? Does it not work?

Kelly Leahy Software Architect Milliman, USA

Posted 12 years ago by Peter Chapman
Avatar
Kelly,

The DragOver inherited from Control never fires. I guess it's somehow consumed by the control's own processing.
Posted 12 years ago by Kelly Leahy - Software Architect, Milliman
Avatar
OK... I figured it was something like that. Just thought I'd need to state the obvious just in case.

We'll have to see what Actipro says.

Kelly Leahy Software Architect Milliman, USA

Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
That is correct, drag operations stop normal mouse activity messages since the mouse is captured.

We'll try and add PasteDragDrop.DragLeave and make the event fire on drag leaves for the next maintenance release.


Actipro Software Support

Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Actually after looking into this more, we probably will not add the PasteDragDrop.DragLeave. The reason is that OnDragLeave doesn't include a DragEventArgs which is needed for the PasteDragDrop event.

The reason we don't raise the standard drag events to you is that there is a lot of complex code that goes into making drag/drop in a text editor work and we don't want that code corrupted.

However that being said, you can create a class that inherits SyntaxEditor, override the OnDragLeave method, call its base implementation, and then raise the DragLeave event yourself. This way you do get your DragLeave notification.


Actipro Software Support

Posted 12 years ago by Peter Chapman
Avatar
Right. Plenty to work with there.

It's just about the weekend here, yay! I'll give that a spin on Monday morning.

Have a good weekend!
Posted 12 years ago by Peter Chapman
Avatar
Yes, that's the solution, thanks Actipro.
The latest build of this product (v2018.1 build 0341) was released 3 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.