View Issue Details

IDProjectCategoryView StatusLast Update
0031229LazarusLCLpublic2017-06-05 00:08
ReporterCudaText man Assigned ToOndrej Pokorny  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
PlatformUbuntu 14.4 x64 
Product Version1.6.3 (SVN) 
Summary0031229: OI sometimes selects a control as ActiveControl if no ActiveControl is specified in LFM (TimeEdit: ActiveControl not applied)
Descriptionrun demo;
Form has ActiveControl=ed (TimeEdit) but
on show, form activates not ed, next control.
TagsNo tags attached.
Fixed in Revision54926, 54930
LazTarget-
Widgetset
Attached Files

Relationships

related to 0031811 closedOndrej Pokorny Designer changes ActiveControl of designed form automatically if TCustomAbstractGroupedEdit is ActiveControl 

Activities

CudaText man

2017-01-14 18:19

reporter  

tst_timeedit.zip (3,589 bytes)

Bart Broersma

2017-01-14 18:29

developer   ~0097478

Last edited: 2017-01-14 18:31

View 2 revisions

The form in the attached demo does NOT have "ActiveControl = ed" at all.
When I set ActiveControl to Ed (in OI), then buid and run, then the TTimeEdit indeed has focus on program start.
(Tested on win32 WS)

CudaText man

2017-01-14 18:35

reporter   ~0097479

So.. it is a issue of ObjIns form. It shows me that ActiveControl is "ed" when I open form.

Bart Broersma

2017-01-14 22:00

developer   ~0097483

What is "ObjIns form"?

When I try to open your lpi I see no form at all, nor a source-editor.
Lazarus IDE blinks a lot when hoovering the mouse over mainbar.

I opened the .lfm in an external editor: ActiveControl is NOT assigned in the lfm.

Maybe a configuration error on your side?

CudaText man

2017-01-14 22:23

reporter   ~0097484

Last edited: 2017-01-14 22:26

View 2 revisions

and what is OI? You write OI. I write ObjIns. Its the same.
After you open the project, can you show form? OI is showing ActiveControl=ed.

Bart Broersma

2017-01-14 23:55

developer   ~0097485

Sorry, for the confusion about Object Inspector.

I opened the project, I did not see form or unit.
Menu->Project->Forms: double clicked Form1.
Form1 + Unit1 opened.
In Object Inspector: ActiveControl is empty (which is to be expected since there in no mention o activeCotrol in unit1.lfm).

Check it yourself, download the attached project, open unit1.lfm in a text editor of your choice. Try to find ActiveControl, it is not there.

CudaText man

2017-01-15 00:52

reporter   ~0097486

Last edited: 2017-01-15 00:53

View 2 revisions

I got this test proj;
opened in Win10: OI Activecontrol is empty (it should be)
opened in Ubuntu 14.4 x64, GTK2: OI Activecontrol shows "ed"

Yes, no property in .lfm

Bart Broersma

2017-01-15 13:22

developer   ~0097487

Unassigning myself.

Bart Broersma

2017-01-15 13:54

developer   ~0097488

I can confirm the issue with your project on Linux/GTK2-32bits.

(For some reason Gnome archive Manager (3.6.4) is unable to unpack the archive.
Unzip does not have a prblem with it though.)

If I open the project I see no form, nor a unit (why is that?)
I do Menu->Project->Forms->double click From1 and I get the expected Form1 and Unit1.

In OI indeed "Ed" is ActiveControl, even though this is not stored in the lfm.
Build->Run: Edit1 has focus.

In OI set ActiveControl to "Edit2". Build and run: "Edit2" has focus.
In OI set ActiveControl to "Ed". Build and run: Ed (TTimeEdit) has focus, as expected.

Bart Broersma

2017-01-15 14:08

developer   ~0097489

Last edited: 2017-01-15 14:13

View 3 revisions

TCustomForm.DoShowWindow -> TCustomForm.FindDefaultForActiveControl -> Returns Edit1.

TWinControl.FindNextControl TabOrderList 0 Edit1:TEdit
TWinControl.FindNextControl TabOrderList 1 Edit2:TEdit
TWinControl.FindNextControl TabOrderList 2 ed:TTimeEdit
TWinControl.FindNextControl TabOrderList 3 :TEbEdit

Unsurprisingly, setting ed.tabOrder to zero then ensures "ed" will be picked as ActiveControl.

