Changeset 271
- Timestamp:
- Jun 30, 2020, 5:02:02 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/highdpi/Packages/DpiControls/UDpiControls.pas
r270 r271 786 786 // TScreen 787 787 FDpi: Integer; 788 FActiveFormPrev: TDpiForm;789 788 FActiveForm: TDpiForm; 790 789 FPrevActiveForms: TDpiForms; … … 3001 3000 begin 3002 3001 FForms.Remove(AForm); 3002 FPrevActiveForms.Remove(AForm); 3003 3003 if AForm = FActiveForm then begin 3004 FActiveFormPrev := FActiveForm;3005 3004 FActiveForm := nil; 3006 3005 end; … … 3738 3737 procedure TDpiForm.ActivateHandler(Sender: TObject); 3739 3738 begin 3740 DpiScreen.FActiveFormPrev := DpiScreen.FActiveForm; 3739 if Assigned(DpiScreen.FActiveForm) then begin 3740 if DpiScreen.FPrevActiveForms.IndexOf(DpiScreen.FActiveForm) <> - 1 then 3741 DpiScreen.FPrevActiveForms.Remove(DpiScreen.FActiveForm); 3742 DpiScreen.FPrevActiveForms.Add(DpiScreen.FActiveForm); 3743 end; 3741 3744 DpiScreen.FActiveForm := Self; 3742 3745 if Assigned(FOnActivate) then FOnActivate(Sender); … … 3745 3748 procedure TDpiForm.DeactivateHandler(Sender: TObject); 3746 3749 begin 3747 DpiScreen.FActiveForm := DpiScreen.FActiveFormPrev; 3750 if DpiScreen.FPrevActiveForms.Count > 0 then begin 3751 DpiScreen.FActiveForm := DpiScreen.FPrevActiveForms.Last; 3752 DpiScreen.FPrevActiveForms.Delete(DpiScreen.FPrevActiveForms.Count - 1); 3753 end else DpiScreen.FActiveForm := nil; 3748 3754 //DpiScreen.UpdateActiveFormFromNativeScreen; 3749 3755 if Assigned(FOnDeactivate) then FOnDeactivate(Sender); … … 3827 3833 IsMainForm: Boolean; 3828 3834 begin 3829 if fsModal in FormStatethen3835 if (fsModal in FormState) and (ModalResult = 0) then 3830 3836 ModalResult := mrCancel 3831 3837 else
Note:
See TracChangeset
for help on using the changeset viewer.