Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi-BCB/VCLX/TForm    [ Add a report in this area ]  
Report #:  4499   Status: Reported
No OnActivate event by TForm.ShowModal
Project:  Delphi Build #:  4.453
Version:    7.0 Submitted By:   Martin Schreiber
Report Type:  Minor failure / Design problem Date Reported:  5/20/2003 5:39:01 AM
Severity:    Infrequently encountered problem Last Updated: 5/20/2003 5:40:08 AM
Platform:    All platforms Internal Tracking #:  
Resolution: None  Resolved in Build: : None
Duplicate of:  None
Voting and Rating
Overall Rating: No Ratings Yet
0.00 out of 5
Total Votes: None
Description
OnActivate is not fired by QForms.TCustomForm.ShowModal.

Problem:

function TCustomForm.ShowModal: Integer;
....
      Screen.FFocusedForm := Self; <-!!!

function TCustomForm.SetFocusedControl(Control: TWidgetControl): Boolean;
......
      if Screen.FFocusedForm <> Self then
      begin
  <-!!! code below is not executed!
.....
        Activate;
.....

Subsequent errors:
- ev. no SetWidgetFocus.
- Deactivate is not called.
- Property Active remains true.

Steps to Reproduce:
1. Run the attached Project1.
2. onactivatecount = 1, ondeactivatecount = 1, form2.active = false.
3. Click 'form2.showmodal'.
4. Exp: onactivatecount = 2
Act: onactivatecount = 1
5. Close form2.
6. Exp: ondeactivatecount = 2, form2.active = false
Act: ondeactivatecount = 1, form2.active = true
Workarounds
None
Attachment
4499.zip
Comments

None

Server Response from: ETNACODE01