Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
420
Strange sequence of events for UltraTextEditor
posted

We inherited a control from UltraTextEditor overriding some of the OnXxx... methods. Several methods are beeing called in a very strange way:

  • OnEnter is beeing called recursive

  • OnLostFocus is called while OnGotFocus is active

  • OnGotFocus is only called, when the control looses focus, not when it gets the focus

  • Entering the control via mouse click triggers OnLostFocus

  • Moving the mouse over the control triggers OnMouseEnter immediately followed by OnMouseLeave

  • Moving the mouse away from the control triggers OnMouseEnter followed by OnMouseLeave

We want to offer the user an option to control selection behaviour if the control is entered with the possibility to distinguish if the control receives the focus by mouse click or through use of the Tab key. This does not seem to be possible the way OnXxx... methods are beeing called.

Below the sequence of "events" for the different situations:

Entering via TAB key

OnEnter edt01 - Start
OnEnter edt01 - Start (recursive call)
OnEnter edt01 - End (recursive call)
OnEnter edt01 - End

Leaving via TAB key

OnGotFocus edt01 - Start
OnLostFocus edt01 - Start (nested call)
OnLostFocus edt01 - End
OnGotFocus edt01 - End
OnGotFocus edt01 - Start
OnGotFocus edt01 - End
OnLeave edt01 - Start
OnLeave edt01 - End
OnLostFocus edt01 - Start
OnLostFocus edt01 - End

Entering via mouse click

OnMouseEnter edt01 - Start
OnMouseEnter edt01 - End
OnMouseDown edt01 - Start
OnEnter edt01 - Start
(nested call)
OnLostFocus edt01 - Start
(nested call)
OnLostFocus edt01 - End
OnEnter edt01 - Start (recursive call)
OnEnter edt01 - End (recursive call)
OnEnter edt01 - End
OnMouseDown edt01 – End

The mouse is still over the control while the following override is beeing called
OnMouseLeave edt01 - Start
OnMouseLeave edt01 - End

Moving the mouse away from the control

OnMouseEnter edt01 - Start
OnMouseEnter edt01 - End
OnMouseLeave edt01 - Start
OnMouseLeave edt01 - End

Moving the mouse back to the control

OnMouseEnter edt01 - Start
OnMouseEnter edt01 - End
OnMouseLeave edt01 - Start
OnMouseLeave edt01 - End

Leaving via mouse click

OnLeave edt01 - Start
OnLeave edt01 - End

Could there be anything we are doing wrong to cause this strange sequence of "events"?

Regards
Burkhard Exner

 

Parents Reply Children
No Data