OI: check for name special Owner

git-svn-id: trunk@22464 -
This commit is contained in:
mattias 2009-11-07 09:20:20 +00:00
parent d8161a3a0e
commit ecfbc4c3a1
4 changed files with 20 additions and 6 deletions

View File

@ -1,5 +1,3 @@
{ This is an automatically generated lazarus resource file }
LazarusResources.Add('TCodeBrowserView','FORMDATA',[
'TPF0'#16'TCodeBrowserView'#15'CodeBrowserView'#4'Left'#3'c'#1#6'Height'#3'3'
+#2#3'Top'#3'A'#1#5'Width'#3'o'#2#13'ActiveControl'#7#13'ScopeComboBox'#7'Cap'

View File

@ -405,7 +405,7 @@
<Filename Value="../lazarus"/>
</Target>
<SearchPaths>
<OtherUnitFiles Value="frames/;../converter/;../debugger/;../debugger/frames/;../packager/frames/;../designer/"/>
<OtherUnitFiles Value="frames/;../converter/;../debugger/;../debugger/frames/;../packager/;../packager/frames/;../designer/"/>
<UnitOutputDirectory Value="$(LazarusDir)/units/$(TargetCPU)-$(TargetOS)"/>
</SearchPaths>
<Parsing>
@ -415,6 +415,11 @@
</Parsing>
<Other>
<CompilerPath Value="$(CompPath)"/>
<ExecuteBefore>
<Command Value="$(make) idepkg"/>
<ScanForFPCMsgs Value="True"/>
<ScanForMakeMsgs Value="True"/>
</ExecuteBefore>
</Other>
<CompileReasons Compile="False" Build="False" Run="False"/>
</CompilerOptions>

View File

@ -646,6 +646,8 @@ resourcestring
+'ResourceString section in this or any of the used units.';
lisComponentNameIsNotAValidIdentifier = 'Component name %s%s%s is not a '
+'valid identifier';
lisOwnerIsAlreadyUsedByTReaderTWriterPleaseChooseAnot = '''Owner'' is '
+'already used by TReader/TWriter. Please choose another name.';
lisDuplicateNameAComponentNamedAlreadyExistsInTheInhe = 'Duplicate name: A '
+'component named %s%s%s already exists in the inherited component %s';
lisComponentNameIsKeyword = 'Component name %s%s%s is keyword';
@ -664,6 +666,9 @@ resourcestring
lisSaveFileBeforeClosingForm =
'Save file %s%s%s%sbefore closing form %s%s%s?';
lisUnableToRenameFormInSource = 'Unable to rename form in source.';
lisTheComponentIsInheritedFromToRenameAnInheritedComp = 'The component %s '
+'is inherited from %s.%sTo rename an inherited component open the '
+'ancestor and rename it there.';
lisSorryNotImplementedYet = 'Sorry, not implemented yet';
lisUnableToFindMethodPleaseFixTheErrorShownInTheMessage = 'Unable to find '
+'method. Please fix the error shown in the message window.';

View File

@ -14154,6 +14154,13 @@ begin
exit;
end;
if SysUtils.CompareText(AComponent.Name,'Owner')=0 then begin
// 'Owner' is used by TReader/TWriter
raise EComponentError.Create(
lisOwnerIsAlreadyUsedByTReaderTWriterPleaseChooseAnot);
exit;
end;
BeginCodeTool(ADesigner,ActiveSrcEdit,ActiveUnitInfo,[ctfSwitchToFormSource]);
ActiveUnitInfo:=Project1.UnitWithComponent(ADesigner.LookupRoot);
@ -14174,9 +14181,8 @@ begin
// check ancestor component
AncestorRoot:=FormEditor1.GetAncestorLookupRoot(AComponent);
if AncestorRoot<>nil then begin
s:='The component '+dbgsName(AComponent)
+' is inherited from '+dbgsName(AncestorRoot)+'.'#13
+'To rename an inherited component open the ancestor and rename it there.';
s:=Format(lisTheComponentIsInheritedFromToRenameAnInheritedComp, [dbgsName
(AComponent), dbgsName(AncestorRoot), #13]);
raise EComponentError.Create(s);
end;