Changeset 66


Ignore:
Timestamp:
Jul 19, 2012, 8:16:57 AM (12 years ago)
Author:
chronos
Message:
  • Added: Information text about completion of build process including elapsed time.
Location:
trunk
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/Compiler/UCompiler.pas

    r62 r66  
    3838    FTarget: TTarget;
    3939    FOnErrorMessage: TErrorMessageEvent;
    40     procedure ErrorMessage(Text: string; Position: TPoint; FileName: string);
    4140    procedure SetAnalyzer(const AValue: TAnalyzer);
    4241    procedure AnalyzeAll;
     
    4544  public
    4645    AbstractCode: TProgram;
    47     ErrorMessages: TListObject;
     46    ErrorMessages: TListObject; // TListObject<TErrorMessage>
    4847    CompiledFolder: string;
    4948
     
    5150    Targets: TListTarget;
    5251    MainSource: string;
     52    procedure ErrorMessage(Text: string; Position: TPoint; FileName: string);
    5353    constructor Create; virtual;
    5454    destructor Destroy; override;
    55     procedure Init;
     55    procedure Init; virtual;
    5656    procedure Compile;
    5757    property OnErrorMessage: TErrorMessageEvent read FOnErrorMessage
     
    246246  if FTarget = AValue then Exit;
    247247  FTarget := AValue;
    248   FTarget.Compiler := Self;
    249   if Assigned(FTarget.Producer) then
    250     FTarget.Producer.OnWriteTarget := OnSaveTarget;
     248  if Assigned(FTarget) then begin
     249    FTarget.Compiler := Self;
     250    if Assigned(FTarget.Producer) then
     251      FTarget.Producer.OnWriteTarget := OnSaveTarget;
     252  end;
    251253end;
    252254
  • trunk/Demos/Simple/Simple.dpr

    r61 r66  
    99  A := 2;
    1010  A := A + 1;
     11  WriteLn('Hello world!');
    1112  ReadLn;
    1213end.
  • trunk/Demos/Simple/System.pas

    r61 r66  
    44
    55type
    6   Integer = type;
     6  Integer = type; internal;
     7  String = type; internal;
    78 
    8 procedure ReadLn;
     9function ReadLn: string; internal;
     10procedure WriteLn(Text: string); internal;
    911
    1012implementation
    1113
    12 procedure ReadLn;
     14function ReadLn: string;
     15begin
     16  Result := '';
     17end;
     18
     19procedure WriteLn(Text: string);
    1320begin
    1421end;
  • trunk/IDE/Forms/UFormMain.lfm

    r65 r66  
    11object FormMain: TFormMain
    2   Left = 140
     2  Left = 202
    33  Height = 501
    4   Top = 52
     4  Top = 62
    55  Width = 695
    66  Caption = 'Transpascal IDE'
  • trunk/IDE/Forms/UFormMain.pas

    r65 r66  
    88  SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls,
    99  ComCtrls, ExtCtrls, SynEdit, SynHighlighterPas,
    10   UProject, FileUtil, Menus, ActnList,
    11   UFormTargetCode, UFormCodeTree, UGeneralRegistry, UApplicationInfo;
     10  UProject, FileUtil, Menus, ActnList, DateUtils,
     11  UFormTargetCode, UFormCodeTree, UGeneralRegistry;
    1212
    1313type
     
    146146    procedure ProducerProcessOutput(Text: string);
    147147  public
    148     procedure LoadFromRegistry(Root: Integer; Key: string);
    149     procedure SaveToRegistry(Root: Integer; Key: string);
     148    procedure LoadFromRegistry(Root: Integer; const Key: string);
     149    procedure SaveToRegistry(Root: Integer; const Key: string);
    150150    procedure OpenRecentClick(Sender: TObject);
    151151    function GetSource(Name: string; var SourceCode: string): Boolean;
     
    165165  UFormTargets, UTarget, UExecutor, UFormProjectNew,
    166166  UFormTargetProject, UFormExternalProducerOutput;
     167
     168resourcestring
     169  SBuildFinished = 'Build finished in %s seconds';
    167170
    168171{ TFormMain }
     
    192195      Compiler.Compile;
    193196      TargetProject.Files.LoadFromList(Compiler.TargetFiles.Files);
    194       TargetProject.MainSource := TProjectFile(TargetProject.Files.First);
     197      if TargetProject.Files.Count > 0 then
     198        TargetProject.MainSource := TProjectFile(TargetProject.Files.First);
    195199      FormTargetProject.UpdateInterface;
    196200
     
    203207    end;
    204208    FormProject.TreeViewProjectChange(Self, FormProject.TreeViewProject.Selected);
     209    Compiler.ErrorMessage(Format(SBuildFinished, [FloatToStrF(Compiler.ElapsedTime / OneSecond, ffGeneral, 3, 10)]), Point(0, 0), '');
    205210    FormMessages.Reload;
    206211  end;
     
    397402end;
    398403
    399 procedure TFormMain.LoadFromRegistry(Root: Integer; Key: string);
     404procedure TFormMain.LoadFromRegistry(Root: Integer; const Key: string);
    400405begin
    401406  with TGeneralRegistry.Create(nil) do
     
    414419end;
    415420
    416 procedure TFormMain.SaveToRegistry(Root: Integer; Key: string);
     421procedure TFormMain.SaveToRegistry(Root: Integer; const Key: string);
    417422begin
    418423  with TGeneralRegistry.Create(nil) do
  • trunk/IDE/Forms/UFormMessages.pas

    r57 r66  
    5454  with Core, FormMain, FormSourceCode do
    5555  with TErrorMessage(Compiler.ErrorMessages[Item.Index]) do begin
    56     Item.Caption := FileName;
     56    if FileName = '' then Item.Caption := ' '
     57      else Item.Caption := FileName;
    5758    Item.Data := Compiler.ErrorMessages[Item.Index];
    5859    Item.SubItems.Add(IntToStr(Position.X) + ',' + IntToStr(Position.Y));
     
    6970  with Core, FormSourceCode do
    7071  if Assigned(ListView1.Selected) then
    71   with TErrorMessage(ListView1.Selected.Data) do begin
     72  with TErrorMessage(ListView1.Selected.Data) do
     73  if FileName <> '' then begin
    7274    ProjectFile := Project.Files.SearchFile(FileName);
    7375    if Assigned(ProjectFile) then
  • trunk/IDE/Languages/Transpascal.cs.po

    r61 r66  
    849849msgstr "Verze"
    850850
    851 #: uformmain.snewproject
    852 msgctxt "uformmain.snewproject"
    853 msgid "New project"
    854 msgstr "Nový projekt"
     851#: uformmain.sbuildfinished
     852msgid "Build finished in %s seconds"
     853msgstr ""
    855854
    856855#: uformproject.senternewfilename
  • trunk/IDE/Languages/Transpascal.po

    r65 r66  
    838838msgstr ""
    839839
    840 #: uformmain.snewproject
    841 msgctxt "uformmain.snewproject"
    842 msgid "New project"
     840#: uformmain.sbuildfinished
     841msgid "Build finished in %s seconds"
    843842msgstr ""
    844843
  • trunk/IDE/Transpascal.lpi

    r64 r66  
    8080      </local>
    8181    </RunParams>
    82     <RequiredPackages Count="7">
     82    <RequiredPackages Count="8">
    8383      <Item1>
     84        <PackageName Value="GeneralRegistry"/>
     85        <MinVersion Minor="1" Valid="True"/>
     86      </Item1>
     87      <Item2>
    8488        <PackageName Value="Common"/>
    8589        <MinVersion Minor="7" Valid="True"/>
    86       </Item1>
    87       <Item2>
    88         <PackageName Value="CoolTranslator"/>
    8990      </Item2>
    9091      <Item3>
     92        <PackageName Value="CoolTranslator"/>
     93      </Item3>
     94      <Item4>
    9195        <PackageName Value="LCLBase"/>
    9296        <MinVersion Major="1" Release="1" Valid="True"/>
    93       </Item3>
    94       <Item4>
    95         <PackageName Value="TemplateGenerics"/>
    9697      </Item4>
    9798      <Item5>
    98         <PackageName Value="TranspascalCompiler"/>
     99        <PackageName Value="TemplateGenerics"/>
    99100      </Item5>
    100101      <Item6>
     102        <PackageName Value="TranspascalCompiler"/>
     103      </Item6>
     104      <Item7>
    101105        <PackageName Value="SynEdit"/>
    102106        <MinVersion Major="1" Valid="True"/>
    103       </Item6>
    104       <Item7>
     107      </Item7>
     108      <Item8>
    105109        <PackageName Value="LCL"/>
    106       </Item7>
     110      </Item8>
    107111    </RequiredPackages>
    108112    <Units Count="18">
  • trunk/IDE/UCore.lfm

    r65 r66  
    4141    RegistryRoot = rrApplicationUser
    4242    left = 48
    43     top = 195
     43    top = 200
    4444  end
    4545end
  • trunk/IDE/UCore.pas

    r65 r66  
    1313
    1414  TCustomCompiler = class(TCompiler)
     15    StartTime: TDateTime;
    1516    SourceFiles: TSourceFileManager;
    1617    TargetFiles: TSourceFileManager;
    17     procedure LoadFromRegistry(Root: Integer; Key: string);
    18     procedure SaveToRegistry(Root: Integer; Key: string);
     18    procedure Init; override;
     19    function ElapsedTime: TDateTime;
     20    procedure LoadFromRegistry(Root: Integer; const Key: string);
     21    procedure SaveToRegistry(Root: Integer; const Key: string);
    1922    constructor Create; override;
    2023    destructor Destroy; override;
     
    4649    procedure ProjectNew;
    4750    procedure CompilerDebugLog(Text: string);
    48     procedure LoadFromRegistry(Root: Integer; Key: string);
    49     procedure SaveToRegistry(Root: Integer; Key: string);
     51    procedure LoadFromRegistry(Root: Integer; const Key: string);
     52    procedure SaveToRegistry(Root: Integer; const Key: string);
    5053  end;
    5154
     
    9497  LastOpenedFiles := TLastOpenedList.Create(nil);
    9598  LastOpenedFiles.OnChange := LastOpenedFilesChange;
     99
     100  ReopenLastOpenedFile := True;
     101  LogParsing := False;
    96102end;
    97103
     
    136142end;
    137143
    138 procedure TCore.LoadFromRegistry(Root: Integer; Key: string);
     144procedure TCore.LoadFromRegistry(Root: Integer; const Key: string);
    139145begin
    140146  with TGeneralRegistry.Create(nil) do
     
    162168end;
    163169
    164 procedure TCore.SaveToRegistry(Root: Integer; Key: string);
     170procedure TCore.SaveToRegistry(Root: Integer; const Key: string);
    165171begin
    166172  with TGeneralRegistry.Create(nil) do
     
    186192{ TCustomCompiler }
    187193
    188 procedure TCustomCompiler.LoadFromRegistry(Root: Integer; Key: string);
     194procedure TCustomCompiler.Init;
     195begin
     196  inherited;
     197  StartTime := Now;
     198end;
     199
     200function TCustomCompiler.ElapsedTime: TDateTime;
     201begin
     202  Result := Now - StartTime;
     203end;
     204
     205procedure TCustomCompiler.LoadFromRegistry(Root: Integer; const Key: string);
    189206var
    190207  I: Integer;
     
    208225end;
    209226
    210 procedure TCustomCompiler.SaveToRegistry(Root: Integer; Key: string);
     227procedure TCustomCompiler.SaveToRegistry(Root: Integer; const Key: string);
    211228var
    212229  I: Integer;
Note: See TracChangeset for help on using the changeset viewer.