Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
ying32 committed Oct 8, 2018
2 parents 7c963cf + 4a43210 commit 8e024b5
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 52 deletions.
2 changes: 2 additions & 0 deletions Tools/res2go/src/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/backup
/lib
74 changes: 37 additions & 37 deletions Tools/res2go/src/res2go.lps
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
<Unit0>
<Filename Value="res2go.lpr"/>
<IsPartOfProject Value="True"/>
<IsVisibleTab Value="True"/>
<EditorIndex Value="3"/>
<CursorPos X="6" Y="16"/>
<UsageCount Value="35"/>
Expand All @@ -26,8 +25,9 @@
<Filename Value="uresourceformtogo.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="uResourceFormToGo"/>
<TopLine Value="91"/>
<CursorPos X="15" Y="118"/>
<IsVisibleTab Value="True"/>
<TopLine Value="431"/>
<CursorPos X="19" Y="449"/>
<UsageCount Value="42"/>
<Loaded Value="True"/>
</Unit2>
Expand Down Expand Up @@ -326,123 +326,123 @@
<JumpHistory Count="30" HistoryIndex="29">
<Position1>
<Filename Value="uresourceformtogo.pas"/>
<Caret Line="331" Column="31" TopLine="317"/>
<Caret Line="124" Column="20" TopLine="106"/>
</Position1>
<Position2>
<Filename Value="uresourceformtogo.pas"/>
<Caret Line="124" Column="20" TopLine="106"/>
<Caret Line="139" Column="45" TopLine="97"/>
</Position2>
<Position3>
<Filename Value="uresourceformtogo.pas"/>
<Caret Line="139" Column="45" TopLine="97"/>
<Caret Line="131" Column="56" TopLine="97"/>
</Position3>
<Position4>
<Filename Value="uresourceformtogo.pas"/>
<Caret Line="131" Column="56" TopLine="97"/>
<Caret Line="130" Column="8" TopLine="109"/>
</Position4>
<Position5>
<Filename Value="uresourceformtogo.pas"/>
<Caret Line="130" Column="8" TopLine="109"/>
<Caret Line="348" Column="24" TopLine="330"/>
</Position5>
<Position6>
<Filename Value="uresourceformtogo.pas"/>
<Caret Line="348" Column="24" TopLine="330"/>
<Caret Line="132" Column="10" TopLine="112"/>
</Position6>
<Position7>
<Filename Value="uresourceformtogo.pas"/>
<Caret Line="132" Column="10" TopLine="112"/>
<Caret Line="347" Column="31" TopLine="337"/>
</Position7>
<Position8>
<Filename Value="uresourceformtogo.pas"/>
<Caret Line="347" Column="31" TopLine="337"/>
<Caret Line="345" Column="29" TopLine="324"/>
</Position8>
<Position9>
<Filename Value="uresourceformtogo.pas"/>
<Caret Line="345" Column="29" TopLine="324"/>
<Caret Line="358" Column="19" TopLine="344"/>
</Position9>
<Position10>
<Filename Value="uresourceformtogo.pas"/>
<Caret Line="358" Column="19" TopLine="344"/>
<Caret Line="359" Column="22" TopLine="314"/>
</Position10>
<Position11>
<Filename Value="uresourceformtogo.pas"/>
<Caret Line="359" Column="22" TopLine="314"/>
<Caret Line="9" Column="16"/>
</Position11>
<Position12>
<Filename Value="uresourceformtogo.pas"/>
<Caret Line="9" Column="16"/>
<Caret Line="671" Column="14" TopLine="659"/>
</Position12>
<Position13>
<Filename Value="uresourceformtogo.pas"/>
<Caret Line="671" Column="14" TopLine="659"/>
<Caret Line="10" Column="12"/>
</Position13>
<Position14>
<Filename Value="uresourceformtogo.pas"/>
<Caret Line="10" Column="12"/>
<Caret Line="9" Column="17"/>
</Position14>
<Position15>
<Filename Value="uresourceformtogo.pas"/>
<Caret Line="9" Column="17"/>
<Caret Line="15" Column="15" TopLine="7"/>
</Position15>
<Position16>
<Filename Value="uresourceformtogo.pas"/>
<Caret Line="15" Column="15" TopLine="7"/>
<Caret Line="130" Column="26" TopLine="115"/>
</Position16>
<Position17>
<Filename Value="uresourceformtogo.pas"/>
<Caret Line="130" Column="26" TopLine="115"/>
<Caret Line="15" Column="20"/>
</Position17>
<Position18>
<Filename Value="uresourceformtogo.pas"/>
<Caret Line="15" Column="20"/>
</Position18>
<Position19>
<Filename Value="res2go.lpr"/>
<Caret Line="10" Column="19"/>
</Position18>
<Position19>
<Filename Value="uresourceformtogo.pas"/>
<Caret Line="246" Column="44" TopLine="220"/>
</Position19>
<Position20>
<Filename Value="uresourceformtogo.pas"/>
<Caret Line="246" Column="44" TopLine="220"/>
<Caret Line="252" Column="11" TopLine="245"/>
</Position20>
<Position21>
<Filename Value="uresourceformtogo.pas"/>
<Caret Line="252" Column="11" TopLine="245"/>
<Caret Line="9" Column="17"/>
</Position21>
<Position22>
<Filename Value="uresourceformtogo.pas"/>
<Caret Line="9" Column="17"/>
<Caret Line="298" Column="23" TopLine="290"/>
</Position22>
<Position23>
<Filename Value="uresourceformtogo.pas"/>
<Caret Line="298" Column="23" TopLine="290"/>
<Caret Line="322" Column="138" TopLine="290"/>
</Position23>
<Position24>
<Filename Value="uresourceformtogo.pas"/>
<Caret Line="322" Column="138" TopLine="290"/>
<Caret Line="573" Column="28" TopLine="529"/>
</Position24>
<Position25>
<Filename Value="uresourceformtogo.pas"/>
<Caret Line="573" Column="28" TopLine="529"/>
<Caret Line="605" Column="54" TopLine="541"/>
</Position25>
<Position26>
<Filename Value="uresourceformtogo.pas"/>
<Caret Line="605" Column="54" TopLine="541"/>
<Caret Line="118" Column="15" TopLine="91"/>
</Position26>
<Position27>
<Filename Value="uresourceformtogo.pas"/>
<Caret Line="118" Column="15" TopLine="91"/>
<Filename Value="supportsComponents.inc"/>
<Caret Line="128" Column="15" TopLine="94"/>
</Position27>
<Position28>
<Filename Value="supportsComponents.inc"/>
<Caret Line="128" Column="15" TopLine="94"/>
<Caret Line="127" Column="16" TopLine="94"/>
</Position28>
<Position29>
<Filename Value="supportsComponents.inc"/>
<Caret Line="127" Column="16" TopLine="94"/>
<Caret Line="4" Column="35"/>
</Position29>
<Position30>
<Filename Value="supportsComponents.inc"/>
<Caret Line="4" Column="35"/>
<Filename Value="res2go.lpr"/>
<Caret Line="16" Column="6"/>
</Position30>
</JumpHistory>
</ProjectSession>
Expand Down
Binary file modified Tools/res2go/src/res2go.res
Binary file not shown.
41 changes: 27 additions & 14 deletions Tools/res2go/src/uresourceformtogo.pas
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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('');
Expand Down Expand Up @@ -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 (');
Expand Down Expand Up @@ -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
Expand All @@ -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 (');
Expand Down Expand Up @@ -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;


Expand Down Expand Up @@ -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 (');
Expand Down
2 changes: 1 addition & 1 deletion samples/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## 目录下的例程并非所有都支持跨平台,只有部分基础组件支持跨平台。


| 项目名 | 说明 | 平台限制 |
| 项目名(Project) | 说明(Description) | 平台限制(Platform limit) |
| :------ | :------ | ---- |
| action | "动作"组件演示,演示action的公用使用 | |
| basic | 基础窗口 | |
Expand Down

0 comments on commit 8e024b5

Please sign in to comment.