MG: fixed designer component deletion

git-svn-id: trunk@1962 -
This commit is contained in:
lazarus 2002-08-17 23:40:25 +00:00
parent c1da001b0f
commit 48cf639fb8

View File

@ -264,6 +264,8 @@ Begin
{$IFDEF VerboseDesigner} {$IFDEF VerboseDesigner}
Writeln('[TDesigner.RemoveControl] C ',AComponent.Name,':',AComponent.ClassName); Writeln('[TDesigner.RemoveControl] C ',AComponent.Name,':',AComponent.ClassName);
{$ENDIF} {$ENDIF}
if not (AComponent is TControl) then
Form.Invalidate;
FFormEditor.DeleteControl(AComponent); FFormEditor.DeleteControl(AComponent);
end; end;
@ -505,7 +507,7 @@ Begin
MouseDownSender:=nil; MouseDownSender:=nil;
exit; exit;
end; end;
ControlSelection.ActiveGrabber:=nil; ControlSelection.ActiveGrabber:=nil;
RubberBandWasActive:=ControlSelection.RubberBandActive; RubberBandWasActive:=ControlSelection.RubberBandActive;
@ -544,17 +546,17 @@ Begin
and (ControlSelection[0].Component is TCustomForm)) then and (ControlSelection[0].Component is TCustomForm)) then
ControlSelection.Clear; ControlSelection.Clear;
ControlSelection.SelectWithRubberBand( ControlSelection.SelectWithRubberBand(
SenderParentForm,ssShift in Shift); Form,ssShift in Shift);
if ControlSelection.Count=0 then if ControlSelection.Count=0 then
ControlSelection.Add(SenderParentForm); ControlSelection.Add(Form);
ControlSelection.RubberbandActive:=false; ControlSelection.RubberbandActive:=false;
end else begin end else begin
if (not (ssShift in Shift)) then begin if (not (ssShift in Shift)) then begin
ControlSelection.Clear; ControlSelection.Clear;
ControlSelection.Add(Sender); ControlSelection.Add(MouseDownComponent);
end; end;
end; end;
SenderParentForm.Invalidate; Form.Invalidate;
end; end;
ControlSelection.EndUpdate; ControlSelection.EndUpdate;
end else begin end else begin
@ -563,7 +565,7 @@ Begin
ControlSelection.BeginUpdate; ControlSelection.BeginUpdate;
// find a parent for the new component // find a parent for the new component
NewParent:=TWinControl(Sender); NewParent:=TWinControl(MouseDownComponent);
while (NewParent<>nil) while (NewParent<>nil)
and ((not (csAcceptsControls in NewParent.ControlStyle)) and ((not (csAcceptsControls in NewParent.ControlStyle))
or ((NewParent.Owner<>Form) and (NewParent<>Form))) or ((NewParent.Owner<>Form) and (NewParent<>Form)))