So, now the question is why OI thinks that "ed:TTimeEdit" is the ActiveControl when no ActiveControl is specified in the lfm.

Bart Broersma

2017-01-15 14:31

developer   ~0097490

I did a little bit more testing.
I removed the TTimeEdit form the form. Saved.
Quit and restarted Lazarus.
No ActiveControl is set in OI.

I added a TTimeEdit, saved, built.
No ActiveControl is set in OI.
Quit and restarted Lazarus.
The TTimeEdit is selected as ActiveControl in OI (not registered in lfm)

I removed the TTimeEdit form the form. Saved.
Quit and restarted Lazarus.
No ActiveControl is set in OI.

I then added various TEditButton derived controls (one at a time) and repeated this cycle.
In none of these cycles did OI select any control as ActiveControl.
I did this cycle 3 times more for TTimeEdit specifically, and it never showed up in OI as ActiveControl.

Does OI randomly decide to pick a control to set as ActiveControl?

Juha Manninen

2017-05-14 17:22

developer   ~0100304

Ondrej, is this related to 0031811?

Ondrej Pokorny

2017-05-14 17:42

developer   ~0100305

> Ondrej, is this related to 0031811?

Yes, it is.

Ondrej Pokorny

2017-05-14 17:59

developer   ~0100306

Should be fixed, please test.

Issue History

Date Modified Username Field Change
2017-01-14 18:19 CudaText man New Issue
2017-01-14 18:19 CudaText man File Added: tst_timeedit.zip
2017-01-14 18:24 Bart Broersma LazTarget => -
2017-01-14 18:24 Bart Broersma Summary TimeEdit: ActiveControl nit applied => TimeEdit: ActiveControl not applied
2017-01-14 18:29 Bart Broersma Note Added: 0097478
2017-01-14 18:29 Bart Broersma Assigned To => Bart Broersma
2017-01-14 18:29 Bart Broersma Status new => feedback
2017-01-14 18:31 Bart Broersma Note Edited: 0097478 View Revisions
2017-01-14 18:35 CudaText man Note Added: 0097479
2017-01-14 18:35 CudaText man Status feedback => assigned
2017-01-14 22:00 Bart Broersma Note Added: 0097483
2017-01-14 22:00 Bart Broersma Status assigned => feedback
2017-01-14 22:23 CudaText man Note Added: 0097484
2017-01-14 22:23 CudaText man Status feedback => assigned
2017-01-14 22:26 CudaText man Note Edited: 0097484 View Revisions
2017-01-14 23:55 Bart Broersma Note Added: 0097485
2017-01-14 23:55 Bart Broersma Status assigned => feedback
2017-01-15 00:52 CudaText man Note Added: 0097486
2017-01-15 00:52 CudaText man Status feedback => assigned
2017-01-15 00:53 CudaText man Note Edited: 0097486 View Revisions
2017-01-15 13:21 Bart Broersma Assigned To Bart Broersma =>
2017-01-15 13:22 Bart Broersma Note Added: 0097487
2017-01-15 13:22 Bart Broersma Status assigned => new
2017-01-15 13:54 Bart Broersma Note Added: 0097488
2017-01-15 13:54 Bart Broersma Status new => confirmed
2017-01-15 14:08 Bart Broersma Note Added: 0097489
2017-01-15 14:11 Bart Broersma Note Edited: 0097489 View Revisions
2017-01-15 14:13 Bart Broersma Note Edited: 0097489 View Revisions
2017-01-15 14:31 Bart Broersma Note Added: 0097490
2017-01-15 14:33 Bart Broersma Summary TimeEdit: ActiveControl not applied => OI sometimes selects a control as ActiveControl if no ActiveControl is specified in LFM (TimeEdit: ActiveControl not applied)
2017-05-14 17:20 Juha Manninen Relationship added related to 0031811
2017-05-14 17:22 Juha Manninen Note Added: 0100304
2017-05-14 17:42 Ondrej Pokorny Assigned To => Ondrej Pokorny
2017-05-14 17:42 Ondrej Pokorny Status confirmed => assigned
2017-05-14 17:42 Ondrej Pokorny Note Added: 0100305
2017-05-14 17:59 Ondrej Pokorny Fixed in Revision => 54926, 54930
2017-05-14 17:59 Ondrej Pokorny Note Added: 0100306
2017-05-14 17:59 Ondrej Pokorny Status assigned => resolved
2017-05-14 17:59 Ondrej Pokorny Resolution open => fixed