Skip to content

Commit c96f1aa

Browse files
author
Joachim Marder
committed
RibbonDesigner can now be called with a project file and /BUILD to build the ribbon. Implements issue #27.
1 parent 839b9ed commit c96f1aa

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

Designer/FMain.pas

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,6 @@ constructor TFormMain.Create(AOwner: TComponent);
378378

379379
FDocument := TRibbonDocument.Create;
380380
FCompiler := TRibbonCompiler.Create;
381-
FCompiler.OnMessage := RibbonCompilerMessage;
382381

383382
FFrameCommands := TFrameCommands.Create(Self);
384383
FFrameCommands.Parent := TabSheetCommands;
@@ -389,10 +388,19 @@ constructor TFormMain.Create(AOwner: TComponent);
389388
FFrameXmlSource := TFrameXmlSource.Create(Self);
390389
FFrameXmlSource.Parent := TabSheetXmlSource;
391390

392-
if (ParamCount > 0) and FileExists(ParamStr(1)) then
393-
OpenFile(ParamStr(1))
394-
else
395-
NewFile(True);
391+
// Handle command line options
392+
if (ParamCount > 0) and FileExists(ParamStr(1)) then begin // File passed at the command line?
393+
OpenFile(ParamStr(1));
394+
if FindCmdLineSwitch('BUILD') then begin
395+
ActionBuild.Execute();
396+
Application.ShowMainForm := False;
397+
Application.Terminate();
398+
end// if /BUILD
399+
else begin
400+
NewFile(True);
401+
FCompiler.OnMessage := RibbonCompilerMessage;
402+
end;//else
403+
end // if file passed
396404
end;
397405

398406
destructor TFormMain.Destroy;

0 commit comments

Comments
 (0)