OpenDCL Forums

OpenDCL => Runtime/AutoLISP => Topic started by: jb on April 28, 2008, 08:14:43 AM

Title: New Mouse events for Modeless Forms
Post by: jb on April 28, 2008, 08:14:43 AM
5.0.0.13
I'm trying to use the two new events, OnMouseEntered & OnMouseMovedOff, to automatically roll up a modeless form.  I'm using the two subs below just to see when the events are firing: this throws AutoCAD in to a loop printing the two princs at the command line over and over.  Must use Task Manager to shut down AutoCAD.  What's the appropriate use of these two events???


(defun c:jb001_00_OnMouseEntered ( /)
     (princ "\nOnMouseEntered")
)
(defun c:jb001_00_OnMouseMovedOff ( /)
     (princ "\nOnMouseMovedOff")
)


Thanks for any help . . .

jb
Title: Re: New Mouse events for Modeless Forms
Post by: owenwengerd on April 28, 2008, 09:01:53 AM
The problem is that OnMouseEnter is being called continuously instead of only when the mouse first enters the dialog.  I'll get that corrected for the next Alpha.  In the meantime, you could set a flag when the mouse moves off, then ignore the OnMouseEnter event if the flag is not set.
Title: Re: New Mouse events for Modeless Forms
Post by: jb on April 28, 2008, 09:44:02 AM
I'll try that - Thanks Owen
Title: Re: New Mouse events for Modeless Forms
Post by: Kelie on May 09, 2008, 10:54:51 AM
Owen,

The OnMouseEntered and OnMouseMovedOff event is working nicely. Thanks! But they behave in a slightly different manner. The OnMouseEntered event is fired whenever mouse is hovered over the form, no click is needed, but the OnMouseMovedOff event is only fired when user clicks on the screen. Is this the intended behavior?

Thank you!
Title: Re: New Mouse events for Modeless Forms
Post by: owenwengerd on May 09, 2008, 08:22:18 PM
Yes, that is by design when the keyboard focus is on a control that accepts keyboard input. In that case, the mouse is "captured" by the control with focus and not released until it is clicked outside the form.

Quote from: Kelie on May 09, 2008, 10:54:51 AM
The OnMouseEntered event is fired whenever mouse is hovered over the form, no click is needed, but the OnMouseMovedOff event is only fired when user clicks on the screen. Is this the intended behavior?