Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi-BCB/VCLX/TWidgetControl    [ Add a report in this area ]  
Report #:  3713   Status: Reported
TWidgetControl.Focused is true in deactivated Forms
Project:  Delphi Build #:  4.453
Version:    7.0 Submitted By:   Martin Schreiber
Report Type:  Minor failure / Design problem Date Reported:  3/7/2003 2:17:14 AM
Severity:    Commonly encountered problem Last Updated: 5/2/2003 12:58:35 PM
Platform:    All platforms Internal Tracking #:  
Resolution: None  Resolved in Build: : None
Duplicate of:  None
Voting and Rating
Overall Rating: (1 Total Rating)
5.00 out of 5
Total Votes: None
Description
QControls.TWidgetControl.Focused returns true at ActiveControl of deactivated forms.

Problem:

function TWidgetControl.Focused: Boolean;
var
  ParentForm: TCustomForm;
begin
  ParentForm := GetParentForm(Self);
  if ParentForm <> nil then
    Result := ParentForm.FocusedControl = Self
        <- TCustomForm.FocusedControl is not nil'd by TCustomForm.Deactivate.
Steps to Reproduce:
1. Run the attached 'Project1'.
2. form1.edit1.focused = true, form2.edit1.focused = true.
3. Click Form2.Edit1.
4. form1.edit1.focused = true, form2.edit1.focused = true.
5. Close Form2.
6. form1.edit1.focused = true, form2.edit1.focused = true.

7. Run the attached 'vclProject1'.
8. form1.edit1.focused = true, form2.edit1.focused = false.
9. Click Form2.Edit1.
10. form1.edit1.focused = false, form2.edit1.focused = true.
11. Close Form2.
12. form1.edit1.focused = true, form2.edit1.focused = false.

Workarounds
None
Attachment
3713.zip
Comments

None

Server Response from: ETNACODE01