IDE: added resourcestring

git-svn-id: trunk@10461 -
This commit is contained in:
mattias 2007-01-17 11:13:57 +00:00
parent b741e024ce
commit c8ab6fa0c5
2 changed files with 17 additions and 6 deletions

View File

@ -2093,6 +2093,9 @@ resourcestring
lisCodeTemplComment = 'Comment:'; lisCodeTemplComment = 'Comment:';
lisCodeTemplATokenAlreadyExists = ' A token %s%s%s already exists! '; lisCodeTemplATokenAlreadyExists = ' A token %s%s%s already exists! ';
lisCodeTemplError = 'Error'; lisCodeTemplError = 'Error';
lisUnableToOpenDesignerTheClassDoesNotDescendFromADes = 'Unable to open '
+'designer.%sThe class %s does not descend from a designable class like '
+'TForm or TDataModule.';
lisClassConflictsWithLfmFileTheUnitUsesTheTheUnitWhic = 'Class conflicts ' lisClassConflictsWithLfmFileTheUnitUsesTheTheUnitWhic = 'Class conflicts '
+'with .lfm file:%sThe unit %s%suses the the unit %s%swhich contains the ' +'with .lfm file:%sThe unit %s%suses the the unit %s%swhich contains the '
+'class %s,%sbut the .lfm file contains already another class.%sThere can ' +'class %s,%sbut the .lfm file contains already another class.%sThere can '

View File

@ -4911,6 +4911,14 @@ begin
NewClassName, '"', '"', AncestorClassName, '"']), NewClassName, '"', '"', AncestorClassName, '"']),
mtError,[mbCancel],0); mtError,[mbCancel],0);
Result:=mrCancel; Result:=mrCancel;
exit;
end else if CompareText(AncestorClassName,'TComponent')=0 then begin
MessageDlg(lisCodeTemplError, Format(
lisUnableToOpenDesignerTheClassDoesNotDescendFromADes, [#13,
NewClassName]),
mtError,[mbCancel],0);
Result:=mrCancel;
exit;
end; end;
end else begin end else begin
AncestorType:=TForm; AncestorType:=TForm;
@ -5318,7 +5326,7 @@ function TMainIDE.CloseUnitComponent(AnUnitInfo: TUnitInfo; Flags: TCloseFlags
begin begin
CompUnitInfo:=Project1.FirstUnitWithComponent; CompUnitInfo:=Project1.FirstUnitWithComponent;
while CompUnitInfo<>nil do begin while CompUnitInfo<>nil do begin
DebugLn(['FreeUnusedComponents ',CompUnitInfo.Filename,' ',dbgsName(CompUnitInfo.Component),' UnitComponentIsUsed=',UnitComponentIsUsed(CompUnitInfo,true)]); //DebugLn(['FreeUnusedComponents ',CompUnitInfo.Filename,' ',dbgsName(CompUnitInfo.Component),' UnitComponentIsUsed=',UnitComponentIsUsed(CompUnitInfo,true)]);
if not UnitComponentIsUsed(CompUnitInfo,true) then begin if not UnitComponentIsUsed(CompUnitInfo,true) then begin
CloseUnitComponent(CompUnitInfo,Flags); CloseUnitComponent(CompUnitInfo,Flags);
exit; exit;
@ -5334,7 +5342,7 @@ var
begin begin
LookupRoot:=AnUnitInfo.Component; LookupRoot:=AnUnitInfo.Component;
if LookupRoot=nil then exit(mrOk); if LookupRoot=nil then exit(mrOk);
DebugLn(['TMainIDE.CloseUnitComponent ',AnUnitInfo.Filename,' ',dbgsName(LookupRoot)]); //DebugLn(['TMainIDE.CloseUnitComponent ',AnUnitInfo.Filename,' ',dbgsName(LookupRoot)]);
// save // save
if (cfSaveFirst in Flags) and (AnUnitInfo.EditorIndex>=0) then begin if (cfSaveFirst in Flags) and (AnUnitInfo.EditorIndex>=0) then begin
@ -5356,7 +5364,7 @@ begin
FLastFormActivated:=nil; FLastFormActivated:=nil;
if (OldDesigner=nil) then begin if (OldDesigner=nil) then begin
// hidden component // hidden component
DebugLn(['TMainIDE.CloseUnitComponent freeing hidden component without designer: ',AnUnitInfo.Filename,' ',DbgSName(AnUnitInfo.Component)]); //DebugLn(['TMainIDE.CloseUnitComponent freeing hidden component without designer: ',AnUnitInfo.Filename,' ',DbgSName(AnUnitInfo.Component)]);
if UnitComponentIsUsed(AnUnitInfo,false) then begin if UnitComponentIsUsed(AnUnitInfo,false) then begin
// hidden component is still used => keep it // hidden component is still used => keep it
end else begin end else begin
@ -5369,11 +5377,11 @@ begin
// component with designer // component with designer
if UnitComponentIsUsed(AnUnitInfo,false) then begin if UnitComponentIsUsed(AnUnitInfo,false) then begin
// free designer, keep component hidden // free designer, keep component hidden
DebugLn(['TMainIDE.CloseUnitComponent hiding component and freeing designer: ',AnUnitInfo.Filename,' ',DbgSName(AnUnitInfo.Component)]); //DebugLn(['TMainIDE.CloseUnitComponent hiding component and freeing designer: ',AnUnitInfo.Filename,' ',DbgSName(AnUnitInfo.Component)]);
OldDesigner.FreeDesigner(false); OldDesigner.FreeDesigner(false);
end else begin end else begin
// free designer and design form // free designer and design form
DebugLn(['TMainIDE.CloseUnitComponent freeing component and designer: ',AnUnitInfo.Filename,' ',DbgSName(AnUnitInfo.Component)]); //DebugLn(['TMainIDE.CloseUnitComponent freeing component and designer: ',AnUnitInfo.Filename,' ',DbgSName(AnUnitInfo.Component)]);
OldDesigner.FreeDesigner(true); OldDesigner.FreeDesigner(true);
AnUnitInfo.Component:=nil; AnUnitInfo.Component:=nil;
FreeUnusedComponents; FreeUnusedComponents;
@ -12424,7 +12432,7 @@ begin
Result:=FormEditor1.GetDesignerForm(AnUnitInfo.Component); Result:=FormEditor1.GetDesignerForm(AnUnitInfo.Component);
if ((Result=nil) or (Result.Designer=nil)) and LoadForm if ((Result=nil) or (Result.Designer=nil)) and LoadForm
and FilenameIsPascalSource(AnUnitInfo.Filename) then begin and FilenameIsPascalSource(AnUnitInfo.Filename) then begin
DebugLn(['TMainIDE.GetFormOfSource ',AnUnitInfo.Filename,' ',dbgsName(AnUnitInfo.Component)]); //DebugLn(['TMainIDE.GetFormOfSource ',AnUnitInfo.Filename,' ',dbgsName(AnUnitInfo.Component)]);
DoLoadLFM(AnUnitInfo,[],[]); DoLoadLFM(AnUnitInfo,[],[]);
end; end;
if (Result=nil) and (AnUnitInfo.Component<>nil) then if (Result=nil) and (AnUnitInfo.Component<>nil) then