Sign in Join

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

Mailing lists / lazarus / 2015-10

TCustomControl focus handling difference

8 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

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

Gabor Boros

Hi All,

If click on the green control in the example project Edit1 loose focus on Linux(Qt KDE4) and not on Windows. Is it a simple platform difference or a bug? (I want Edit1 stay focused but green control can handle mouse clicks. I don't know which one is operating normally and where to start fix my control on Linux or Windows).

Gabor
-------------- next part --------------
A non-text attachment was scrubbed...
Name: MyControl.tar.gz
Type: application/gzip
Size: 1475 bytes
Desc: not available
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20151019/49fb0c30/attachment.bin>

Reply by email

Zeljko
to Gabor Boros
Gabor Boros wrote 7 lines
Hi All, If click on the green control in the example project Edit1 loose focus on Linux(Qt KDE4) and not on Windows. Is it a simple platform difference or a bug? (I want Edit1 stay focused but green control can handle mouse clicks. I don't know which one is operating normally and where to start fix my control on Linux or Windows).

Probably platform diff. Qt have mechanism to dissalow focus switch via mouse but I could not find any in LCL. Try with gtk2.

zeljko

Reply by email

Gabor Boros
to Zeljko

2015.10.19. 14:40 keltez?ssel, Zeljko ?rta:

Probably platform diff. Qt have mechanism to dissalow focus switch via mouse but I could not find any in LCL. Try with gtk2.

If modify the example...

   with TMyControl.Create(Self) do
    begin
      ControlStyle:=ControlStyle+[csNoFocus];

...Edit1 not loose the focus on green control click just the text selection.

Gabor

Reply by email

Zeljko
to Gabor Boros
Gabor Boros wrote 12 lines
2015.10.19. 14:40 keltez?ssel, Zeljko ?rta: > Probably platform diff. Qt have mechanism to dissalow focus switch via > mouse but I could not find any in LCL. Try with gtk2. If modify the example... with TMyControl.Create(Self) do begin ControlStyle:=ControlStyle+[csNoFocus]; ...Edit1 not loose the focus on green control click just the text selection.

Yes, now I remember that I've implemented csNoFocus in Qt some time ago,so it works. What about selection ?

zeljko

Reply by email

Gabor Boros
to Zeljko

2015.10.19. 15:18 keltez?ssel, Zeljko ?rta:

Yes, now I remember that I've implemented csNoFocus in Qt some time ago,so it works. What about selection ?

If added csNoFocus caret not moved in Edit1 (which is good) just text selection lost if click on the green control.

Gabor

Reply by email

Zeljko
to Gabor Boros
Gabor Boros wrote 6 lines
2015.10.19. 15:18 keltez?ssel, Zeljko ?rta: > Yes, now I remember that I've implemented csNoFocus in Qt some time > ago,so it works. What about selection ? If added csNoFocus caret not moved in Edit1 (which is good) just text selection lost if click on the green control.

Please open an issue about it and attach example project. I'll check if it's Qt lib bug or lclqt one.

zeljko

Reply by email