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',[ LazarusResources.Add('TCodeBrowserView','FORMDATA',[
'TPF0'#16'TCodeBrowserView'#15'CodeBrowserView'#4'Left'#3'c'#1#6'Height'#3'3' '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' +#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"/> <Filename Value="../lazarus"/>
</Target> </Target>
<SearchPaths> <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)"/> <UnitOutputDirectory Value="$(LazarusDir)/units/$(TargetCPU)-$(TargetOS)"/>
</SearchPaths> </SearchPaths>
<Parsing> <Parsing>
@ -415,6 +415,11 @@
</Parsing> </Parsing>
<Other> <Other>
<CompilerPath Value="$(CompPath)"/> <CompilerPath Value="$(CompPath)"/>
<ExecuteBefore>
<Command Value="$(make) idepkg"/>
<ScanForFPCMsgs Value="True"/>
<ScanForMakeMsgs Value="True"/>
</ExecuteBefore>
</Other> </Other>
<CompileReasons Compile="False" Build="False" Run="False"/> <CompileReasons Compile="False" Build="False" Run="False"/>
</CompilerOptions> </CompilerOptions>

View File

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

View File

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