Skip to content

Commit 1ad0835

Browse files
author
Joachim Marder
committed
Issue #22: Write the path to the Ribbon Designer to the registry, so that the designtime package knows where to find it.
1 parent 63ea4fe commit 1ad0835

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

Designer/FMain.pas

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ TFormMain = class(TForm)
160160
implementation
161161

162162
uses
163-
UITypes;
163+
UITypes, System.Win.Registry, UIRibbonUtils;
164164

165165
{$R *.dfm}
166166

@@ -367,6 +367,15 @@ procedure TFormMain.CMShowingChanged(var Msg: TMessage);
367367
constructor TFormMain.Create(AOwner: TComponent);
368368
begin
369369
inherited;
370+
// Write the path to the Ribbon Designer to the registry, so that the designtime package knows where to find it. Issue #22
371+
With TRegistry.Create do
372+
try
373+
OpenKey(cRegistryPath, True);
374+
WriteString(cRegistryKeyDesigner, ParamStr(0));
375+
finally
376+
Free;
377+
end;
378+
370379
FDocument := TRibbonDocument.Create;
371380
FCompiler := TRibbonCompiler.Create;
372381
FCompiler.OnMessage := RibbonCompilerMessage;

Lib/UIRibbonUtils.pas

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,14 @@ function ColorToHsb(const Color: TColor): TUIHsbColor;
1515

1616
function CreateStringFromResource(const ResourceId: Integer): String;
1717

18+
19+
const
20+
cPackageTitle = 'Ribbon Framework';
21+
cRegistryPath = 'Software\Embarcadero\' + cPackageTitle;
22+
cRegistryKeyDesigner = 'RibbonDesigner';
23+
24+
25+
1826
implementation
1927

2028
uses

0 commit comments

Comments
 (0)