JCF2: localized 'Error Display' dialog

git-svn-id: trunk@24606 -
This commit is contained in:
maxim 2010-04-12 23:45:40 +00:00
parent 8e5361c254
commit 4cbc62c949
2 changed files with 23 additions and 15 deletions

View File

@ -301,6 +301,15 @@ resourcestring
lisAboutFindMoreInformationOnTheWebAt = 'Find more information on the web '
+'at: %s';
//Error Display dialog
lisEDJCFParseError = 'JCF Parse error';
lisEDNear = '%s near %s';
lisEDAtLineCol = '%sAt line %s col %s';
lisEDIn = '%s in %s';
lisEDException = 'Exception %s';
lisEDType = 'Type: %s%s';
lisEDError = 'Error';
implementation
end.

View File

@ -58,7 +58,7 @@ implementation
uses
{ local }
ParseError, JcfStringUtils, JcfFontSetFunctions;
ParseError, JcfStringUtils, JcfFontSetFunctions, jcfuiconsts;
{$ifndef FPC}
{$R *.dfm}
@ -105,29 +105,28 @@ begin
begin
lcParseError := TEParseError(pE);
Caption := 'JCF Parse error';
mExceptionMessage.Text := lcParseError.Message + ' near ' +
lcParseError.TokenMessage;
Caption := lisEDJCFParseError;
mExceptionMessage.Text := Format(lisEDNear,[lcParseError.Message,
lcParseError.TokenMessage]);
if (lcParseError.XPosition > 0) or (lcParseError.YPosition > 0) then
begin
mExceptionMessage.Text := mExceptionMessage.Text + NativeLineBreak +
'At line ' + IntToStr(lcParseError.YPosition) + ' col ' +
IntToStr(lcParseError.XPosition);
mExceptionMessage.Text := Format(lisEDAtLineCol,[mExceptionMessage.Text +
NativeLineBreak,IntToStr(lcParseError.YPosition),IntToStr(lcParseError.
XPosition)]);
if lcParseError.FileName <> '' then
mExceptionMessage.Text :=
mExceptionMessage.Text + ' in ' + lcParseError.FileName;
Format(lisEDIn,[mExceptionMessage.Text,lcParseError.FileName]);
end;
end
else
begin
Caption := 'Exception ' + pE.ClassName;
mExceptionMessage.Text := 'Type: ' + pE.ClassName + NativeLineBreak;
mExceptionMessage.Text := mExceptionMessage.Text + pE.Message;
Caption := Format(lisEDException,[pE.ClassName]);
mExceptionMessage.Text := Format(lisEDType,[pE.ClassName + NativeLineBreak,
pE.Message]);
end;
ShowModal;
end;
@ -137,13 +136,13 @@ begin
if psCaption <> '' then
Caption := psCaption
else
Caption := 'Error';
Caption := lisEDError;
mExceptionMessage.Text := sMessage;
if (piY > 0) or (piX > 0) then
begin
mExceptionMessage.Text := mExceptionMessage.Text + NativeLineBreak +
' at line ' + IntToStr(piY) + ' col ' + IntToStr(piX);
mExceptionMessage.Text := Format(lisEDAtLineCol,[mExceptionMessage.Text +
NativeLineBreak,IntToStr(piY),IntToStr(piX)]);
end;
ShowModal;