mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-08 02:38:03 +02:00
Designer: Give names for the side components of PairSplitter. Don't crash when deleting. Issue #38227.
git-svn-id: trunk@64225 -
This commit is contained in:
parent
4c9264496d
commit
5cf724ae46
@ -747,7 +747,6 @@ begin
|
||||
FPersToChange := APersistent;
|
||||
FZOrderDelete := AZOrder;
|
||||
BuildComponentNodes(False);
|
||||
Assert(FPersToChange=nil, 'TComponentTreeView.ChangeCompZOrder: FPersToChange is assigned.');
|
||||
end;
|
||||
|
||||
procedure TComponentTreeView.DeleteComponentNode(APersistent: TPersistent);
|
||||
@ -755,7 +754,6 @@ begin
|
||||
FPersToChange := APersistent;
|
||||
FZOrderDelete := zoDelete;
|
||||
BuildComponentNodes(False);
|
||||
Assert(FPersToChange=nil, 'TComponentTreeView.DeleteComponentNode: FPersToChange is assigned.');
|
||||
end;
|
||||
|
||||
procedure TComponentTreeView.UpdateCompNode(ANode: TTreeNode);
|
||||
|
@ -37,8 +37,9 @@ interface
|
||||
{off $DEFINE VerboseDesignerSelect}
|
||||
|
||||
uses
|
||||
// RTL + FCL + LCL
|
||||
Types, Classes, Math, SysUtils, variants, TypInfo,
|
||||
// RTL + FCL
|
||||
Types, Classes, Math, SysUtils, Variants, TypInfo,
|
||||
// LCL
|
||||
LCLProc, LCLType, LResources, LCLIntf, LMessages, InterfaceBase,
|
||||
Forms, Controls, GraphType, Graphics, Dialogs, ExtCtrls, Menus, ClipBrd,
|
||||
// LazUtils
|
||||
@ -1631,10 +1632,21 @@ begin
|
||||
end;
|
||||
|
||||
procedure TDesigner.NotifyComponentAdded(AComponent: TComponent);
|
||||
var
|
||||
i: Integer;
|
||||
SubContrl: TControl;
|
||||
begin
|
||||
try
|
||||
if AComponent.Name='' then
|
||||
AComponent.Name:=UniqueName(AComponent.ClassName);
|
||||
// Iterating Controls is needed at least for Side1 and Side2 of TPairSplitter.
|
||||
if AComponent is TWinControl then
|
||||
for i:=0 to TWinControl(AComponent).ControlCount-1 do
|
||||
begin
|
||||
SubContrl:=TWinControl(AComponent).Controls[i];
|
||||
if SubContrl.Name='' then
|
||||
SubContrl.Name:=UniqueName(SubContrl.ClassName);
|
||||
end;
|
||||
GlobalDesignHook.PersistentAdded(AComponent,false);
|
||||
except
|
||||
on E: Exception do
|
||||
|
@ -1363,7 +1363,7 @@ begin
|
||||
AParent:=AParent.Parent;
|
||||
end;
|
||||
end;
|
||||
DebugLn('Parent is '''+dbgsName(AParent)+'''');
|
||||
//DebugLn('TCustomFormEditor.CreateComponent: Parent is '''+dbgsName(AParent)+'''');
|
||||
end else begin
|
||||
// create a toplevel component
|
||||
// -> a form or a datamodule or a custom component
|
||||
|
Loading…
Reference in New Issue
Block a user