Changeset 66
- Timestamp:
- Jul 19, 2012, 8:16:57 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Compiler/UCompiler.pas
r62 r66 38 38 FTarget: TTarget; 39 39 FOnErrorMessage: TErrorMessageEvent; 40 procedure ErrorMessage(Text: string; Position: TPoint; FileName: string);41 40 procedure SetAnalyzer(const AValue: TAnalyzer); 42 41 procedure AnalyzeAll; … … 45 44 public 46 45 AbstractCode: TProgram; 47 ErrorMessages: TListObject; 46 ErrorMessages: TListObject; // TListObject<TErrorMessage> 48 47 CompiledFolder: string; 49 48 … … 51 50 Targets: TListTarget; 52 51 MainSource: string; 52 procedure ErrorMessage(Text: string; Position: TPoint; FileName: string); 53 53 constructor Create; virtual; 54 54 destructor Destroy; override; 55 procedure Init; 55 procedure Init; virtual; 56 56 procedure Compile; 57 57 property OnErrorMessage: TErrorMessageEvent read FOnErrorMessage … … 246 246 if FTarget = AValue then Exit; 247 247 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; 251 253 end; 252 254 -
trunk/Demos/Simple/Simple.dpr
r61 r66 9 9 A := 2; 10 10 A := A + 1; 11 WriteLn('Hello world!'); 11 12 ReadLn; 12 13 end. -
trunk/Demos/Simple/System.pas
r61 r66 4 4 5 5 type 6 Integer = type; 6 Integer = type; internal; 7 String = type; internal; 7 8 8 procedure ReadLn; 9 function ReadLn: string; internal; 10 procedure WriteLn(Text: string); internal; 9 11 10 12 implementation 11 13 12 procedure ReadLn; 14 function ReadLn: string; 15 begin 16 Result := ''; 17 end; 18 19 procedure WriteLn(Text: string); 13 20 begin 14 21 end; -
trunk/IDE/Forms/UFormMain.lfm
r65 r66 1 1 object FormMain: TFormMain 2 Left = 1402 Left = 202 3 3 Height = 501 4 Top = 524 Top = 62 5 5 Width = 695 6 6 Caption = 'Transpascal IDE' -
trunk/IDE/Forms/UFormMain.pas
r65 r66 8 8 SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, 9 9 ComCtrls, ExtCtrls, SynEdit, SynHighlighterPas, 10 UProject, FileUtil, Menus, ActnList, 11 UFormTargetCode, UFormCodeTree, UGeneralRegistry , UApplicationInfo;10 UProject, FileUtil, Menus, ActnList, DateUtils, 11 UFormTargetCode, UFormCodeTree, UGeneralRegistry; 12 12 13 13 type … … 146 146 procedure ProducerProcessOutput(Text: string); 147 147 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); 150 150 procedure OpenRecentClick(Sender: TObject); 151 151 function GetSource(Name: string; var SourceCode: string): Boolean; … … 165 165 UFormTargets, UTarget, UExecutor, UFormProjectNew, 166 166 UFormTargetProject, UFormExternalProducerOutput; 167 168 resourcestring 169 SBuildFinished = 'Build finished in %s seconds'; 167 170 168 171 { TFormMain } … … 192 195 Compiler.Compile; 193 196 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); 195 199 FormTargetProject.UpdateInterface; 196 200 … … 203 207 end; 204 208 FormProject.TreeViewProjectChange(Self, FormProject.TreeViewProject.Selected); 209 Compiler.ErrorMessage(Format(SBuildFinished, [FloatToStrF(Compiler.ElapsedTime / OneSecond, ffGeneral, 3, 10)]), Point(0, 0), ''); 205 210 FormMessages.Reload; 206 211 end; … … 397 402 end; 398 403 399 procedure TFormMain.LoadFromRegistry(Root: Integer; Key: string);404 procedure TFormMain.LoadFromRegistry(Root: Integer; const Key: string); 400 405 begin 401 406 with TGeneralRegistry.Create(nil) do … … 414 419 end; 415 420 416 procedure TFormMain.SaveToRegistry(Root: Integer; Key: string);421 procedure TFormMain.SaveToRegistry(Root: Integer; const Key: string); 417 422 begin 418 423 with TGeneralRegistry.Create(nil) do -
trunk/IDE/Forms/UFormMessages.pas
r57 r66 54 54 with Core, FormMain, FormSourceCode do 55 55 with TErrorMessage(Compiler.ErrorMessages[Item.Index]) do begin 56 Item.Caption := FileName; 56 if FileName = '' then Item.Caption := ' ' 57 else Item.Caption := FileName; 57 58 Item.Data := Compiler.ErrorMessages[Item.Index]; 58 59 Item.SubItems.Add(IntToStr(Position.X) + ',' + IntToStr(Position.Y)); … … 69 70 with Core, FormSourceCode do 70 71 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 72 74 ProjectFile := Project.Files.SearchFile(FileName); 73 75 if Assigned(ProjectFile) then -
trunk/IDE/Languages/Transpascal.cs.po
r61 r66 849 849 msgstr "Verze" 850 850 851 #: uformmain.snewproject 852 msgctxt "uformmain.snewproject" 853 msgid "New project" 854 msgstr "Nový projekt" 851 #: uformmain.sbuildfinished 852 msgid "Build finished in %s seconds" 853 msgstr "" 855 854 856 855 #: uformproject.senternewfilename -
trunk/IDE/Languages/Transpascal.po
r65 r66 838 838 msgstr "" 839 839 840 #: uformmain.snewproject 841 msgctxt "uformmain.snewproject" 842 msgid "New project" 840 #: uformmain.sbuildfinished 841 msgid "Build finished in %s seconds" 843 842 msgstr "" 844 843 -
trunk/IDE/Transpascal.lpi
r64 r66 80 80 </local> 81 81 </RunParams> 82 <RequiredPackages Count=" 7">82 <RequiredPackages Count="8"> 83 83 <Item1> 84 <PackageName Value="GeneralRegistry"/> 85 <MinVersion Minor="1" Valid="True"/> 86 </Item1> 87 <Item2> 84 88 <PackageName Value="Common"/> 85 89 <MinVersion Minor="7" Valid="True"/> 86 </Item1>87 <Item2>88 <PackageName Value="CoolTranslator"/>89 90 </Item2> 90 91 <Item3> 92 <PackageName Value="CoolTranslator"/> 93 </Item3> 94 <Item4> 91 95 <PackageName Value="LCLBase"/> 92 96 <MinVersion Major="1" Release="1" Valid="True"/> 93 </Item3>94 <Item4>95 <PackageName Value="TemplateGenerics"/>96 97 </Item4> 97 98 <Item5> 98 <PackageName Value="T ranspascalCompiler"/>99 <PackageName Value="TemplateGenerics"/> 99 100 </Item5> 100 101 <Item6> 102 <PackageName Value="TranspascalCompiler"/> 103 </Item6> 104 <Item7> 101 105 <PackageName Value="SynEdit"/> 102 106 <MinVersion Major="1" Valid="True"/> 103 </Item 6>104 <Item 7>107 </Item7> 108 <Item8> 105 109 <PackageName Value="LCL"/> 106 </Item 7>110 </Item8> 107 111 </RequiredPackages> 108 112 <Units Count="18"> -
trunk/IDE/UCore.lfm
r65 r66 41 41 RegistryRoot = rrApplicationUser 42 42 left = 48 43 top = 19543 top = 200 44 44 end 45 45 end -
trunk/IDE/UCore.pas
r65 r66 13 13 14 14 TCustomCompiler = class(TCompiler) 15 StartTime: TDateTime; 15 16 SourceFiles: TSourceFileManager; 16 17 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); 19 22 constructor Create; override; 20 23 destructor Destroy; override; … … 46 49 procedure ProjectNew; 47 50 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); 50 53 end; 51 54 … … 94 97 LastOpenedFiles := TLastOpenedList.Create(nil); 95 98 LastOpenedFiles.OnChange := LastOpenedFilesChange; 99 100 ReopenLastOpenedFile := True; 101 LogParsing := False; 96 102 end; 97 103 … … 136 142 end; 137 143 138 procedure TCore.LoadFromRegistry(Root: Integer; Key: string);144 procedure TCore.LoadFromRegistry(Root: Integer; const Key: string); 139 145 begin 140 146 with TGeneralRegistry.Create(nil) do … … 162 168 end; 163 169 164 procedure TCore.SaveToRegistry(Root: Integer; Key: string);170 procedure TCore.SaveToRegistry(Root: Integer; const Key: string); 165 171 begin 166 172 with TGeneralRegistry.Create(nil) do … … 186 192 { TCustomCompiler } 187 193 188 procedure TCustomCompiler.LoadFromRegistry(Root: Integer; Key: string); 194 procedure TCustomCompiler.Init; 195 begin 196 inherited; 197 StartTime := Now; 198 end; 199 200 function TCustomCompiler.ElapsedTime: TDateTime; 201 begin 202 Result := Now - StartTime; 203 end; 204 205 procedure TCustomCompiler.LoadFromRegistry(Root: Integer; const Key: string); 189 206 var 190 207 I: Integer; … … 208 225 end; 209 226 210 procedure TCustomCompiler.SaveToRegistry(Root: Integer; Key: string);227 procedure TCustomCompiler.SaveToRegistry(Root: Integer; const Key: string); 211 228 var 212 229 I: Integer;
Note:
See TracChangeset
for help on using the changeset viewer.