Changeset 61 for trunk/IDE/Forms


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.
Location:
trunk/IDE/Forms
Files:
3 added
6 edited

Legend:

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

    r60 r61  
    116116    Top = 26
    117117    Width = 200
    118     ActivePage = TabSheetTargetProject
     118    ActivePage = TabSheetExternalProducer
    119119    Align = alRight
    120     TabIndex = 2
     120    TabIndex = 3
    121121    TabOrder = 3
    122122    TabPosition = tpRight
     
    129129    object TabSheetTargetProject: TTabSheet
    130130      Caption = 'Target project'
     131    end
     132    object TabSheetExternalProducer: TTabSheet
     133      Caption = 'External producer'
    131134    end
    132135  end
  • trunk/IDE/Forms/UFormMain.lrt

    r50 r61  
    33TFORMMAIN.TABSHEETCODETREE.CAPTION=Code Tree
    44TFORMMAIN.TABSHEETTARGETPROJECT.CAPTION=Target project
     5TFORMMAIN.TABSHEETEXTERNALPRODUCER.CAPTION=External producer
    56TFORMMAIN.TABSHEETMESSAGES.CAPTION=Messages
    67TFORMMAIN.TABSHEETBREAKPOINTS.CAPTION=Breakpoints
  • 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;
  • trunk/IDE/Forms/UFormProject.lfm

    r57 r61  
    1919    TabOrder = 0
    2020    OnChange = TreeViewProjectChange
     21    OnDblClick = TreeViewProjectDblClick
    2122    Options = [tvoAutoItemHeight, tvoHideSelection, tvoKeepCollapsedNodes, tvoReadOnly, tvoShowButtons, tvoShowLines, tvoShowRoot, tvoToolTips, tvoThemedDraw]
    2223  end
  • trunk/IDE/Forms/UFormProject.pas

    r56 r61  
    2929    procedure AShowExecute(Sender: TObject);
    3030    procedure TreeViewProjectChange(Sender: TObject; Node: TTreeNode);
     31    procedure TreeViewProjectDblClick(Sender: TObject);
    3132  private
    3233    procedure UpdateProjectFiles(Node: TTreeNode; Files: TProjectFileList);
     
    4647  UCore, UFormMain, UFormSourceCode, UFormTargetCode, UFormCodeTree;
    4748
     49resourcestring
     50  SRenameSourceFile = 'Rename source file';
     51  SEnterNewFileName = 'Enter new file name';
     52
    4853{ TFormProject }
    4954
     
    5459  if Assigned(Node) then begin
    5560    if TProjectFile(Node.Data) is TProjectFile then begin
    56       ProjectFile := TProjectFile(Node.Data);
    57       SynEditSource.Lines.Assign(TProjectFile(Node.Data).Source);
     61      TreeViewProject.PopupMenu := PopupMenuFile;
     62      AShow.Execute;
    5863(*        if FileExists(TProjectFile(Node.Data).ProducedFileName) then
    5964        CompiledForm.SynEdit1.Lines.LoadFromFile(FileName) else
     
    7883      //CodeTreeForm.TreeView1.Assign(TProducerTreeView(Compiler.Producer).TreeView);
    7984      *)
    80     end;
     85    end else
     86      TreeViewProject.PopupMenu := nil;
    8187  end;
     88end;
     89
     90procedure TFormProject.TreeViewProjectDblClick(Sender: TObject);
     91begin
     92  AShow.Execute;
    8293end;
    8394
     
    95106procedure TFormProject.ADeleteExecute(Sender: TObject);
    96107begin
    97 
     108  if Assigned(TreeViewProject.Selected) then
     109    Core.Project.Files.Remove(TreeViewProject.Selected.Data);
     110  UpdateProjectTree;
    98111end;
    99112
    100113procedure TFormProject.ARenameExecute(Sender: TObject);
     114var
     115  NewName: string;
    101116begin
    102 
     117  if Assigned(TreeViewProject.Selected) then begin
     118    NewName := TProjectFile(TreeViewProject.Selected.Data).FileName;
     119    if InputQuery(SRenameSourceFile, SEnterNewFileName, NewName) then
     120      TProjectFile(TreeViewProject.Selected.Data).FileName := NewName;
     121    UpdateProjectTree;
     122  end;
    103123end;
    104124
    105125procedure TFormProject.AShowExecute(Sender: TObject);
    106126begin
    107 
     127  if Assigned(TreeViewProject.Selected) then
     128  FormSourceCode.SynEditSource.Lines.Assign(TProjectFile(TreeViewProject.Selected.Data).Source);
    108129end;
    109130
  • trunk/IDE/Forms/UFormProjectNew.pas

    r57 r61  
    7474    with Core do
    7575    for I := 0 to ProjectTemplates.Count - 1 do
    76     with TProjectTemplate(ProjectTemplates[I]) do begin
     76    with TProjectTemplate(ProjectTemplates[I]) do
     77    if (not Assigned(Core.Project) and IsProject) or Assigned(Core.Project) then begin
    7778      NewItem := ListView1.Items.Add;
    7879      NewItem.Caption := Name;
Note: See TracChangeset for help on using the changeset viewer.