fixed setting activecontrol to nil when removing component

git-svn-id: trunk@3736 -
This commit is contained in:
mattias 2002-12-25 14:21:28 +00:00
parent fb8295d432
commit 056920e6eb
3 changed files with 30 additions and 23 deletions

View File

@ -2214,7 +2214,7 @@ end;
procedure TObjectInspector.SetSelections(
const NewSelections:TComponentSelectionList);
begin
//writeln('[TObjectInspector.SetSelections]');
//writeln('[TObjectInspector.SetSelections] ',NewSelections.Count);
if FComponentList.IsEqual(NewSelections) then exit;
FComponentList.Assign(NewSelections);
SetAvailComboBoxText;

View File

@ -57,7 +57,7 @@ end;
------------------------------------------------------------------------------}
procedure TButton.DoSendBtnDefault;
begin
if HandleAllocated then
if HandleAllocated and (not (csDesigning in ComponentState)) then
CNSendMessage(LM_BTNDEFAULT_CHANGED,Self,nil);
end;
@ -165,6 +165,9 @@ end;
{ =============================================================================
$Log$
Revision 1.12 2002/12/25 14:21:28 mattias
fixed setting activecontrol to nil when removing component
Revision 1.11 2002/12/25 11:53:47 mattias
Button.Default now sets focus

View File

@ -144,28 +144,29 @@ Procedure TCustomForm.Notification(AComponent : TComponent;
Begin
inherited Notification(AComponent,Operation);
case Operation of
opInsert:
opInsert:
begin
{if AComponent is TCustomActionList then
begin
{if AComponent is TCustomActionList then
begin
if FActionLists = nil then FActionLists := TList.Create;
FActionLists.Add(AComponent);
end
else }if not (csLoading in ComponentState) and (Menu = nil) and
(AComponent.Owner = Self) and (AComponent is TMainMenu) then
Menu := TMainMenu(AComponent);
end;
opRemove:
begin
{if (FActionLists <> nil) and (AComponent is TCustomActionList) then
FActionLists.Remove(AComponent)
else
begin}
if Menu = AComponent then Menu := nil;
//if WindowMenu = AComponent then WindowMenu := nil;
//if ObjectMenuItem = AComponent then ObjectMenuItem := nil;
//end;
end;
if FActionLists = nil then FActionLists := TList.Create;
FActionLists.Add(AComponent);
end
else }if not (csLoading in ComponentState) and (Menu = nil) and
(AComponent.Owner = Self) and (AComponent is TMainMenu) then
Menu := TMainMenu(AComponent);
end;
opRemove:
begin
{if (FActionLists <> nil) and (AComponent is TCustomActionList) then
FActionLists.Remove(AComponent)
else
begin}
if Menu = AComponent then Menu := nil;
//if WindowMenu = AComponent then WindowMenu := nil;
//if ObjectMenuItem = AComponent then ObjectMenuItem := nil;
//end;
if FActiveControl=AComponent then FActiveControl:=nil;
end;
end;
if FDesigner <> nil then FDesigner.Notification(AComponent,Operation);
End;
@ -1183,6 +1184,9 @@ end;
{ =============================================================================
$Log$
Revision 1.78 2002/12/25 14:21:28 mattias
fixed setting activecontrol to nil when removing component
Revision 1.77 2002/12/25 11:53:47 mattias
Button.Default now sets focus