Ignore:
Timestamp:
Jul 17, 2012, 9:15:42 AM (12 years ago)
Author:
chronos
Message:
  • Added: Form with text output of executed external producer tool.
  • Fixed: Template for new unit mustn't initialize new project but only add unit file to project.
  • Added: Project manager file deletion and rename.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/IDE/Forms/UFormMain.pas

    r60 r61  
    9090    Splitter2: TSplitter;
    9191    Splitter3: TSplitter;
     92    TabSheetExternalProducer: TTabSheet;
    9293    TabSheetProject: TTabSheet;
    9394    TabSheetCodeTree: TTabSheet;
     
    143144    procedure UpdateMenu;
    144145    procedure UpdateTitle;
     146    procedure ProducerProcessOutput(Text: string);
    145147  public
    146148    procedure LoadFromRegistry(Root: HKEY; Key: string);
     
    162164  UCore, UFormMessages, UFormSourceCode, UFormProject, UCommon, UFormAbout, UFormOptions,
    163165  UFormTargets, UTarget, UExecutor, UFormProjectNew,
    164   UFormTargetProject;
     166  UFormTargetProject, UFormExternalProducerOutput;
    165167
    166168{ TFormMain }
     
    189191      Compiler.Compile;
    190192      TargetProject.Files.LoadFromList(Compiler.TargetFiles.Files);
     193      TargetProject.MainSource := TProjectFile(TargetProject.Files.First);
    191194      FormTargetProject.UpdateInterface;
     195
     196      FormExternalProducerOutput.Memo1.Clear;
     197      if Assigned(Compiler.Target.Producer) then
     198      with Compiler.Target.Producer do begin
     199        FormExternalProducerOutput.Memo1.Lines.Add(CompilerPath + ' ' + Format(CompilerParameters, [TargetProject.MainSource.AbsoluteFileName]));
     200        ExternalExecute(CompilerPath + ' ' + Format(CompilerParameters, [TargetProject.MainSource.AbsoluteFileName]));
     201      end;
    192202    end;
    193203    FormProject.TreeViewProjectChange(Self, FormProject.TreeViewProject.Selected);
     
    344354  FormTargetCode.Align := alClient;
    345355  FormTargetCode.Show;
     356  FormExternalProducerOutput.ManualDock(TabSheetExternalProducer, nil, alClient);
     357  FormExternalProducerOutput.Align := alClient;
     358  FormExternalProducerOutput.Show;
    346359  PageControlRight.TabIndex := 0;
    347360  PageControlBottom.TabIndex := 0;
     
    446459end;
    447460
     461procedure TFormMain.ProducerProcessOutput(Text: string);
     462begin
     463  FormExternalProducerOutput.Memo1.Lines.Add(Text);
     464end;
     465
    448466procedure TFormMain.FormClose(Sender: TObject; var Action: TCloseAction);
    449467begin
     
    453471
    454472procedure TFormMain.FormCreate(Sender: TObject);
    455 begin
     473var
     474  I: Integer;
     475begin
     476  with Core.Compiler.Targets do
     477  for I := 0 to Count - 1 do
     478  with TTarget(Items[I]) do
     479  if Assigned(Producer) then
     480    Producer.OnProcessOutput := ProducerProcessOutput;
    456481end;
    457482
     
    517542  if FormProjectNew.ShowModal = mrOk then begin
    518543    if Assigned(FormProjectNew.ListView1.Selected) then begin
    519       Core.ProjectNew;
     544      if TProjectTemplate(FormProjectNew.ListView1.Selected.Data).IsProject then
     545        Core.ProjectNew;
    520546      TProjectTemplate(FormProjectNew.ListView1.Selected.Data).InitProject(Core.Project);
    521547    end;
Note: See TracChangeset for help on using the changeset viewer.