mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-14 15:19:40 +02:00
IDE: do not allow putting the frame itself or on of its ancestors onto the frame
git-svn-id: trunk@15562 -
This commit is contained in:
parent
f3ae482691
commit
dc35d7411d
@ -40,12 +40,15 @@ interface
|
||||
{$ENDIF}
|
||||
|
||||
uses
|
||||
// FCL + LCL
|
||||
Classes, SysUtils, Math, LCLProc, LCLType, LResources, LCLIntf, LMessages,
|
||||
Forms, Controls, GraphType, Graphics, Dialogs, ExtCtrls, Menus, ClipBrd,
|
||||
PropEdits, ComponentEditors, MenuIntf, IDEImagesIntf,
|
||||
// IDEIntf
|
||||
IDEDialogs, PropEdits, ComponentEditors, MenuIntf, IDEImagesIntf,
|
||||
// IDE
|
||||
LazarusIDEStrConsts, EnvironmentOpts, IDECommands, ComponentReg,
|
||||
NonControlDesigner, FrameDesigner, AlignCompsDlg, SizeCompsDlg, ScaleCompsDlg, TabOrderDlg,
|
||||
DesignerProcs, CustomFormEditor,
|
||||
NonControlDesigner, FrameDesigner, AlignCompsDlg, SizeCompsDlg, ScaleCompsDlg,
|
||||
TabOrderDlg, DesignerProcs, CustomFormEditor,
|
||||
ControlSelection, ChangeClassDialog, EditorOptions;
|
||||
|
||||
type
|
||||
@ -1489,6 +1492,13 @@ var
|
||||
NewComponentClass:=SelectedCompClass.GetCreationClass;
|
||||
//DebugLn(['AddComponent ',dbgsName(NewComponentClass)]);
|
||||
if NewComponentClass=nil then exit;
|
||||
if LookupRoot.InheritsFrom(NewComponentClass) then begin
|
||||
IDEMessageDialog(lisInvalidCircle,
|
||||
Format(lisIsAThisCircleDependencyIsNotAllowed, [dbgsName(LookupRoot),
|
||||
dbgsName(NewComponentClass), #13]),
|
||||
mtError,[mbCancel],'');
|
||||
exit;
|
||||
end;
|
||||
|
||||
// create component and component interface
|
||||
NewCI := TComponentInterface(TheFormEditor.CreateComponent(
|
||||
|
@ -3793,6 +3793,9 @@ resourcestring
|
||||
lisPWNewProject = 'New Project';
|
||||
lisPWOpenProject = 'Open Project';
|
||||
lisPWConvertProject = 'Convert Delphi Project';
|
||||
lisInvalidCircle = 'Invalid circle';
|
||||
lisIsAThisCircleDependencyIsNotAllowed = '%s is a %s.%sThis circle '
|
||||
+'dependency is not allowed.';
|
||||
|
||||
implementation
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user