test for destroying controls, so they do not get focus

git-svn-id: trunk@5353 -
This commit is contained in:
mattias 2004-03-30 19:08:29 +00:00
parent 82ad9e0e7d
commit 3b4effd0ac
2 changed files with 9 additions and 1 deletions

View File

@ -1271,9 +1271,11 @@ end;
{------------------------------------------------------------------------------
TCustomForm Method SetFocusedControl
------------------------------------------------------------------------------}
function TCustomForm.SetFocusedControl(Control : TWinControl): Boolean;
function TCustomForm.SetFocusedControl(Control: TWinControl): Boolean;
begin
Result := False;
if (csDestroying in Control.ComponentState) then exit;
// update FActiveControl
if FDesigner = nil then
@ -1599,6 +1601,9 @@ end;
{ =============================================================================
$Log$
Revision 1.132 2004/03/30 19:08:29 mattias
test for destroying controls, so they do not get focus
Revision 1.131 2004/03/08 22:36:01 mattias
added TWinControl.ParentFormInitializeWnd

View File

@ -89,6 +89,9 @@ end;
procedure TScreen.MoveFormToFocusFront(ACustomForm: TCustomForm);
begin
if (Self=nil) or (ACustomForm=nil)
or (csDestroying in ACustomForm.ComponentState) then
RaiseGDBException('TScreen.MoveFormToFocusFront');
FCustomForms.Remove(ACustomForm);
FCustomForms.Insert(0, ACustomForm);
if ACustomForm is TForm then