Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2017-01

Form.ActiveChanged vs Screen ActiveControlChanged

4 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

José Mejuto

Hello,

In my code I'm overriding "Form.ActiveChanged" to catch when control focus changes and perform some global checks, it works fine except when focus is changed with mouse.

As a test I've added a handler in Screen.ActiveControlChanged and in this case it works with both mouse and keyboard.

Is this behaviour intented ? I'm testing in Windows 7 with SVN fpc and Lazarus. I do not know how Delphi works.

Attached there is a small test program, change the TEdit focus using both mouse and keyboard (Tab) and see the differences.

Saludos,
José Mejuto

-------------- next part -------------- A non-text attachment was scrubbed... Name: activechanged_test.zip Type: application/zip Size: 3494 bytes Desc: not available URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20170108/2f444624/attachment-0001.zip>

Reply by email

Bart
to José Mejuto
José Mejuto wrote 11 lines
Hello, In my code I'm overriding "Form.ActiveChanged" to catch when control focus changes and perform some global checks, it works fine except when focus is changed with mouse. As a test I've added a handler in Screen.ActiveControlChanged and in this case it works with both mouse and keyboard. Is this behaviour intented ? I'm testing in Windows 7 with SVN fpc and Lazarus. I do not know how Delphi works.

In D7 TForm.ActiveChanged is not fired if I change the focus with the mouse, but it is if I change focus with Tab.

Bart

Reply by email

José Mejuto
to Bart
Bart wrote
On 1/8/17, José Mejuto via Lazarus wrote:

[...]

Show quoted text 6 lines
> Is this behaviour intented ? I'm testing in Windows 7 with SVN fpc and > Lazarus. I do not know how Delphi works. In D7 TForm.ActiveChanged is not fired if I change the focus with the mouse, but it is if I change focus with Tab.

Hello,

Thank you, so it is Delphi compatible and nothing to be changed. Thank you for your tests.

Reply by email