mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-06 15:41:45 +02:00
IDE: improved custom form editor localization
git-svn-id: trunk@29596 -
This commit is contained in:
parent
f3e40328d8
commit
9a28be51c1
@ -40,7 +40,7 @@ uses
|
|||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
// LCL+FCL
|
// LCL+FCL
|
||||||
Classes, SysUtils, TypInfo, Math, LCLIntf, LCLType, LResources,
|
Classes, SysUtils, TypInfo, Math, LCLIntf, LCLType, LResources,
|
||||||
AVL_Tree, LCLMemManager,
|
AVL_Tree, LCLMemManager, FileUtil,
|
||||||
LCLProc, Graphics, Controls, Forms, Menus, Dialogs,
|
LCLProc, Graphics, Controls, Forms, Menus, Dialogs,
|
||||||
// IDEIntf
|
// IDEIntf
|
||||||
PropEdits, PropEditUtils, ObjectInspector, IDECommands, FormEditingIntf,
|
PropEdits, PropEditUtils, ObjectInspector, IDECommands, FormEditingIntf,
|
||||||
@ -349,10 +349,9 @@ Begin
|
|||||||
DebugLn('TryFreeComponent ERROR:',
|
DebugLn('TryFreeComponent ERROR:',
|
||||||
' "'+OldName+':'+OldClassName+'" ',E.Message);
|
' "'+OldName+':'+OldClassName+'" ',E.Message);
|
||||||
DumpExceptionBackTrace;
|
DumpExceptionBackTrace;
|
||||||
MessageDlg('Error',
|
MessageDlg(lisCCOErrorCaption,
|
||||||
'An exception occured during deletion of'#13
|
Format(lisCFEAnExceptionOccuredDuringDeletionOf, [#13, OldName,
|
||||||
+'"'+OldName+':'+OldClassName+'"'#13
|
OldClassName, #13, E.Message]),
|
||||||
+E.Message,
|
|
||||||
mtError,[mbOk],0);
|
mtError,[mbOk],0);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -475,7 +474,9 @@ Begin
|
|||||||
// free/unbind a non form component and its designer form
|
// free/unbind a non form component and its designer form
|
||||||
AForm:=GetDesignerForm(AComponent);
|
AForm:=GetDesignerForm(AComponent);
|
||||||
if (AForm<>nil) and (not (AForm is TCustomNonFormDesignerForm)) then
|
if (AForm<>nil) and (not (AForm is TCustomNonFormDesignerForm)) then
|
||||||
RaiseException('TCustomFormEditor.DeleteComponent Where is the TCustomNonFormDesignerForm? '+AComponent.ClassName);
|
RaiseException(Format(
|
||||||
|
lisCFETCustomFormEditorDeleteComponentWhereIsTheTCustomN, [AComponent.
|
||||||
|
ClassName]));
|
||||||
|
|
||||||
if (AForm <> nil) and (AForm is TCustomNonFormDesignerForm) then
|
if (AForm <> nil) and (AForm is TCustomNonFormDesignerForm) then
|
||||||
begin
|
begin
|
||||||
@ -559,9 +560,9 @@ begin
|
|||||||
Selection:=ASelection;
|
Selection:=ASelection;
|
||||||
except
|
except
|
||||||
on E: Exception do begin
|
on E: Exception do begin
|
||||||
MessageDlg('Error',
|
MessageDlg(lisCCOErrorCaption,
|
||||||
'Unable to clear the form editing selection'#13
|
Format(lisCFEUnableToClearTheFormEditingSelection, [#13, E.Message]),
|
||||||
+E.Message,mtError,[mbCancel],0);
|
mtError, [mbCancel], 0);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
ASelection.Free;
|
ASelection.Free;
|
||||||
@ -584,8 +585,8 @@ begin
|
|||||||
end;
|
end;
|
||||||
Result:=Selection.Count=0;
|
Result:=Selection.Count=0;
|
||||||
if Selection.Count>0 then begin
|
if Selection.Count>0 then begin
|
||||||
MessageDlg('Error',
|
MessageDlg(lisCCOErrorCaption,
|
||||||
'Do not know how to delete this form editing selection',
|
lisCFEDoNotKnowHowToDeleteThisFormEditingSelection,
|
||||||
mtError,[mbCancel],0);
|
mtError,[mbCancel],0);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -606,8 +607,8 @@ begin
|
|||||||
end;
|
end;
|
||||||
Result:=Selection.Count=0;
|
Result:=Selection.Count=0;
|
||||||
if Selection.Count>0 then begin
|
if Selection.Count>0 then begin
|
||||||
MessageDlg('Error',
|
MessageDlg(lisCCOErrorCaption,
|
||||||
'Do not know how to copy this form editing selection',
|
lisCFEDoNotKnowHowToCopyThisFormEditingSelection,
|
||||||
mtError,[mbCancel],0);
|
mtError,[mbCancel],0);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -628,8 +629,8 @@ begin
|
|||||||
end;
|
end;
|
||||||
Result:=Selection.Count=0;
|
Result:=Selection.Count=0;
|
||||||
if Selection.Count>0 then begin
|
if Selection.Count>0 then begin
|
||||||
MessageDlg('Error',
|
MessageDlg(lisCCOErrorCaption,
|
||||||
'Do not know how to cut this form editing selection',
|
lisCFEDoNotKnowHowToCutThisFormEditingSelection,
|
||||||
mtError,[mbCancel],0);
|
mtError,[mbCancel],0);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -728,7 +729,7 @@ var
|
|||||||
MediatorClass: TDesignerMediatorClass;
|
MediatorClass: TDesignerMediatorClass;
|
||||||
begin
|
begin
|
||||||
if FindNonFormFormNode(LookupRoot) <> nil then
|
if FindNonFormFormNode(LookupRoot) <> nil then
|
||||||
RaiseException('TCustomFormEditor.CreateNonFormForm already exists');
|
RaiseException(lisCFETCustomFormEditorCreateNonFormFormAlreadyExists);
|
||||||
if LookupRoot is TComponent then
|
if LookupRoot is TComponent then
|
||||||
begin
|
begin
|
||||||
if LookupRoot is TCustomFrame then
|
if LookupRoot is TCustomFrame then
|
||||||
@ -746,8 +747,8 @@ begin
|
|||||||
TNonControlDesignerForm(Result).Mediator:=MediatorClass.CreateMediator(nil,LookupRoot);
|
TNonControlDesignerForm(Result).Mediator:=MediatorClass.CreateMediator(nil,LookupRoot);
|
||||||
end;
|
end;
|
||||||
end else
|
end else
|
||||||
RaiseException('TCustomFormEditor.CreateNonFormForm Unknown type '
|
RaiseException(Format(lisCFETCustomFormEditorCreateNonFormFormUnknownType, [
|
||||||
+LookupRoot.ClassName);
|
LookupRoot.ClassName]));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomFormEditor.RenameJITComponent(AComponent: TComponent;
|
procedure TCustomFormEditor.RenameJITComponent(AComponent: TComponent;
|
||||||
@ -1037,7 +1038,9 @@ procedure TCustomFormEditor.RegisterDesignerMediator(
|
|||||||
MediatorClass: TDesignerMediatorClass);
|
MediatorClass: TDesignerMediatorClass);
|
||||||
begin
|
begin
|
||||||
if FDesignerMediatorClasses.IndexOf(MediatorClass)>=0 then
|
if FDesignerMediatorClasses.IndexOf(MediatorClass)>=0 then
|
||||||
raise Exception.Create('TCustomFormEditor.RegisterDesignerMediator already registered: '+DbgSName(MediatorClass));
|
raise Exception.Create(Format(
|
||||||
|
lisCFETCustomFormEditorRegisterDesignerMediatorAlreadyRe, [DbgSName(
|
||||||
|
MediatorClass)]));
|
||||||
FDesignerMediatorClasses.Add(MediatorClass);
|
FDesignerMediatorClasses.Add(MediatorClass);
|
||||||
RegisterDesignerBaseClass(MediatorClass.FormClass);
|
RegisterDesignerBaseClass(MediatorClass.FormClass);
|
||||||
end;
|
end;
|
||||||
@ -1150,18 +1153,18 @@ begin
|
|||||||
except
|
except
|
||||||
on e: Exception do begin
|
on e: Exception do begin
|
||||||
DumpExceptionBackTrace;
|
DumpExceptionBackTrace;
|
||||||
MessageDlg('Error creating component',
|
MessageDlg(lisCFEErrorCreatingComponent,
|
||||||
'Error creating component: '+TypeClass.ClassName+#13+E.Message,
|
Format(lisCFEErrorCreatingComponent2, [TypeClass.ClassName, #13, E.
|
||||||
|
Message]),
|
||||||
mtError,[mbCancel],0);
|
mtError,[mbCancel],0);
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
// check if Owner was properly set
|
// check if Owner was properly set
|
||||||
if NewComponent.Owner <> OwnerComponent then begin
|
if NewComponent.Owner <> OwnerComponent then begin
|
||||||
MessageDlg('Invalid component owner',
|
MessageDlg(lisCFEInvalidComponentOwner,
|
||||||
'The component of type '+NewComponent.ClassName
|
Format(lisCFETheComponentOfTypeFailedToSetItsOwnerTo, [NewComponent.
|
||||||
+' failed to set its owner to '
|
ClassName, OwnerComponent.Name, OwnerComponent.ClassName]),
|
||||||
+OwnerComponent.Name+':'+OwnerComponent.ClassName,
|
|
||||||
mtError,[mbCancel],0);
|
mtError,[mbCancel],0);
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
@ -1335,12 +1338,11 @@ begin
|
|||||||
FreeAndNil(Mediator);
|
FreeAndNil(Mediator);
|
||||||
except
|
except
|
||||||
on E: Exception do begin
|
on E: Exception do begin
|
||||||
s:='Error destroying mediator '+Mediator.ClassName
|
s:=Format(lisCFEErrorDestroyingMediatorOfUnit, [Mediator.ClassName,
|
||||||
+' of unit '+AUnitName+':'#13
|
AUnitName, #13, E.Message]);
|
||||||
+E.Message;
|
DebugLn(['TCustomFormEditor.CreateComponent ',UTF8ToConsole(s)]);
|
||||||
DebugLn(['TCustomFormEditor.CreateComponent ',s]);
|
|
||||||
DumpExceptionBackTrace;
|
DumpExceptionBackTrace;
|
||||||
MessageDlg('Error destroying mediator',s,mtError,[mbCancel],0);
|
MessageDlg(lisCFEErrorDestroyingMediator, s, mtError, [mbCancel], 0);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -1351,12 +1353,12 @@ begin
|
|||||||
NewComponent:=nil;
|
NewComponent:=nil;
|
||||||
except
|
except
|
||||||
on E: Exception do begin
|
on E: Exception do begin
|
||||||
s:='Error destroying component of type '+TypeClass.ClassName
|
s:=Format(lisCFEErrorDestroyingComponentOfTypeOfUnit, [TypeClass.
|
||||||
+' of unit '+AUnitName+':'#13
|
ClassName, AUnitName, #13, E.Message]);
|
||||||
+E.Message;
|
DebugLn(['TCustomFormEditor.CreateComponent ',UTF8ToConsole(s)]);
|
||||||
DebugLn(['TCustomFormEditor.CreateComponent ',s]);
|
|
||||||
DumpExceptionBackTrace;
|
DumpExceptionBackTrace;
|
||||||
MessageDlg('Error destroying component',s,mtError,[mbCancel],0);
|
MessageDlg(lisCFEErrorDestroyingComponent, s, mtError, [mbCancel], 0
|
||||||
|
);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -1822,28 +1824,30 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
if LFMFilename<>'' then
|
if LFMFilename<>'' then
|
||||||
aCaption:='Error reading '+ExtractFilename(LFMFilename);
|
aCaption:=Format(lisCFEErrorReading, [ExtractFilename(LFMFilename)]);
|
||||||
|
|
||||||
with JITComponentList do begin
|
with JITComponentList do begin
|
||||||
if LFMFilename<>'' then
|
if LFMFilename<>'' then
|
||||||
aMsg:=aMsg+LFMFilename
|
aMsg:=aMsg+LFMFilename
|
||||||
else if CurReadStreamClass<>nil then
|
else if CurReadStreamClass<>nil then
|
||||||
aMsg:=aMsg+'Stream='+CurReadStreamClass.ClassName
|
aMsg:=Format(lisCFEStream, [aMsg, CurReadStreamClass.ClassName])
|
||||||
else
|
else
|
||||||
aMsg:=aMsg+'JITList='+ClassName;
|
aMsg:=aMsg+'JITList='+ClassName;
|
||||||
aMsg:=aMsg+': ';
|
aMsg:=aMsg+': ';
|
||||||
if CurReadJITComponent<>nil then
|
if CurReadJITComponent<>nil then
|
||||||
aMsg:=aMsg+'Root='+CurReadJITComponent.Name+':'+CurReadJITComponent.ClassName;
|
aMsg:=Format(lisCFERoot, [aMsg, CurReadJITComponent.Name,
|
||||||
|
CurReadJITComponent.ClassName]);
|
||||||
if CurReadChild<>nil then
|
if CurReadChild<>nil then
|
||||||
aMsg:=aMsg+#13'Component: '
|
aMsg:=Format(lisCFEComponent, [aMsg, #13, CurReadChild.Name, CurReadChild.
|
||||||
+CurReadChild.Name+':'+CurReadChild.ClassName
|
ClassName])
|
||||||
else if CurReadChildClass<>nil then
|
else if CurReadChildClass<>nil then
|
||||||
aMsg:=aMsg+#13'Component Class: '+CurReadChildClass.ClassName;
|
aMsg:=Format(lisCFEComponentClass, [aMsg, #13, CurReadChildClass.ClassName
|
||||||
|
]);
|
||||||
aMsg:=aMsg+#13+CurReadErrorMsg;
|
aMsg:=aMsg+#13+CurReadErrorMsg;
|
||||||
end;
|
end;
|
||||||
if (Reader<>nil) and (Reader.Driver is TLRSObjectReader) then begin
|
if (Reader<>nil) and (Reader.Driver is TLRSObjectReader) then begin
|
||||||
ErrorBinPos:=TLRSObjectReader(Reader.Driver).Stream.Position;
|
ErrorBinPos:=TLRSObjectReader(Reader.Driver).Stream.Position;
|
||||||
aMsg:=aMsg+#13+'Stream position: '+dbgs(ErrorBinPos);
|
aMsg:=Format(lisCFEStreamPosition, [aMsg, #13, dbgs(ErrorBinPos)]);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
case ErrorType of
|
case ErrorType of
|
||||||
@ -1853,18 +1857,19 @@ begin
|
|||||||
end;
|
end;
|
||||||
jfeUnknownComponentClass:
|
jfeUnknownComponentClass:
|
||||||
begin
|
begin
|
||||||
aMsg:=aMsg+#13+'Class "'+JITComponentList.CurUnknownClass+'" not found.';
|
aMsg:=Format(lisCFEClassNotFound, [aMsg, #13, JITComponentList.
|
||||||
|
CurUnknownClass]);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
if Buttons=[mbIgnore,mbCancel] then begin
|
if Buttons=[mbIgnore,mbCancel] then begin
|
||||||
Action:=QuestionDlg(aCaption,aMsg,DlgType,
|
Action:=QuestionDlg(aCaption,aMsg,DlgType,
|
||||||
[mrIgnore,'Continue loading',
|
[mrIgnore, lisCFEContinueLoading,
|
||||||
mrCancel,'Cancel loading this resource',
|
mrCancel, lisCFECancelLoadingThisResource,
|
||||||
mrAbort,'Stop all loading'],HelpCtx);
|
mrAbort, lisCFEStopAllLoading], HelpCtx);
|
||||||
end else begin
|
end else begin
|
||||||
Action:=QuestionDlg(aCaption,aMsg,DlgType,
|
Action:=QuestionDlg(aCaption,aMsg,DlgType,
|
||||||
[mrCancel,'Cancel loading this resource',
|
[mrCancel, lisCFECancelLoadingThisResource,
|
||||||
mrAbort,'Stop all loading'],HelpCtx);
|
mrAbort, lisCFEStopAllLoading], HelpCtx);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1903,12 +1908,12 @@ begin
|
|||||||
LFMFilename:=ChangeFileExt(TUnitInfo(List.ContextObject).Filename,'.lfm');
|
LFMFilename:=ChangeFileExt(TUnitInfo(List.ContextObject).Filename,'.lfm');
|
||||||
end;
|
end;
|
||||||
if LFMFilename<>'' then
|
if LFMFilename<>'' then
|
||||||
Msg:=Msg+'In file '+LFMFilename+#13;
|
Msg:=Format(lisCFEInFile, [Msg, LFMFilename, #13]);
|
||||||
|
|
||||||
if List.CurReadErrorMsg<>'' then
|
if List.CurReadErrorMsg<>'' then
|
||||||
Msg:=Msg+List.CurReadErrorMsg+#13;
|
Msg:=Msg+List.CurReadErrorMsg+#13;
|
||||||
if E is EReadError then;
|
if E is EReadError then;
|
||||||
MessageDlg('Read error',Msg,mtError,[mbCancel],0);
|
MessageDlg(lisCodeToolsDefsReadError, Msg, mtError, [mbCancel], 0);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomFormEditor.OnDesignerMenuItemClick(Sender: TObject);
|
procedure TCustomFormEditor.OnDesignerMenuItemClick(Sender: TObject);
|
||||||
@ -1927,10 +1932,9 @@ begin
|
|||||||
except
|
except
|
||||||
on E: Exception do begin
|
on E: Exception do begin
|
||||||
DebugLn('TCustomFormEditor.OnDesignerMenuItemClick ERROR: ',E.Message);
|
DebugLn('TCustomFormEditor.OnDesignerMenuItemClick ERROR: ',E.Message);
|
||||||
MessageDlg('Error in '+CompEditor.ClassName,
|
MessageDlg(Format(lisErrorIn, [CompEditor.ClassName]),
|
||||||
'The component editor of class "'+CompEditor.ClassName+'"'
|
Format(lisCFETheComponentEditorOfClassHasCreatedTheError, [CompEditor.
|
||||||
+'has created the error:'#13
|
ClassName, #13, E.Message]),
|
||||||
+'"'+E.Message+'"',
|
|
||||||
mtError,[mbOk],0);
|
mtError,[mbOk],0);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
@ -5180,6 +5180,50 @@ resourcestring
|
|||||||
lisInsteadOfCompilePackageCreateASimpleMakefile = 'Instead of compile '
|
lisInsteadOfCompilePackageCreateASimpleMakefile = 'Instead of compile '
|
||||||
+'package create a simple Makefile.';
|
+'package create a simple Makefile.';
|
||||||
|
|
||||||
|
// Custom form editor
|
||||||
|
lisCFEAnExceptionOccuredDuringDeletionOf = 'An exception occured during '
|
||||||
|
+'deletion of%s"%s:%s"%s%s';
|
||||||
|
lisCFETCustomFormEditorDeleteComponentWhereIsTheTCustomN = 'TCustomFormEditor'
|
||||||
|
+'.DeleteComponent Where is the TCustomNonFormDesignerForm? %s';
|
||||||
|
lisCFEUnableToClearTheFormEditingSelection = 'Unable to clear the form '
|
||||||
|
+'editing selection%s%s';
|
||||||
|
lisCFEDoNotKnowHowToDeleteThisFormEditingSelection = 'Do not know how to '
|
||||||
|
+'delete this form editing selection';
|
||||||
|
lisCFEDoNotKnowHowToCopyThisFormEditingSelection = 'Do not know how to copy '
|
||||||
|
+'this form editing selection';
|
||||||
|
lisCFEDoNotKnowHowToCutThisFormEditingSelection = 'Do not know how to cut '
|
||||||
|
+'this form editing selection';
|
||||||
|
lisCFETCustomFormEditorCreateNonFormFormUnknownType = 'TCustomFormEditor.'
|
||||||
|
+'CreateNonFormForm Unknown type %s';
|
||||||
|
lisCFETCustomFormEditorCreateNonFormFormAlreadyExists = 'TCustomFormEditor.'
|
||||||
|
+'CreateNonFormForm already exists';
|
||||||
|
lisCFETCustomFormEditorRegisterDesignerMediatorAlreadyRe = 'TCustomFormEditor'
|
||||||
|
+'.RegisterDesignerMediator already registered: %s';
|
||||||
|
lisCFEErrorCreatingComponent = 'Error creating component';
|
||||||
|
lisCFEErrorCreatingComponent2 = 'Error creating component: %s%s%s';
|
||||||
|
lisCFEInvalidComponentOwner = 'Invalid component owner';
|
||||||
|
lisCFETheComponentOfTypeFailedToSetItsOwnerTo = 'The component of type %s '
|
||||||
|
+'failed to set its owner to %s:%s';
|
||||||
|
lisCFEErrorDestroyingMediatorOfUnit = 'Error destroying mediator %s of '
|
||||||
|
+'unit %s:%s%s';
|
||||||
|
lisCFEErrorDestroyingMediator = 'Error destroying mediator';
|
||||||
|
lisCFEErrorDestroyingComponentOfTypeOfUnit = 'Error destroying component of '
|
||||||
|
+'type %s of unit %s:%s%s';
|
||||||
|
lisCFEErrorDestroyingComponent = 'Error destroying component';
|
||||||
|
lisCFEContinueLoading = 'Continue loading';
|
||||||
|
lisCFECancelLoadingThisResource = 'Cancel loading this resource';
|
||||||
|
lisCFEStopAllLoading = 'Stop all loading';
|
||||||
|
lisCFEErrorReading = 'Error reading %s';
|
||||||
|
lisCFEComponent = '%s%sComponent: %s:%s';
|
||||||
|
lisCFEComponentClass = '%s%sComponent Class: %s';
|
||||||
|
lisCFEStreamPosition = '%s%sStream position: %s';
|
||||||
|
lisCFEStream = '%sStream=%s';
|
||||||
|
lisCFERoot = '%sRoot=%s:%s';
|
||||||
|
lisCFEClassNotFound = '%s%sClass "%s" not found.';
|
||||||
|
lisCFEInFile = '%sIn file %s%s';
|
||||||
|
lisCFETheComponentEditorOfClassHasCreatedTheError = 'The component editor '
|
||||||
|
+'of class "%s"has created the error:%s"%s"';
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
Loading…
Reference in New Issue
Block a user