Skip to content

Commit 753bef1

Browse files
author
sascha.schaefer87
committed
- Added new property "Ressource" to class TRibbonMarkupElementList
- Corrected Typo in powershell script
1 parent 166ba23 commit 753bef1

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

Generate.Ribbon.Markup.pas.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ $headerFilePath = $workingDir + ([System.IO.Path]::GetFileNameWithoutExtension($
1919
$resFileName = ([System.IO.Path]::GetFileNameWithoutExtension($xmlFilePath) + ".res")
2020
$unitName = ([System.IO.Path]::GetFileNameWithoutExtension($xmlFilePath))
2121

22-
$RessourceName = $args[1]
22+
$ResourceName = $args[1]
2323
$UICCDir = $args[2]
2424

2525
# Checks if a file exists under a given location. If yes, the path to this file is returned. If not, we lookup several known locations and return those, if the file is found.
@@ -62,7 +62,7 @@ $UICCCmd = FindFileInLocation -pLocation $UICCDir -pFileName "UICC.exe"
6262
write-host "UICC.exe found: Using $UICCCmd"
6363

6464
# Use the provided xml file to Create the .bml, .h and .rc file
65-
& $UICCCmd "/W0" "$xmlFilePath" "$bmlFilePath" "/header:$headerFilePath" "/res:$rcFilePath" "/name:$RessourceName"
65+
& $UICCCmd "/W0" "$xmlFilePath" "$bmlFilePath" "/header:$headerFilePath" "/res:$rcFilePath" "/name:$ResourceName"
6666

6767
# Find rc.exe (Use the same locations as UICC.exe)
6868
$RCCmd = FindFileInLocation -pLocation $UICCDir -pFileName "rc.exe"
@@ -121,7 +121,7 @@ implementation
121121
122122
function GetElements(): TRibbonMarkupElementList;
123123
begin
124-
Result := TRibbonMarkupElementList.Create();
124+
Result := TRibbonMarkupElementList.Create('$ResourceName');
125125
"@
126126

127127
Add-Content "$pasFilePath" $FileMiddlePart

Lib/UIRibbon.pas

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,12 @@ TRibbonMarkupElement = record
4949
end;
5050

5151
TRibbonMarkupElementList = class(TList<TRibbonMarkupElement>)
52+
private
53+
fResourceName: string;
54+
public
5255
function TryGetItem(pID: integer; out pItem: TRibbonMarkupElement): boolean;
56+
constructor Create(pResourceName: string);
57+
property ResourceName: string read fResourceName write fResourceName;
5358
end;
5459

5560

@@ -482,6 +487,12 @@ constructor TRibbonMarkupElement.Create(pActionName: string; pActionID: integer;
482487

483488
{ TRibbonMarkupElementList }
484489

490+
constructor TRibbonMarkupElementList.Create(pResourceName: string);
491+
begin
492+
inherited Create();
493+
fResourceName := pResourceName;
494+
end;
495+
485496
function TRibbonMarkupElementList.TryGetItem(pID: integer; out pItem: TRibbonMarkupElement): boolean;
486497
var
487498
lElement: TRibbonMarkupElement;

0 commit comments

Comments
 (0)