Changeset 24 for trunk/IDE/Forms


Ignore:
Timestamp:
Nov 10, 2010, 9:42:27 AM (14 years ago)
Author:
george
Message:
  • Added: Parsing type parameters.
  • Fixed: Saving edited files.
Location:
trunk/IDE/Forms
Files:
6 edited

Legend:

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

    r21 r24  
    1919    procedure SynEditSourceChange(Sender: TObject);
    2020  private
    21     { private declarations }
     21    FProjectFile: TProjectFile;
     22    procedure SetProjectFile(const AValue: TProjectFile);
    2223  public
    23     ProjectFile: TProjectFile;
     24    property ProjectFile: TProjectFile read FProjectFile write SetProjectFile;
     25    procedure Save;
    2426  end;
    2527
     
    4143end;
    4244
     45procedure TCodeForm.SetProjectFile(const AValue: TProjectFile);
     46begin
     47  if FProjectFile = AValue then Exit;
     48  FProjectFile := AValue;
     49  if Assigned(AValue) then
     50    SynEditSource.Lines.Assign(FProjectFile.Source)
     51    else SynEditSource.ClearAll;
     52end;
     53
     54procedure TCodeForm.Save;
     55begin
     56  if Assigned(ProjectFile) then
     57    ProjectFile.Source.Assign(SynEditSource.Lines);
     58end;
     59
    4360end.
    4461
  • trunk/IDE/Forms/UMainForm.lfm

    r21 r24  
    11object MainForm: TMainForm
    2   Left = 362
     2  Left = 336
    33  Height = 501
    4   Top = 115
     4  Top = 102
    55  Width = 695
    66  Caption = 'Transpascal IDE'
     
    152152      Caption = 'New'
    153153      Hint = 'Create new project'
     154      OnExecute = AProjectNewExecute
    154155    end
    155156    object AProjectOpen: TAction
     
    164165      Hint = 'Save project to disk'
    165166      OnExecute = AProjectSaveExecute
     167      ShortCut = 16467
    166168    end
    167169    object AProjectSaveAs: TAction
  • trunk/IDE/Forms/UMainForm.pas

    r22 r24  
    77uses
    88  SysUtils, Variants, Classes, Graphics, Controls, Forms,
    9   Dialogs, StdCtrls, UCompiler, Registry,
     9  Dialogs, StdCtrls, UCompiler, Registry, Contnrs,
    1010  ComCtrls, ExtCtrls, SynEdit, SynHighlighterPas,
    1111  UProject, FileUtil, Menus, ActnList, UCoolDocking,
     
    5252    ToolBar1: TToolBar;
    5353    procedure AProjectCloseExecute(Sender: TObject);
     54    procedure AProjectNewExecute(Sender: TObject);
    5455    procedure AProjectOpenExecute(Sender: TObject);
    5556    procedure AProjectSaveAsExecute(Sender: TObject);
     
    9192procedure TMainForm.ABuildExecute(Sender: TObject);
    9293begin
     94  CodeForm.Save;
     95
    9396  // Compile project file
    9497  if (ComboBoxAnalyzer.Items.Count > 0) and (ComboBoxAnalyzer.ItemIndex <> -1) and
     
    208211begin
    209212  Project.LoadFromFile(FileName);
    210   LastOpenedFiles.Add(FileName);
     213  LastOpenedFiles.AddItem(FileName);
    211214  LastOpenedFiles.ReloadMenu;
    212215  ProjectManager.UpdateProjectTree;
     
    235238  for I := 0 to Compiler.Producers.Count - 1 do
    236239    ComboBoxProducer.AddItem(Compiler.Producers[I].Name, nil);
     240
    237241  ComboBoxAnalyzer.Clear;
    238242  for I := 0 to Compiler.Analyzers.Count - 1 do
     
    289293end;
    290294
     295procedure TMainForm.AProjectNewExecute(Sender: TObject);
     296begin
     297  Project.Clear;
     298  Project.Name := 'New project';
     299  ProjectManager.UpdateProjectTree;
     300  Caption := ApplicationInfo.Name + ' - ' + Project.Name;
     301end;
     302
    291303procedure TMainForm.AProjectSaveAsExecute(Sender: TObject);
    292304begin
    293305  if SaveDialog1.Execute then begin
    294306    Project.SaveToFile(SaveDialog1.FileName);
     307    CodeForm.Save;
    295308    Project.Save;
    296309  end;
     
    299312procedure TMainForm.AProjectSaveExecute(Sender: TObject);
    300313begin
     314  CodeForm.Save;
    301315  Project.SaveToFile(Project.GetDir(True) + Project.Name + '.tppr');
    302316end;
  • trunk/IDE/Forms/UMessagesForm.lfm

    r2 r24  
    2626        Width = 500
    2727      end>
    28     ItemIndex = -1
    2928    OwnerData = True
    3029    ReadOnly = True
  • trunk/IDE/Forms/UMessagesForm.pas

    r2 r24  
    4747procedure TMessagesForm.ListView1Click(Sender: TObject);
    4848begin
    49   ListView1SelectItem(Self, ListView1.Selected, ListView1.Selected.Selected);
     49  if Assigned(ListView1.Selected) then
     50    ListView1SelectItem(Self, ListView1.Selected, ListView1.Selected.Selected);
    5051end;
    5152
  • trunk/IDE/Forms/UProjectManager.pas

    r23 r24  
    7777    NewNode.Expand(True);
    7878    EndUpdate;
    79     TreeViewProject.TopItem.Items[0].Selected := True;
     79    if Assigned(TreeViewProject.TopItem) and
     80      (TreeViewProject.TopItem.Count > 0) then
     81      TreeViewProject.TopItem.Items[0].Selected := True
     82      else CodeForm.ProjectFile := nil;
    8083  end;
    8184end;
Note: See TracChangeset for help on using the changeset viewer.