View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0026106 | Lazarus | Widgetset | public | 2014-05-04 14:40 | 2015-04-24 22:02 |
Reporter | Bart Broersma | Assigned To | Zeljan Rikalo | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Platform | i386 | OS | Linux | ||
Product Version | 1.3 (SVN) | ||||
Summary | 0026106: QT: Speedbutton incorrectly moves focus // Example SynEdit looses caret when clicking on a TSpeedButton | ||||
Description | If you are in a SynEdit and then click on a TSpeeButton, the caret from SynEdit disappear. You can only get it back if you set focus to another control control and the go back into the SynEdit (by mouse or by Tab). | ||||
Steps To Reproduce | Build attached App. Click in SynEdit. Click SpeedButton (it has no caption and does nothing). Expected result: focus remains on SyEdit and Caret is unaltered Observed result: focus remains on SynEdit, but Caret is gone. | ||||
Tags | No tags attached. | ||||
Fixed in Revision | 44923 | ||||
LazTarget | - | ||||
Widgetset | QT | ||||
Attached Files |
|
related to | 0027960 | closed | Zeljan Rikalo | QT: 'External: SIGSEGV' on TDateEdit |
|
|
|
This has probably relation to 0024735. |
|
Better subject |
|
Does it actually remove focus? If you add an OnClick handler for the speedbutton it says that SynEdit has focus (provided you were in Synedit1 to begin with). procedure TForm1.SpeedButton1Click(Sender: TObject); var i: Integer; C: TControl; begin for i := 0 to Self.ControlCount - 1 do begin C := Self.Controls[i]; if (C is TwinControl) then if TWinControl(C).Focused then writeln(C.Name,' has focus.'); end; end; |
|
SynEdit monitors procedure WMKillFocus(var Msg: TWMKillFocus); message WM_KILLFOCUS; procedure WMSetFocus(var Msg: TLMSetFocus); message WM_SETFOCUS; So if it triggers WMKillFocus then it must return the focus with WMSetFocus |
|
Placing some debug statements in TWinControl.WMSet/KillFocus and the same for TCustomSyEdit gives me this: Press speedbutton when Edit has focus: TWinControl.WMSetFocus A Edit1:TEdit TWinControl.WMKillFocus A Form1:TForm1 TWinControl.WMKillFocus A Edit1:TEdit //now the onClick of speedbutton Press speedbutton when Memo has focus: TWinControl.WMSetFocus A Memo1:TMemo TWinControl.WMKillFocus A Form1:TForm1 TWinControl.WMKillFocus A Memo1:TMemo //now the onClick of speedbutton Press speedbutton when Button has focus: TWinControl.WMSetFocus A Button1:TButton TWinControl.WMKillFocus A Form1:TForm1 TWinControl.WMKillFocus A Button1:TButton //now the onClick of speedbutton Press speedbutton when SynEdit has focus: [TCustomSynEdit.WMSetFocus] A TWinControl.WMSetFocus A SynEdit1:TSynEdit [TCustomSynEdit.WMSetFocus] END TWinControl.WMKillFocus A Form1:TForm1 TCustomSynEdit.WMKillFocus A TWinControl.WMKillFocus A SynEdit1:TSynEdit TWinControl.WMKillFocus A SynEdit1:TSynEdit TCustomSynEdit.WMKillFocus End //now the onClick of speedbutton TCustomSynEdit.WMKillFocus A TWinControl.WMKillFocus A SynEdit1:TSynEdit TWinControl.WMKillFocus A SynEdit1:TSynEdit TCustomSynEdit.WMKillFocus End In this case there seems to be an additional KillFocus _after_ the speedbutton' click? Also TCustomSynEdit.WMKillFocus calsl inherited twice. Not sure if that's by design or an oversight. |
|
FWIW: under GTK2 there is no WMKillFocus from the control you were at before clicking the speedbutton. |
|
Seem that LCL does not like order of qt focus messages: SetFocus KillFocus I've changed it locally to KillFocus SetFocus and it seem to be ok now. I'll commit after heavy tests. |
|
Please test and close if ok. |
Date Modified | Username | Field | Change |
---|---|---|---|
2014-05-04 14:40 | Bart Broersma | New Issue | |
2014-05-04 14:40 | Bart Broersma | File Added: focus.zip | |
2014-05-04 14:50 | Vojtech Cihak | Note Added: 0074756 | |
2014-05-04 16:19 | Martin Friebe | Note Added: 0074759 | |
2014-05-04 16:19 | Martin Friebe | Summary | SynEdit on QT looses caret when clicking on a TSpeedButton => QT: Speedbutton incorrectly moves focus // Example SynEdit looses caret when clicking on a TSpeedButton |
2014-05-04 18:20 | Bart Broersma | Note Added: 0074761 | |
2014-05-04 18:26 | Martin Friebe | Note Added: 0074762 | |
2014-05-04 18:26 | Martin Friebe | Note Edited: 0074762 | View Revisions |
2014-05-04 20:08 | Bart Broersma | Note Added: 0074764 | |
2014-05-04 20:36 | Zeljan Rikalo | Assigned To | => Zeljan Rikalo |
2014-05-04 20:36 | Zeljan Rikalo | Status | new => assigned |
2014-05-04 23:42 | Bart Broersma | Note Added: 0074766 | |
2014-05-04 23:56 | Bart Broersma | Note Edited: 0074756 | View Revisions |
2014-05-05 07:53 | Zeljan Rikalo | Status | assigned => confirmed |
2014-05-05 09:31 | Zeljan Rikalo | Note Added: 0074774 | |
2014-05-05 13:30 | Zeljan Rikalo | Fixed in Revision | => 44923 |
2014-05-05 13:30 | Zeljan Rikalo | Note Added: 0074779 | |
2014-05-05 13:30 | Zeljan Rikalo | Status | confirmed => resolved |
2014-05-05 13:30 | Zeljan Rikalo | Resolution | open => fixed |
2014-05-07 12:32 | Bart Broersma | Status | resolved => closed |
2015-04-24 22:02 | Jesus Reyes | Relationship added | related to 0027960 |