TForm.ActiveControl overwritten
Original Reporter info from Mantis: kkp
-
Reporter name: Kim Pedersen
Original Reporter info from Mantis: kkp
- Reporter name: Kim Pedersen
Description:
When dropping two TEdits on a new form you can set the ActiveControl property on the form to one of them without any problem. When ActiveControl has been set you can toggle between the components and the form, and the form still remembers ActivControl correctly.
When saving the project and restarting Lazarus, the IDE will only accept one particular control as ActiveControl on the form (I think it is the upper left most). That is, if you select Edit2 as ActiveControl in the property editor and then click on the form afterwards, it will revert to Edit1. It only happens if you click on the form. If you select the form in the dropdown menu in the property editor, it will display the right control.
Additional information:
Having compiled Lazarus with VerboseFocus this is what I get when clicking on the form:
----
GTKFocusCBAfter Widget=09972720 Event^.theIn=1 LCLObject=Form1:TForm1
GetFocus=nil
TWinControl.WndProc LM_SetFocus Edit2:TEdit
TCustomForm.SetFocusedControl Self=Form1:TForm1 Control=Edit2:TEdit Control.HandleAllocated=True
gtkfrmactivateAfter Widget=09972720 Event^.theIn=1 LCLObject=Form1:TForm1
GetFocus=nil
GTKFocusCBAfter Widget=09BAF840 Event^.theIn=1 LCLObject=Edit1:TEdit
GetFocus=09BAF840 ParentLCLFocus=Edit1:TEdit
TWinControl.WndProc LM_SetFocus Edit1:TEdit
TCustomForm.SetFocusedControl Self=Form1:TForm1 Control=Edit1:TEdit Control.HandleAllocated=True
TCustomForm.SetFocusedControl Self=Form1:TForm1 SomeParent=Form1:TForm1 OldActiveControl=Edit2:TEdit New=Edit1:TEdit
----
You can see that the activecontrol is somehow changed back to Edit1 in GTKFocusCB
Mantis conversion info:
- Mantis ID: 17951
- Version: 0.9.29 (SVN)
- Fixed in version: 0.9.29 (SVN)
- Fixed in revision: 28305 (#d94f3453)
- Target version: 1.0.0
- LazTarget: 1.0