From 8f51c4fa94a63f9762131b1e59cd3d847c8e9617 Mon Sep 17 00:00:00 2001 From: ying32 Date: Mon, 8 Oct 2018 22:09:07 +0800 Subject: [PATCH 1/2] Update README.md --- samples/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/README.md b/samples/README.md index 77f9d25d..3b2ff46f 100644 --- a/samples/README.md +++ b/samples/README.md @@ -1,7 +1,7 @@ ## 目录下的例程并非所有都支持跨平台,只有部分基础组件支持跨平台。 -| 项目名 | 说明 | 平台限制 | +| 项目名(Project) | 说明(Description) | 平台限制(Platform limit) | | :------ | :------ | ---- | | action | "动作"组件演示,演示action的公用使用 | | | basic | 基础窗口 | | From 4a432102395bc45d3bfaf4991af93e7503b6124d Mon Sep 17 00:00:00 2001 From: ying32 Date: Mon, 8 Oct 2018 22:10:46 +0800 Subject: [PATCH 2/2] Updated res2go source --- Tools/res2go/src/.gitignore | 2 + Tools/res2go/src/res2go.lps | 74 ++++++++++++------------- Tools/res2go/src/res2go.res | Bin 828 -> 828 bytes Tools/res2go/src/uresourceformtogo.pas | 41 +++++++++----- 4 files changed, 66 insertions(+), 51 deletions(-) create mode 100644 Tools/res2go/src/.gitignore diff --git a/Tools/res2go/src/.gitignore b/Tools/res2go/src/.gitignore new file mode 100644 index 00000000..cc4fb16a --- /dev/null +++ b/Tools/res2go/src/.gitignore @@ -0,0 +1,2 @@ +/backup +/lib diff --git a/Tools/res2go/src/res2go.lps b/Tools/res2go/src/res2go.lps index 3512481d..cd16ffc8 100644 --- a/Tools/res2go/src/res2go.lps +++ b/Tools/res2go/src/res2go.lps @@ -8,7 +8,6 @@ - @@ -26,8 +25,9 @@ - - + + + @@ -326,123 +326,123 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - + + + + - + - + - + - + - + - + - + - - + + - + - + - - + + diff --git a/Tools/res2go/src/res2go.res b/Tools/res2go/src/res2go.res index bab9c7e1d9dbab2883fd6df577ab7831072c2a17..faf342e4170778a36a634856be2648d4eddde568 100644 GIT binary patch delta 27 jcmdnPwuf!Q0>;T-7)>UJFcnN*z!)-FgGp!d5vB?NmXHc9 delta 27 jcmdnPwuf!Q0>;TMOd*pOFq%xB!K5?!3S+_KBTN+lkyr|C diff --git a/Tools/res2go/src/uresourceformtogo.pas b/Tools/res2go/src/uresourceformtogo.pas index 98c81eea..eb6944b0 100644 --- a/Tools/res2go/src/uresourceformtogo.pas +++ b/Tools/res2go/src/uresourceformtogo.pas @@ -228,7 +228,7 @@ function GetNeedTypesPkg(AItem: TEventItem): Boolean; Exit(True); end; -procedure CreateImplFileName(AFileName: string; AEvents: array of TEventItem; AFormName: string); +procedure CreateImplFile(AFileName: string; AEvents: array of TEventItem; AFormName: string); var LImplFileName, LMName, LTemp, LCode: string; LItem: TEventItem; @@ -248,10 +248,15 @@ procedure CreateImplFileName(AFileName: string; AEvents: array of TEventItem; AF // 不存在,则添加 if not LExists then begin - LListStr.Add('// 由res2go自动生成。'); - LListStr.Add('// 在这里写你的事件。'); - LListStr.Add('// Automatically generated by the res2go.'); - LListStr.Add('// Write your event here.'); + if SysIsZhCN then + begin + LListStr.Add('// 由res2go自动生成。'); + LListStr.Add('// 在这里写你的事件。'); + end else + begin + LListStr.Add('// Automatically generated by the res2go.'); + LListStr.Add('// Write your event here.'); + end; LListStr.Add(''); LListStr.Add('package main'); LListStr.Add(''); @@ -354,8 +359,10 @@ procedure SaveToGoFile(AComponents: TList; AEvents: array of TEventItem; const A LStrStream := TStringStream.Create(''{$IFNDEF FPC}, TEncoding.UTF8{$ENDIF}); LLines := TStringList.Create; try - WLine('// 由res2go自动生成,不要编辑。'); - WLine('// Automatically generated by the res2go, do not edit.'); + if SysIsZhCN then + WLine('// 由res2go自动生成,不要编辑。') + else + WLine('// Automatically generated by the res2go, do not edit.'); WLine('package main'); WLine; WLine('import ('); @@ -405,8 +412,10 @@ procedure SaveToGoFile(AComponents: TList; AEvents: array of TEventItem; const A // AMem = nil表示不以字节输出到go文件 if AMem = nil then begin - Wline('// 以文件形式加载'); - WLine('// Loaded as a file.'); + if SysIsZhCN then + Wline('// 以文件形式加载') + else + WLine('// Loaded as a file.'); WLine(Format('// vcl.Application.CreateForm("%s.gfm", &%s)', [LFormName, LFormName])); end else @@ -417,8 +426,10 @@ procedure SaveToGoFile(AComponents: TList; AEvents: array of TEventItem; const A {$ELSE} LVarName[1] := LowerCase(LVarName[1])[1]; {$ENDIF} - WLine('// 以字节形式加载'); - WLine('// Loaded in bytes.'); + if SysIsZhCN then + WLine('// 以字节形式加载') + else + WLine('// Loaded in bytes.'); WLine(Format('// vcl.Application.CreateForm(%s, &%s)', [LVarName, LFormName])); WLine; WLine('var ('); @@ -446,7 +457,7 @@ procedure SaveToGoFile(AComponents: TList; AEvents: array of TEventItem; const A LStrStream.Free; end; if Length(AEvents) > 0 then - CreateImplFileName(LFileName, AEvents, LFormName); + CreateImplFile(LFileName, AEvents, LFormName); end; @@ -637,8 +648,10 @@ procedure ProjectFileToMainDotGo(AFileName, AOutPath: string); try LStrs.LoadFromFile(AFileName); - LMainDotGo.Add('// 由res2go自动生成。'); - LMainDotGo.Add('// Automatically generated by the res2go.'); + if SysIsZhCN then + LMainDotGo.Add('// 由res2go自动生成。') + else + LMainDotGo.Add('// Automatically generated by the res2go.'); LMainDotGo.Add('package main'); LMainDotGo.Add(''); LMainDotGo.Add('import (');