OnMouseDown event

Started by velasquez, January 28, 2016, 08:30:08 AM

Previous topic - Next topic

velasquez

The OnMouseDown event is not working as is described in OpenDCL 8.0.1.0.
"This event is triggered When one of the mouse buttons is pressed on the control."
After the first call he continues to work out of control. This does not happen or other events over the control.
Is this a bug or need to implement something to work around?
I attached an example.

velasquez

Quote from: velasquez on January 28, 2016, 08:30:08 AM
The OnMouseDown event is not working as is described in OpenDCL 8.0.1.0.
"This event is triggered When one of the mouse buttons is pressed on the control."
After the first call he continues to work out of control. This does not happen or other events over the control.
Is this a bug or need to implement something to work around?
I attached an example.

The picture shows the result of a click out of control and form.

roy_043

Seems to be a focus issue.
I think you can compare the X and the Y arguments against the width and height of the control to create a workaround.

velasquez

Quote from: roy_043 on January 28, 2016, 01:10:52 PM
Seems to be a focus issue.
I think you can compare the X and the Y arguments against the width and height of the control to create a workaround.

Thank you roy
I also believe that the problem is the focus but I tried to shift the focus of control after the click, and could not.
A comparison of the X and Y values with the control works well.
Now take the case:
A function closes the form after a click and do something, if the user clicks again starting before the return of the form control will respond again.

owenwengerd

Is this on Windows 10? Your sample seems fine on Windows 7, but I have heard that Windows 10 does some funky things with focus.

owenwengerd

Ah, now I see the problem. The behavior is from the button not releasing the mouse capture. Normally button-down captures the mouse, then capture is released during button-up. In this case a modal popup is interrupting the process and capture never gets released.

Note that it's generally more dangerous to perform actions with side effects during button-down. This is why Windows buttons normally act on button-up instead of button-down. Maybe you can use button-up instead of button-down?

velasquez

Quote from: owenwengerd on January 30, 2016, 04:04:02 PM
Ah, now I see the problem. The behavior is from the button not releasing the mouse capture. Normally button-down captures the mouse, then capture is released during button-up. In this case a modal popup is interrupting the process and capture never gets released.

Note that it's generally more dangerous to perform actions with side effects during button-down. This is why Windows buttons normally act on button-up instead of button-down. Maybe you can use button-up instead of button-down?

Thank you Owen,
Yes I am working with Windows 10.
I will try your suggestion.

velasquez

Quote from: velasquez on January 31, 2016, 03:03:35 AM
Quote from: owenwengerd on January 30, 2016, 04:04:02 PM
Ah, now I see the problem. The behavior is from the button not releasing the mouse capture. Normally button-down captures the mouse, then capture is released during button-up. In this case a modal popup is interrupting the process and capture never gets released.

Note that it's generally more dangerous to perform actions with side effects during button-down. This is why Windows buttons normally act on button-up instead of button-down. Maybe you can use button-up instead of button-down?

Thank you Owen,
Yes I am working with Windows 10.
I will try your suggestion.

The OnMouseUp event worked fine.
Thanks.