mirror of
				https://gitlab.com/freepascal.org/lazarus/lazarus.git
				synced 2025-10-31 10:02:30 +01:00 
			
		
		
		
	IDEIntf: added rnning external tools
git-svn-id: trunk@9672 -
This commit is contained in:
		
							parent
							
								
									b116feb56e
								
							
						
					
					
						commit
						a700f82693
					
				| @ -25,7 +25,7 @@ interface | |||||||
| uses | uses | ||||||
|   Classes, SysUtils, LCLProc, LazConfigStorage, XMLPropStorage, Forms, Controls, |   Classes, SysUtils, LCLProc, LazConfigStorage, XMLPropStorage, Forms, Controls, | ||||||
|   Dialogs, FileUtil, FileProcs, |   Dialogs, FileUtil, FileProcs, | ||||||
|   IDEExternToolIntf, IDEDialogs; |   TextTools, IDEExternToolIntf, IDEDialogs, LazIDEIntf, IDEMsgIntf; | ||||||
|    |    | ||||||
| type | type | ||||||
|   TH2PasProject = class; |   TH2PasProject = class; | ||||||
| @ -163,11 +163,21 @@ type | |||||||
|     property OutputDirectory: string read FOutputDirectory write SetOutputDirectory; |     property OutputDirectory: string read FOutputDirectory write SetOutputDirectory; | ||||||
|   end; |   end; | ||||||
|    |    | ||||||
|  |   { TH2PasTool } | ||||||
|  | 
 | ||||||
|  |   TH2PasTool = class(TIDEExternalToolOptions) | ||||||
|  |   private | ||||||
|  |     FH2PasFile: TH2PasFile; | ||||||
|  |   public | ||||||
|  |     property H2PasFile: TH2PasFile read FH2PasFile write FH2PasFile; | ||||||
|  |   end; | ||||||
|  |    | ||||||
|   { TH2PasConverter } |   { TH2PasConverter } | ||||||
| 
 | 
 | ||||||
|   TH2PasConverter = class(TPersistent) |   TH2PasConverter = class(TPersistent) | ||||||
|   private |   private | ||||||
|     FAutoOpenLastProject: boolean; |     FAutoOpenLastProject: boolean; | ||||||
|  |     FExecuting: boolean; | ||||||
|     Fh2pasFilename: string; |     Fh2pasFilename: string; | ||||||
|     FModified: boolean; |     FModified: boolean; | ||||||
|     FProject: TH2PasProject; |     FProject: TH2PasProject; | ||||||
| @ -180,6 +190,7 @@ type | |||||||
|     procedure SetProjectHistory(const AValue: TStrings); |     procedure SetProjectHistory(const AValue: TStrings); | ||||||
|     procedure SetWindowBounds(const AValue: TRect); |     procedure SetWindowBounds(const AValue: TRect); | ||||||
|     procedure Seth2pasFilename(const AValue: string); |     procedure Seth2pasFilename(const AValue: string); | ||||||
|  |     procedure OnParseH2PasLine(Sender: TObject; Line: TIDEScanMessageLine); | ||||||
|   public |   public | ||||||
|     constructor Create; |     constructor Create; | ||||||
|     destructor Destroy; override; |     destructor Destroy; override; | ||||||
| @ -195,6 +206,10 @@ type | |||||||
|     function Execute: TModalResult; |     function Execute: TModalResult; | ||||||
|     function ConvertFile(AFile: TH2PasFile): TModalResult; |     function ConvertFile(AFile: TH2PasFile): TModalResult; | ||||||
|     function GetH2PasFilename: string; |     function GetH2PasFilename: string; | ||||||
|  |     function FindH2PasErrorMessage: integer; | ||||||
|  |     function GetH2PasErrorPostion(const Line: string; | ||||||
|  |                                   out aFilename: string; | ||||||
|  |                                   out LineNumber, Column: integer): boolean; | ||||||
|   public |   public | ||||||
|     property Project: TH2PasProject read FProject write SetProject; |     property Project: TH2PasProject read FProject write SetProject; | ||||||
|     property ProjectHistory: TStrings read FProjectHistory write SetProjectHistory; |     property ProjectHistory: TStrings read FProjectHistory write SetProjectHistory; | ||||||
| @ -205,6 +220,7 @@ type | |||||||
|                                           write SetAutoOpenLastProject; |                                           write SetAutoOpenLastProject; | ||||||
|     property h2pasFilename: string read Fh2pasFilename write Seth2pasFilename; |     property h2pasFilename: string read Fh2pasFilename write Seth2pasFilename; | ||||||
|     property Modified: boolean read FModified write FModified; |     property Modified: boolean read FModified write FModified; | ||||||
|  |     property Executing: boolean read FExecuting; | ||||||
|   end; |   end; | ||||||
| 
 | 
 | ||||||
| implementation | implementation | ||||||
| @ -848,6 +864,26 @@ end; | |||||||
| 
 | 
 | ||||||
| { TH2PasConverter } | { TH2PasConverter } | ||||||
| 
 | 
 | ||||||
|  | procedure TH2PasConverter.OnParseH2PasLine(Sender: TObject; | ||||||
|  |   Line: TIDEScanMessageLine); | ||||||
|  | var | ||||||
|  |   Tool: TH2PasTool; | ||||||
|  |   LineNumber: String; | ||||||
|  |   MsgType: String; | ||||||
|  |   Msg: String; | ||||||
|  | begin | ||||||
|  |   if Line.Tool is TH2PasTool then begin | ||||||
|  |     Tool:=TH2PasTool(Line.Tool); | ||||||
|  |     if REMatches(Line.Line,'^at line ([0-9]+) (error) : (.*)$') then begin | ||||||
|  |       LineNumber:=REVar(1); | ||||||
|  |       MsgType:=REVar(2); | ||||||
|  |       Msg:=REVar(3); | ||||||
|  |       Line.Line:=Tool.H2PasFile.Filename+'('+LineNumber+') '+MsgType+': '+Msg; | ||||||
|  |     end; | ||||||
|  |     //DebugLn(['TH2PasConverter.OnParseH2PasLine ',Line.Line]); | ||||||
|  |   end; | ||||||
|  | end; | ||||||
|  | 
 | ||||||
| function TH2PasConverter.GetCurrentProjectFilename: string; | function TH2PasConverter.GetCurrentProjectFilename: string; | ||||||
| begin | begin | ||||||
|   if FProjectHistory.Count>0 then |   if FProjectHistory.Count>0 then | ||||||
| @ -1036,18 +1072,27 @@ var | |||||||
|   AFile: TH2PasFile; |   AFile: TH2PasFile; | ||||||
|   CurResult: TModalResult; |   CurResult: TModalResult; | ||||||
| begin | begin | ||||||
|   Result:=mrOk; |   if FExecuting then begin | ||||||
|  |     DebugLn(['TH2PasConverter.Execute FAILED: Already executing']); | ||||||
|  |     exit(mrCancel); | ||||||
|  |   end; | ||||||
| 
 | 
 | ||||||
|   // convert every c header file |   Result:=mrOK; | ||||||
|   for i:=0 to Project.CHeaderFileCount-1 do begin |   FExecuting:=true; | ||||||
|     AFile:=Project.CHeaderFiles[i]; |   try | ||||||
|     if not AFile.Enabled then continue; |     // convert every c header file | ||||||
|     CurResult:=ConvertFile(AFile); |     for i:=0 to Project.CHeaderFileCount-1 do begin | ||||||
|     if CurResult=mrAbort then begin |       AFile:=Project.CHeaderFiles[i]; | ||||||
|       DebugLn(['TH2PasConverter.Execute aborted on file ',AFile.Filename]); |       if not AFile.Enabled then continue; | ||||||
|       exit(mrAbort); |       CurResult:=ConvertFile(AFile); | ||||||
|  |       if CurResult=mrAbort then begin | ||||||
|  |         DebugLn(['TH2PasConverter.Execute aborted on file ',AFile.Filename]); | ||||||
|  |         exit(mrAbort); | ||||||
|  |       end; | ||||||
|  |       if CurResult<>mrOK then Result:=mrCancel; | ||||||
|     end; |     end; | ||||||
|     if CurResult<>mrOK then Result:=mrCancel; |   finally | ||||||
|  |     FExecuting:=false; | ||||||
|   end; |   end; | ||||||
| end; | end; | ||||||
| 
 | 
 | ||||||
| @ -1056,7 +1101,7 @@ var | |||||||
|   OutputFilename: String; |   OutputFilename: String; | ||||||
|   TempCHeaderFilename: String; |   TempCHeaderFilename: String; | ||||||
|   InputFilename: String; |   InputFilename: String; | ||||||
|   Tool: TExternalToolOptions; |   Tool: TH2PasTool; | ||||||
| begin | begin | ||||||
|   Result:=mrCancel; |   Result:=mrCancel; | ||||||
| 
 | 
 | ||||||
| @ -1082,15 +1127,20 @@ begin | |||||||
|   // TODO: run converters for .h file to make it compatible for h2pas |   // TODO: run converters for .h file to make it compatible for h2pas | ||||||
| 
 | 
 | ||||||
|   // run h2pas |   // run h2pas | ||||||
|   Tool:=TExternalToolOptions.Create; |   Tool:=TH2PasTool.Create; | ||||||
|   try |   try | ||||||
|     Tool.Title:='h2pas'; |     Tool.Title:='h2pas'; | ||||||
|  |     Tool.H2PasFile:=AFile; | ||||||
|     Tool.Filename:=GetH2PasFilename; |     Tool.Filename:=GetH2PasFilename; | ||||||
|     Tool.CmdLineParams:=AFile.GetH2PasParameters(TempCHeaderFilename); |     Tool.CmdLineParams:=AFile.GetH2PasParameters(TempCHeaderFilename); | ||||||
|     Tool.ScanOutput:=true; |     Tool.ScanOutput:=true; | ||||||
|     Tool.ShowAllOutput:=true; |     Tool.ShowAllOutput:=true; | ||||||
|     Tool.WorkingDirectory:=Project.BaseDir; |     Tool.WorkingDirectory:=Project.BaseDir; | ||||||
|  |     Tool.OnParseLine:=@OnParseH2PasLine; | ||||||
|     DebugLn(['TH2PasConverter.ConvertFile Tool.Filename="',Tool.Filename,'" Tool.CmdLineParams="',Tool.CmdLineParams,'"']); |     DebugLn(['TH2PasConverter.ConvertFile Tool.Filename="',Tool.Filename,'" Tool.CmdLineParams="',Tool.CmdLineParams,'"']); | ||||||
|  |     Result:=LazarusIDE.RunExternalTool(Tool); | ||||||
|  |     if Result<>mrOk then exit(mrAbort); | ||||||
|  |     if FindH2PasErrorMessage>=0 then exit(mrAbort); | ||||||
|   finally |   finally | ||||||
|     Tool.Free; |     Tool.Free; | ||||||
|   end; |   end; | ||||||
| @ -1105,6 +1155,37 @@ begin | |||||||
|   Result:=FindDefaultExecutablePath(h2pasFilename); |   Result:=FindDefaultExecutablePath(h2pasFilename); | ||||||
| end; | end; | ||||||
| 
 | 
 | ||||||
|  | function TH2PasConverter.FindH2PasErrorMessage: integer; | ||||||
|  | var | ||||||
|  |   i: Integer; | ||||||
|  |   Line: TIDEMessageLine; | ||||||
|  | begin | ||||||
|  |   for i:=0 to IDEMessagesWindow.LinesCount-1 do begin | ||||||
|  |     Line:=IDEMessagesWindow.Lines[i]; | ||||||
|  |     if REMatches(Line.Msg,'^(.*)\([0-9]+\)') then begin | ||||||
|  |       Result:=i; | ||||||
|  |       exit; | ||||||
|  |     end; | ||||||
|  |   end; | ||||||
|  |   Result:=-1; | ||||||
|  | end; | ||||||
|  | 
 | ||||||
|  | function TH2PasConverter.GetH2PasErrorPostion(const Line: string; | ||||||
|  |   out aFilename: string; out LineNumber, Column: integer): boolean; | ||||||
|  | begin | ||||||
|  |   Result:=REMatches(Line,'^(.*)\(([0-9]+)\)'); | ||||||
|  |   if Result then begin | ||||||
|  |     aFilename:=REVar(1); | ||||||
|  |     LineNumber:=StrToIntDef(REVar(2),-1); | ||||||
|  |     Column:=1; | ||||||
|  |   end else begin | ||||||
|  |     aFilename:=''; | ||||||
|  |     LineNumber:=-1; | ||||||
|  |     Column:=-1; | ||||||
|  |   end; | ||||||
|  | end; | ||||||
|  | 
 | ||||||
| end. | end. | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | 
 | ||||||
|  | |||||||
| @ -7,18 +7,19 @@ object H2PasDialog: TH2PasDialog | |||||||
|   OnCreate = FormCreate |   OnCreate = FormCreate | ||||||
|   OnDestroy = FormDestroy |   OnDestroy = FormDestroy | ||||||
|   OnKeyDown = FormKeyDown |   OnKeyDown = FormKeyDown | ||||||
|   PixelsPerInch = 112 |   PixelsPerInch = 75 | ||||||
|  |   Position = poDesktopCenter | ||||||
|   HorzScrollBar.Page = 784 |   HorzScrollBar.Page = 784 | ||||||
|   VertScrollBar.Page = 500 |   VertScrollBar.Page = 500 | ||||||
|   Left = 326 |   Left = 258 | ||||||
|   Height = 501 |   Height = 501 | ||||||
|   Top = 178 |   Top = 143 | ||||||
|   Width = 785 |   Width = 785 | ||||||
|   object MainPageControl: TPageControl |   object MainPageControl: TPageControl | ||||||
|     ActivePage = h2pasOptionsTabSheet |     ActivePage = ConvertTabSheet | ||||||
|     Align = alTop |     Align = alTop | ||||||
|     Anchors = [akTop, akLeft, akRight, akBottom] |     Anchors = [akTop, akLeft, akRight, akBottom] | ||||||
|     TabIndex = 1 |     TabIndex = 2 | ||||||
|     TabOrder = 0 |     TabOrder = 0 | ||||||
|     AnchorSideBottom.Control = OpenSettingsButton |     AnchorSideBottom.Control = OpenSettingsButton | ||||||
|     Height = 465 |     Height = 465 | ||||||
| @ -117,7 +118,7 @@ object H2PasDialog: TH2PasDialog | |||||||
|         AnchorSideTop.Side = asrCenter |         AnchorSideTop.Side = asrCenter | ||||||
|         Left = 6 |         Left = 6 | ||||||
|         Height = 13 |         Height = 13 | ||||||
|         Top = 116 |         Top = 281 | ||||||
|         Width = 81 |         Width = 81 | ||||||
|       end |       end | ||||||
|       object OutputExtLabel: TLabel |       object OutputExtLabel: TLabel | ||||||
| @ -128,7 +129,7 @@ object H2PasDialog: TH2PasDialog | |||||||
|         AnchorSideTop.Side = asrCenter |         AnchorSideTop.Side = asrCenter | ||||||
|         Left = 6 |         Left = 6 | ||||||
|         Height = 13 |         Height = 13 | ||||||
|         Top = 301 |         Top = 313 | ||||||
|         Width = 86 |         Width = 86 | ||||||
|       end |       end | ||||||
|       object OutputDirLabel: TLabel |       object OutputDirLabel: TLabel | ||||||
| @ -139,161 +140,42 @@ object H2PasDialog: TH2PasDialog | |||||||
|         AnchorSideTop.Side = asrCenter |         AnchorSideTop.Side = asrCenter | ||||||
|         Left = 6 |         Left = 6 | ||||||
|         Height = 13 |         Height = 13 | ||||||
|         Top = 330 |         Top = 342 | ||||||
|         Width = 85 |         Width = 85 | ||||||
|       end |       end | ||||||
|       object UseExternalCheckBox: TCheckBox |  | ||||||
|         Caption = 'UseExternalCheckBox' |  | ||||||
|         OnChange = UseExternalCheckBoxChange |  | ||||||
|         TabOrder = 0 |  | ||||||
|         Left = 6 |  | ||||||
|         Height = 20 |  | ||||||
|         Top = 7 |  | ||||||
|         Width = 150 |  | ||||||
|       end |  | ||||||
|       object UseExternalLibnameCheckBox: TCheckBox |  | ||||||
|         BorderSpacing.Top = 6 |  | ||||||
|         Caption = 'UseExternalLibnameCheckBox' |  | ||||||
|         OnChange = UseExternalLibnameCheckBoxChange |  | ||||||
|         TabOrder = 1 |  | ||||||
|         AnchorSideTop.Control = UseExternalCheckBox |  | ||||||
|         AnchorSideTop.Side = asrBottom |  | ||||||
|         Left = 6 |  | ||||||
|         Height = 20 |  | ||||||
|         Top = 33 |  | ||||||
|         Width = 197 |  | ||||||
|       end |  | ||||||
|       object ConstantsInsteadOfEnumsCheckBox: TCheckBox |  | ||||||
|         BorderSpacing.Top = 6 |  | ||||||
|         Caption = 'ConstantsInsteadOfEnumsCheckBox' |  | ||||||
|         OnChange = ConstantsInsteadOfEnumsCheckBoxChange |  | ||||||
|         TabOrder = 2 |  | ||||||
|         AnchorSideTop.Control = UseExternalLibnameCheckBox |  | ||||||
|         AnchorSideTop.Side = asrBottom |  | ||||||
|         Left = 6 |  | ||||||
|         Height = 20 |  | ||||||
|         Top = 59 |  | ||||||
|         Width = 229 |  | ||||||
|       end |  | ||||||
|       object IncludeFileCheckBox: TCheckBox |  | ||||||
|         BorderSpacing.Top = 6 |  | ||||||
|         Caption = 'IncludeFileCheckBox' |  | ||||||
|         OnChange = IncludeFileCheckBoxChange |  | ||||||
|         TabOrder = 3 |  | ||||||
|         AnchorSideTop.Control = ConstantsInsteadOfEnumsCheckBox |  | ||||||
|         AnchorSideTop.Side = asrBottom |  | ||||||
|         Left = 6 |  | ||||||
|         Height = 20 |  | ||||||
|         Top = 85 |  | ||||||
|         Width = 146 |  | ||||||
|       end |  | ||||||
|       object LibnameEdit: TEdit |       object LibnameEdit: TEdit | ||||||
|         BorderSpacing.Left = 6 |         BorderSpacing.Left = 6 | ||||||
|         BorderSpacing.Top = 6 |         BorderSpacing.Top = 6 | ||||||
|         OnEditingDone = LibnameEditEditingDone |         OnEditingDone = LibnameEditEditingDone | ||||||
|         TabOrder = 4 |         TabOrder = 0 | ||||||
|         Text = 'LibnameEdit' |         Text = 'LibnameEdit' | ||||||
|         AnchorSideLeft.Control = LibNameLabel |         AnchorSideLeft.Control = LibNameLabel | ||||||
|         AnchorSideLeft.Side = asrBottom |         AnchorSideLeft.Side = asrBottom | ||||||
|         AnchorSideTop.Control = IncludeFileCheckBox |  | ||||||
|         AnchorSideTop.Side = asrBottom |         AnchorSideTop.Side = asrBottom | ||||||
|         Left = 93 |         Left = 93 | ||||||
|         Height = 23 |         Height = 23 | ||||||
|         Top = 111 |         Top = 276 | ||||||
|         Width = 113 |         Width = 113 | ||||||
|       end |       end | ||||||
|       object PforPointersCheckBox: TCheckBox |  | ||||||
|         BorderSpacing.Top = 6 |  | ||||||
|         Caption = 'PforPointersCheckBox' |  | ||||||
|         OnChange = PforPointersCheckBoxChange |  | ||||||
|         TabOrder = 5 |  | ||||||
|         AnchorSideTop.Control = LibnameEdit |  | ||||||
|         AnchorSideTop.Side = asrBottom |  | ||||||
|         Left = 6 |  | ||||||
|         Height = 20 |  | ||||||
|         Top = 140 |  | ||||||
|         Width = 151 |  | ||||||
|       end |  | ||||||
|       object StripCommentsCheckBox: TCheckBox |  | ||||||
|         BorderSpacing.Top = 6 |  | ||||||
|         Caption = 'StripCommentsCheckBox' |  | ||||||
|         OnChange = StripCommentsCheckBoxChange |  | ||||||
|         TabOrder = 6 |  | ||||||
|         AnchorSideTop.Control = PforPointersCheckBox |  | ||||||
|         AnchorSideTop.Side = asrBottom |  | ||||||
|         Left = 6 |  | ||||||
|         Height = 20 |  | ||||||
|         Top = 166 |  | ||||||
|         Width = 166 |  | ||||||
|       end |  | ||||||
|       object TforTypedefsCheckBox: TCheckBox |  | ||||||
|         BorderSpacing.Top = 6 |  | ||||||
|         Caption = 'TforTypedefsCheckBox' |  | ||||||
|         OnChange = TforTypedefsCheckBoxChange |  | ||||||
|         TabOrder = 7 |  | ||||||
|         AnchorSideTop.Control = StripCommentsCheckBox |  | ||||||
|         AnchorSideTop.Side = asrBottom |  | ||||||
|         Left = 6 |  | ||||||
|         Height = 20 |  | ||||||
|         Top = 192 |  | ||||||
|         Width = 156 |  | ||||||
|       end |  | ||||||
|       object VarParamsCheckBox: TCheckBox |  | ||||||
|         BorderSpacing.Top = 6 |  | ||||||
|         Caption = 'VarParamsCheckBox' |  | ||||||
|         OnChange = VarParamsCheckBoxChange |  | ||||||
|         TabOrder = 8 |  | ||||||
|         AnchorSideTop.Control = TforTypedefsCheckBox |  | ||||||
|         AnchorSideTop.Side = asrBottom |  | ||||||
|         Left = 6 |  | ||||||
|         Height = 20 |  | ||||||
|         Top = 218 |  | ||||||
|         Width = 145 |  | ||||||
|       end |  | ||||||
|       object Win32HeaderCheckBox: TCheckBox |  | ||||||
|         BorderSpacing.Top = 6 |  | ||||||
|         Caption = 'Win32HeaderCheckBox' |  | ||||||
|         OnChange = Win32HeaderCheckBoxChange |  | ||||||
|         TabOrder = 9 |  | ||||||
|         AnchorSideTop.Control = VarParamsCheckBox |  | ||||||
|         AnchorSideTop.Side = asrBottom |  | ||||||
|         Left = 6 |  | ||||||
|         Height = 20 |  | ||||||
|         Top = 244 |  | ||||||
|         Width = 160 |  | ||||||
|       end |  | ||||||
|       object PalmOSSYSTrapCheckBox: TCheckBox |  | ||||||
|         BorderSpacing.Top = 6 |  | ||||||
|         Caption = 'PalmOSSYSTrapCheckBox' |  | ||||||
|         OnChange = PalmOSSYSTrapCheckBoxChange |  | ||||||
|         TabOrder = 10 |  | ||||||
|         AnchorSideTop.Control = Win32HeaderCheckBox |  | ||||||
|         AnchorSideTop.Side = asrBottom |  | ||||||
|         Left = 6 |  | ||||||
|         Height = 20 |  | ||||||
|         Top = 270 |  | ||||||
|         Width = 179 |  | ||||||
|       end |  | ||||||
|       object OutputExtEdit: TEdit |       object OutputExtEdit: TEdit | ||||||
|         BorderSpacing.Left = 6 |         BorderSpacing.Left = 6 | ||||||
|         BorderSpacing.Top = 6 |         BorderSpacing.Top = 6 | ||||||
|         OnEditingDone = OutputExtEditEditingDone |         OnEditingDone = OutputExtEditEditingDone | ||||||
|         TabOrder = 11 |         TabOrder = 1 | ||||||
|         Text = 'OutputExtEdit' |         Text = 'OutputExtEdit' | ||||||
|         AnchorSideLeft.Control = OutputExtLabel |         AnchorSideLeft.Control = OutputExtLabel | ||||||
|         AnchorSideLeft.Side = asrBottom |         AnchorSideLeft.Side = asrBottom | ||||||
|         AnchorSideTop.Control = PalmOSSYSTrapCheckBox |  | ||||||
|         AnchorSideTop.Side = asrBottom |         AnchorSideTop.Side = asrBottom | ||||||
|         Left = 98 |         Left = 98 | ||||||
|         Height = 23 |         Height = 23 | ||||||
|         Top = 296 |         Top = 308 | ||||||
|         Width = 80 |         Width = 80 | ||||||
|       end |       end | ||||||
|       object OutputDirEdit: TEdit |       object OutputDirEdit: TEdit | ||||||
|         BorderSpacing.Left = 6 |         BorderSpacing.Left = 6 | ||||||
|         BorderSpacing.Top = 6 |         BorderSpacing.Top = 6 | ||||||
|         OnEditingDone = OutputDirEditEditingDone |         OnEditingDone = OutputDirEditEditingDone | ||||||
|         TabOrder = 12 |         TabOrder = 2 | ||||||
|         Text = 'OutputDirEdit' |         Text = 'OutputDirEdit' | ||||||
|         AnchorSideLeft.Control = OutputDirLabel |         AnchorSideLeft.Control = OutputDirLabel | ||||||
|         AnchorSideLeft.Side = asrBottom |         AnchorSideLeft.Side = asrBottom | ||||||
| @ -301,7 +183,7 @@ object H2PasDialog: TH2PasDialog | |||||||
|         AnchorSideTop.Side = asrBottom |         AnchorSideTop.Side = asrBottom | ||||||
|         Left = 97 |         Left = 97 | ||||||
|         Height = 23 |         Height = 23 | ||||||
|         Top = 325 |         Top = 337 | ||||||
|         Width = 397 |         Width = 397 | ||||||
|       end |       end | ||||||
|       object OutputDirBrowseButton: TButton |       object OutputDirBrowseButton: TButton | ||||||
| @ -309,7 +191,7 @@ object H2PasDialog: TH2PasDialog | |||||||
|         BorderSpacing.InnerBorder = 4 |         BorderSpacing.InnerBorder = 4 | ||||||
|         Caption = '...' |         Caption = '...' | ||||||
|         OnClick = OutputDirBrowseButtonClick |         OnClick = OutputDirBrowseButtonClick | ||||||
|         TabOrder = 13 |         TabOrder = 3 | ||||||
|         AnchorSideLeft.Control = OutputDirEdit |         AnchorSideLeft.Control = OutputDirEdit | ||||||
|         AnchorSideLeft.Side = asrBottom |         AnchorSideLeft.Side = asrBottom | ||||||
|         AnchorSideTop.Control = OutputDirEdit |         AnchorSideTop.Control = OutputDirEdit | ||||||
| @ -317,9 +199,405 @@ object H2PasDialog: TH2PasDialog | |||||||
|         AnchorSideBottom.Side = asrBottom |         AnchorSideBottom.Side = asrBottom | ||||||
|         Left = 494 |         Left = 494 | ||||||
|         Height = 23 |         Height = 23 | ||||||
|         Top = 325 |         Top = 337 | ||||||
|         Width = 32 |         Width = 32 | ||||||
|       end |       end | ||||||
|  |       object h2pasOptionsCheckGroup: TCheckGroup | ||||||
|  |         AutoFill = True | ||||||
|  |         Caption = 'h2pasOptionsCheckGroup' | ||||||
|  |         ChildSizing.LeftRightSpacing = 6 | ||||||
|  |         ChildSizing.TopBottomSpacing = 6 | ||||||
|  |         ChildSizing.EnlargeHorizontal = crsHomogenousChildResize | ||||||
|  |         ChildSizing.EnlargeVertical = crsHomogenousChildResize | ||||||
|  |         ChildSizing.ShrinkHorizontal = crsScaleChilds | ||||||
|  |         ChildSizing.ShrinkVertical = crsScaleChilds | ||||||
|  |         ChildSizing.Layout = cclLeftToRightThenTopToBottom | ||||||
|  |         ChildSizing.ControlsPerLine = 2 | ||||||
|  |         Columns = 2 | ||||||
|  |         OnItemClick = h2pasOptionsCheckGroupItemClick | ||||||
|  |         TabOrder = 4 | ||||||
|  |         Left = 6 | ||||||
|  |         Height = 264 | ||||||
|  |         Top = 4 | ||||||
|  |         Width = 768 | ||||||
|  |       end | ||||||
|  |     end | ||||||
|  |     object ConvertTabSheet: TTabSheet | ||||||
|  |       Caption = 'ConvertTabSheet' | ||||||
|  |       ClientHeight = 435 | ||||||
|  |       ClientWidth = 781 | ||||||
|  |       Left = 2 | ||||||
|  |       Height = 435 | ||||||
|  |       Top = 28 | ||||||
|  |       Width = 781 | ||||||
|  |       object ConvertButton: TButton | ||||||
|  |         AutoSize = True | ||||||
|  |         BorderSpacing.InnerBorder = 4 | ||||||
|  |         Caption = 'ConvertButton' | ||||||
|  |         OnClick = ConvertButtonClick | ||||||
|  |         TabOrder = 0 | ||||||
|  |         Left = 14 | ||||||
|  |         Height = 26 | ||||||
|  |         Top = 12 | ||||||
|  |         Width = 93 | ||||||
|  |       end | ||||||
|  |       object ConvertErrorGroupBox: TGroupBox | ||||||
|  |         Anchors = [akTop, akLeft, akRight] | ||||||
|  |         Caption = 'ConvertErrorGroupBox' | ||||||
|  |         ClientHeight = 130 | ||||||
|  |         ClientWidth = 764 | ||||||
|  |         TabOrder = 1 | ||||||
|  |         Left = 6 | ||||||
|  |         Height = 147 | ||||||
|  |         Top = 52 | ||||||
|  |         Width = 768 | ||||||
|  |         object ConvertErrorSynEdit: TSynEdit | ||||||
|  |           Align = alClient | ||||||
|  |           Font.Height = -12 | ||||||
|  |           Font.Name = 'courier' | ||||||
|  |           Height = 130 | ||||||
|  |           Name = 'ConvertErrorSynEdit' | ||||||
|  |           ParentColor = False | ||||||
|  |           TabOrder = 0 | ||||||
|  |           Width = 764 | ||||||
|  |           BookMarkOptions.Xoffset = 30 | ||||||
|  |           BookMarkOptions.OnChange = nil | ||||||
|  |           Gutter.ShowLineNumbers = True | ||||||
|  |           Gutter.OnChange = nil | ||||||
|  |           Gutter.CodeFoldingWidth = 14 | ||||||
|  |           Highlighter = SynCppSyn1 | ||||||
|  |           Keystrokes = <           | ||||||
|  |             item | ||||||
|  |               Command = 3 | ||||||
|  |               ShortCut = 38 | ||||||
|  |             end           | ||||||
|  |             item | ||||||
|  |               Command = 103 | ||||||
|  |               ShortCut = 8230 | ||||||
|  |             end           | ||||||
|  |             item | ||||||
|  |               Command = 211 | ||||||
|  |               ShortCut = 16422 | ||||||
|  |             end           | ||||||
|  |             item | ||||||
|  |               Command = 4 | ||||||
|  |               ShortCut = 40 | ||||||
|  |             end           | ||||||
|  |             item | ||||||
|  |               Command = 104 | ||||||
|  |               ShortCut = 8232 | ||||||
|  |             end           | ||||||
|  |             item | ||||||
|  |               Command = 212 | ||||||
|  |               ShortCut = 16424 | ||||||
|  |             end           | ||||||
|  |             item | ||||||
|  |               Command = 1 | ||||||
|  |               ShortCut = 37 | ||||||
|  |             end           | ||||||
|  |             item | ||||||
|  |               Command = 101 | ||||||
|  |               ShortCut = 8229 | ||||||
|  |             end           | ||||||
|  |             item | ||||||
|  |               Command = 5 | ||||||
|  |               ShortCut = 16421 | ||||||
|  |             end           | ||||||
|  |             item | ||||||
|  |               Command = 105 | ||||||
|  |               ShortCut = 24613 | ||||||
|  |             end           | ||||||
|  |             item | ||||||
|  |               Command = 2 | ||||||
|  |               ShortCut = 39 | ||||||
|  |             end           | ||||||
|  |             item | ||||||
|  |               Command = 102 | ||||||
|  |               ShortCut = 8231 | ||||||
|  |             end           | ||||||
|  |             item | ||||||
|  |               Command = 6 | ||||||
|  |               ShortCut = 16423 | ||||||
|  |             end           | ||||||
|  |             item | ||||||
|  |               Command = 106 | ||||||
|  |               ShortCut = 24615 | ||||||
|  |             end           | ||||||
|  |             item | ||||||
|  |               Command = 10 | ||||||
|  |               ShortCut = 34 | ||||||
|  |             end           | ||||||
|  |             item | ||||||
|  |               Command = 110 | ||||||
|  |               ShortCut = 8226 | ||||||
|  |             end           | ||||||
|  |             item | ||||||
|  |               Command = 14 | ||||||
|  |               ShortCut = 16418 | ||||||
|  |             end           | ||||||
|  |             item | ||||||
|  |               Command = 114 | ||||||
|  |               ShortCut = 24610 | ||||||
|  |             end           | ||||||
|  |             item | ||||||
|  |               Command = 9 | ||||||
|  |               ShortCut = 33 | ||||||
|  |             end           | ||||||
|  |             item | ||||||
|  |               Command = 109 | ||||||
|  |               ShortCut = 8225 | ||||||
|  |             end           | ||||||
|  |             item | ||||||
|  |               Command = 13 | ||||||
|  |               ShortCut = 16417 | ||||||
|  |             end           | ||||||
|  |             item | ||||||
|  |               Command = 113 | ||||||
|  |               ShortCut = 24609 | ||||||
|  |             end           | ||||||
|  |             item | ||||||
|  |               Command = 7 | ||||||
|  |               ShortCut = 36 | ||||||
|  |             end           | ||||||
|  |             item | ||||||
|  |               Command = 107 | ||||||
|  |               ShortCut = 8228 | ||||||
|  |             end           | ||||||
|  |             item | ||||||
|  |               Command = 15 | ||||||
|  |               ShortCut = 16420 | ||||||
|  |             end           | ||||||
|  |             item | ||||||
|  |               Command = 115 | ||||||
|  |               ShortCut = 24612 | ||||||
|  |             end           | ||||||
|  |             item | ||||||
|  |               Command = 8 | ||||||
|  |               ShortCut = 35 | ||||||
|  |             end           | ||||||
|  |             item | ||||||
|  |               Command = 108 | ||||||
|  |               ShortCut = 8227 | ||||||
|  |             end           | ||||||
|  |             item | ||||||
|  |               Command = 16 | ||||||
|  |               ShortCut = 16419 | ||||||
|  |             end           | ||||||
|  |             item | ||||||
|  |               Command = 116 | ||||||
|  |               ShortCut = 24611 | ||||||
|  |             end           | ||||||
|  |             item | ||||||
|  |               Command = 223 | ||||||
|  |               ShortCut = 45 | ||||||
|  |             end           | ||||||
|  |             item | ||||||
|  |               Command = 201 | ||||||
|  |               ShortCut = 16429 | ||||||
|  |             end           | ||||||
|  |             item | ||||||
|  |               Command = 604 | ||||||
|  |               ShortCut = 8237 | ||||||
|  |             end           | ||||||
|  |             item | ||||||
|  |               Command = 502 | ||||||
|  |               ShortCut = 46 | ||||||
|  |             end           | ||||||
|  |             item | ||||||
|  |               Command = 603 | ||||||
|  |               ShortCut = 8238 | ||||||
|  |             end           | ||||||
|  |             item | ||||||
|  |               Command = 501 | ||||||
|  |               ShortCut = 8 | ||||||
|  |             end           | ||||||
|  |             item | ||||||
|  |               Command = 501 | ||||||
|  |               ShortCut = 8200 | ||||||
|  |             end           | ||||||
|  |             item | ||||||
|  |               Command = 504 | ||||||
|  |               ShortCut = 16392 | ||||||
|  |             end           | ||||||
|  |             item | ||||||
|  |               Command = 601 | ||||||
|  |               ShortCut = 32776 | ||||||
|  |             end           | ||||||
|  |             item | ||||||
|  |               Command = 602 | ||||||
|  |               ShortCut = 40968 | ||||||
|  |             end           | ||||||
|  |             item | ||||||
|  |               Command = 509 | ||||||
|  |               ShortCut = 13 | ||||||
|  |             end           | ||||||
|  |             item | ||||||
|  |               Command = 199 | ||||||
|  |               ShortCut = 16449 | ||||||
|  |             end           | ||||||
|  |             item | ||||||
|  |               Command = 201 | ||||||
|  |               ShortCut = 16451 | ||||||
|  |             end           | ||||||
|  |             item | ||||||
|  |               Command = 610 | ||||||
|  |               ShortCut = 24649 | ||||||
|  |             end           | ||||||
|  |             item | ||||||
|  |               Command = 509 | ||||||
|  |               ShortCut = 16461 | ||||||
|  |             end           | ||||||
|  |             item | ||||||
|  |               Command = 510 | ||||||
|  |               ShortCut = 16462 | ||||||
|  |             end           | ||||||
|  |             item | ||||||
|  |               Command = 503 | ||||||
|  |               ShortCut = 16468 | ||||||
|  |             end           | ||||||
|  |             item | ||||||
|  |               Command = 611 | ||||||
|  |               ShortCut = 24661 | ||||||
|  |             end           | ||||||
|  |             item | ||||||
|  |               Command = 604 | ||||||
|  |               ShortCut = 16470 | ||||||
|  |             end           | ||||||
|  |             item | ||||||
|  |               Command = 603 | ||||||
|  |               ShortCut = 16472 | ||||||
|  |             end           | ||||||
|  |             item | ||||||
|  |               Command = 507 | ||||||
|  |               ShortCut = 16473 | ||||||
|  |             end           | ||||||
|  |             item | ||||||
|  |               Command = 506 | ||||||
|  |               ShortCut = 24665 | ||||||
|  |             end           | ||||||
|  |             item | ||||||
|  |               Command = 601 | ||||||
|  |               ShortCut = 16474 | ||||||
|  |             end           | ||||||
|  |             item | ||||||
|  |               Command = 602 | ||||||
|  |               ShortCut = 24666 | ||||||
|  |             end           | ||||||
|  |             item | ||||||
|  |               Command = 301 | ||||||
|  |               ShortCut = 16432 | ||||||
|  |             end           | ||||||
|  |             item | ||||||
|  |               Command = 302 | ||||||
|  |               ShortCut = 16433 | ||||||
|  |             end           | ||||||
|  |             item | ||||||
|  |               Command = 303 | ||||||
|  |               ShortCut = 16434 | ||||||
|  |             end           | ||||||
|  |             item | ||||||
|  |               Command = 304 | ||||||
|  |               ShortCut = 16435 | ||||||
|  |             end           | ||||||
|  |             item | ||||||
|  |               Command = 305 | ||||||
|  |               ShortCut = 16436 | ||||||
|  |             end           | ||||||
|  |             item | ||||||
|  |               Command = 306 | ||||||
|  |               ShortCut = 16437 | ||||||
|  |             end           | ||||||
|  |             item | ||||||
|  |               Command = 307 | ||||||
|  |               ShortCut = 16438 | ||||||
|  |             end           | ||||||
|  |             item | ||||||
|  |               Command = 308 | ||||||
|  |               ShortCut = 16439 | ||||||
|  |             end           | ||||||
|  |             item | ||||||
|  |               Command = 309 | ||||||
|  |               ShortCut = 16440 | ||||||
|  |             end           | ||||||
|  |             item | ||||||
|  |               Command = 310 | ||||||
|  |               ShortCut = 16441 | ||||||
|  |             end           | ||||||
|  |             item | ||||||
|  |               Command = 351 | ||||||
|  |               ShortCut = 24624 | ||||||
|  |             end           | ||||||
|  |             item | ||||||
|  |               Command = 352 | ||||||
|  |               ShortCut = 24625 | ||||||
|  |             end           | ||||||
|  |             item | ||||||
|  |               Command = 353 | ||||||
|  |               ShortCut = 24626 | ||||||
|  |             end           | ||||||
|  |             item | ||||||
|  |               Command = 354 | ||||||
|  |               ShortCut = 24627 | ||||||
|  |             end           | ||||||
|  |             item | ||||||
|  |               Command = 355 | ||||||
|  |               ShortCut = 24628 | ||||||
|  |             end           | ||||||
|  |             item | ||||||
|  |               Command = 356 | ||||||
|  |               ShortCut = 24629 | ||||||
|  |             end           | ||||||
|  |             item | ||||||
|  |               Command = 357 | ||||||
|  |               ShortCut = 24630 | ||||||
|  |             end           | ||||||
|  |             item | ||||||
|  |               Command = 358 | ||||||
|  |               ShortCut = 24631 | ||||||
|  |             end           | ||||||
|  |             item | ||||||
|  |               Command = 359 | ||||||
|  |               ShortCut = 24632 | ||||||
|  |             end           | ||||||
|  |             item | ||||||
|  |               Command = 360 | ||||||
|  |               ShortCut = 24633 | ||||||
|  |             end           | ||||||
|  |             item | ||||||
|  |               Command = 231 | ||||||
|  |               ShortCut = 24654 | ||||||
|  |             end           | ||||||
|  |             item | ||||||
|  |               Command = 232 | ||||||
|  |               ShortCut = 24643 | ||||||
|  |             end           | ||||||
|  |             item | ||||||
|  |               Command = 233 | ||||||
|  |               ShortCut = 24652 | ||||||
|  |             end           | ||||||
|  |             item | ||||||
|  |               Command = 612 | ||||||
|  |               ShortCut = 9 | ||||||
|  |             end           | ||||||
|  |             item | ||||||
|  |               Command = 613 | ||||||
|  |               ShortCut = 8201 | ||||||
|  |             end           | ||||||
|  |             item | ||||||
|  |               Command = 250 | ||||||
|  |               ShortCut = 24642 | ||||||
|  |             end> | ||||||
|  |           Lines.Strings = ( | ||||||
|  |             'ConvertErrorSynEdit' | ||||||
|  |           ) | ||||||
|  |           Options = [eoAutoIndent, eoDragDropEditing, eoGroupUndo, eoShowScrollHint, eoShowSpecialChars, eoSmartTabDelete, eoSmartTabs, eoTabsToSpaces, eoTrimTrailingSpaces, eoBracketHighlight] | ||||||
|  |           ReadOnly = True | ||||||
|  |           SelectedColor.OnChange = nil | ||||||
|  |           Cursor = crIBeam | ||||||
|  |           Height = 130 | ||||||
|  |           Width = 764 | ||||||
|  |         end | ||||||
|  |       end | ||||||
|     end |     end | ||||||
|     object SettingsTabSheet: TTabSheet |     object SettingsTabSheet: TTabSheet | ||||||
|       Caption = 'SettingsTabSheet' |       Caption = 'SettingsTabSheet' | ||||||
| @ -347,7 +625,7 @@ object H2PasDialog: TH2PasDialog | |||||||
|         Left = 6 |         Left = 6 | ||||||
|         Height = 20 |         Height = 20 | ||||||
|         Top = 42 |         Top = 42 | ||||||
|         Width = 219 |         Width = 216 | ||||||
|       end |       end | ||||||
|       object SaveSettingsAsButton: TButton |       object SaveSettingsAsButton: TButton | ||||||
|         AutoSize = True |         AutoSize = True | ||||||
| @ -389,6 +667,17 @@ object H2PasDialog: TH2PasDialog | |||||||
|         Top = 4 |         Top = 4 | ||||||
|         Width = 35 |         Width = 35 | ||||||
|       end |       end | ||||||
|  |       object NewSettingsButton: TButton | ||||||
|  |         AutoSize = True | ||||||
|  |         BorderSpacing.InnerBorder = 4 | ||||||
|  |         Caption = 'NewSettingsButton' | ||||||
|  |         OnClick = NewSettingsButtonClick | ||||||
|  |         TabOrder = 4 | ||||||
|  |         Left = 6 | ||||||
|  |         Height = 26 | ||||||
|  |         Top = 124 | ||||||
|  |         Width = 118 | ||||||
|  |       end | ||||||
|     end |     end | ||||||
|   end |   end | ||||||
|   object OpenSettingsButton: TButton |   object OpenSettingsButton: TButton | ||||||
| @ -441,4 +730,10 @@ object H2PasDialog: TH2PasDialog | |||||||
|     Top = 470 |     Top = 470 | ||||||
|     Width = 81 |     Width = 81 | ||||||
|   end |   end | ||||||
|  |   object SynCppSyn1: TSynCppSyn | ||||||
|  |     DefaultFilter = 'C++-Quelltexte (*.c,*.cpp,*.h,*.hpp,*.hh)|*.c;*.cpp;*.h;*.hpp;*.hh' | ||||||
|  |     Enabled = False | ||||||
|  |     left = 174 | ||||||
|  |     top = 92 | ||||||
|  |   end | ||||||
| end | end | ||||||
|  | |||||||
| @ -83,49 +83,107 @@ LazarusResources.Add('TH2PasDialog','FORMDATA',[ | |||||||
|   +'ClientWidth'#3#13#3#4'Left'#2#2#6'Height'#3#179#1#3'Top'#2#28#5'Width'#3#13 |   +'ClientWidth'#3#13#3#4'Left'#2#2#6'Height'#3#179#1#3'Top'#2#28#5'Width'#3#13 | ||||||
|   +#3#0#7'TButton'#13'ConvertButton'#8'AutoSize'#9#25'BorderSpacing.InnerBorder' |   +#3#0#7'TButton'#13'ConvertButton'#8'AutoSize'#9#25'BorderSpacing.InnerBorder' | ||||||
|   +#2#4#7'Caption'#6#13'ConvertButton'#7'OnClick'#7#18'ConvertButtonClick'#8'Ta' |   +#2#4#7'Caption'#6#13'ConvertButton'#7'OnClick'#7#18'ConvertButtonClick'#8'Ta' | ||||||
|   +'bOrder'#2#0#4'Left'#2#14#6'Height'#2#26#3'Top'#2#12#5'Width'#2']'#0#0#0#9'T' |   +'bOrder'#2#0#4'Left'#2#14#6'Height'#2#26#3'Top'#2#12#5'Width'#2']'#0#0#9'TGr' | ||||||
|   +'TabSheet'#16'SettingsTabSheet'#7'Caption'#6#16'SettingsTabSheet'#12'ClientH' |   +'oupBox'#20'ConvertErrorGroupBox'#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight' | ||||||
|   +'eight'#3#179#1#11'ClientWidth'#3#13#3#4'Left'#2#2#6'Height'#3#179#1#3'Top'#2 |   +#0#7'Caption'#6#20'ConvertErrorGroupBox'#12'ClientHeight'#3#130#0#11'ClientW' | ||||||
|   +#28#5'Width'#3#13#3#0#6'TLabel'#18'H2PasFilenameLabel'#7'Caption'#6#18'H2Pas' |   +'idth'#3#252#2#8'TabOrder'#2#1#4'Left'#2#6#6'Height'#3#147#0#3'Top'#2'4'#5'W' | ||||||
|   +'FilenameLabel'#5'Color'#7#6'clNone'#11'ParentColor'#8#21'AnchorSideTop.Cont' |   +'idth'#3#0#3#0#8'TSynEdit'#19'ConvertErrorSynEdit'#5'Align'#7#8'alClient'#11 | ||||||
|   +'rol'#7#17'H2PasFilenameEdit'#18'AnchorSideTop.Side'#7#9'asrCenter'#4'Left'#2 |   +'Font.Height'#2#244#9'Font.Name'#6#7'courier'#6'Height'#3#130#0#4'Name'#6#19 | ||||||
|   +#6#6'Height'#2#13#3'Top'#2#9#5'Width'#2'x'#0#0#9'TCheckBox'#30'OpenLastProje' |   +'ConvertErrorSynEdit'#11'ParentColor'#8#8'TabOrder'#2#0#5'Width'#3#252#2#23 | ||||||
|   +'ctOnStartCheckBox'#7'Caption'#6#30'OpenLastProjectOnStartCheckBox'#8'OnChan' |   +'BookMarkOptions.Xoffset'#2#30#24'BookMarkOptions.OnChange'#13#22'Gutter.Sho' | ||||||
|   +'ge'#7'$OpenLastProjectOnStartCheckBoxChange'#8'TabOrder'#2#0#4'Left'#2#6#6 |   +'wLineNumbers'#9#15'Gutter.OnChange'#13#23'Gutter.CodeFoldingWidth'#2#14#11 | ||||||
|   +'Height'#2#20#3'Top'#2'*'#5'Width'#3#216#0#0#0#7'TButton'#20'SaveSettingsAsB' |   +'Highlighter'#7#10'SynCppSyn1'#10'Keystrokes'#14#1#7'Command'#2#3#8'ShortCut' | ||||||
|   +'utton'#8'AutoSize'#9#25'BorderSpacing.InnerBorder'#2#4#7'Caption'#6#20'Save' |   +#2'&'#0#1#7'Command'#2'g'#8'ShortCut'#3'& '#0#1#7'Command'#3#211#0#8'ShortCu' | ||||||
|   +'SettingsAsButton'#7'OnClick'#7#25'SaveSettingsAsButtonClick'#8'TabOrder'#2#1 |   +'t'#3'&@'#0#1#7'Command'#2#4#8'ShortCut'#2'('#0#1#7'Command'#2'h'#8'ShortCut' | ||||||
|   +#4'Left'#2#6#6'Height'#2#26#3'Top'#2'R'#5'Width'#3#137#0#0#0#5'TEdit'#17'H2P' |   +#3'( '#0#1#7'Command'#3#212#0#8'ShortCut'#3'(@'#0#1#7'Command'#2#1#8'ShortCu' | ||||||
|   +'asFilenameEdit'#18'BorderSpacing.Left'#2#6#17'BorderSpacing.Top'#2#6#13'OnE' |   +'t'#2'%'#0#1#7'Command'#2'e'#8'ShortCut'#3'% '#0#1#7'Command'#2#5#8'ShortCut' | ||||||
|   +'ditingDone'#7#28'H2PasFilenameEditEditingDone'#8'TabOrder'#2#2#4'Text'#6#17 |   +#3'%@'#0#1#7'Command'#2'i'#8'ShortCut'#3'%`'#0#1#7'Command'#2#2#8'ShortCut'#2 | ||||||
|   +'H2PasFilenameEdit'#22'AnchorSideLeft.Control'#7#18'H2PasFilenameLabel'#19'A' |   +''''#0#1#7'Command'#2'f'#8'ShortCut'#3''' '#0#1#7'Command'#2#6#8'ShortCut'#3 | ||||||
|   +'nchorSideLeft.Side'#7#9'asrBottom'#4'Left'#3#132#0#6'Height'#2#23#3'Top'#2#4 |   +'''@'#0#1#7'Command'#2'j'#8'ShortCut'#3'''`'#0#1#7'Command'#2#10#8'ShortCut' | ||||||
|   +#5'Width'#3'`'#1#0#0#7'TButton'#25'h2pasFilenameBrowseButton'#7'Anchors'#11#5 |   +#2'"'#0#1#7'Command'#2'n'#8'ShortCut'#3'" '#0#1#7'Command'#2#14#8'ShortCut'#3 | ||||||
|   +'akTop'#6'akLeft'#8'akBottom'#0#25'BorderSpacing.InnerBorder'#2#4#7'Caption' |   +'"@'#0#1#7'Command'#2'r'#8'ShortCut'#3'"`'#0#1#7'Command'#2#9#8'ShortCut'#2 | ||||||
|   +#6#3'...'#7'OnClick'#7#30'h2pasFilenameBrowseButtonClick'#8'TabOrder'#2#3#22 |   +'!'#0#1#7'Command'#2'm'#8'ShortCut'#3'! '#0#1#7'Command'#2#13#8'ShortCut'#3 | ||||||
|   +'AnchorSideLeft.Control'#7#17'H2PasFilenameEdit'#19'AnchorSideLeft.Side'#7#9 |   +'!@'#0#1#7'Command'#2'q'#8'ShortCut'#3'!`'#0#1#7'Command'#2#7#8'ShortCut'#2 | ||||||
|   +'asrBottom'#21'AnchorSideTop.Control'#7#17'H2PasFilenameEdit'#24'AnchorSideB' |   +'$'#0#1#7'Command'#2'k'#8'ShortCut'#3'$ '#0#1#7'Command'#2#15#8'ShortCut'#3 | ||||||
|   +'ottom.Control'#7#17'H2PasFilenameEdit'#21'AnchorSideBottom.Side'#7#9'asrBot' |   +'$@'#0#1#7'Command'#2's'#8'ShortCut'#3'$`'#0#1#7'Command'#2#8#8'ShortCut'#2 | ||||||
|   +'tom'#4'Left'#3#228#1#6'Height'#2#23#3'Top'#2#4#5'Width'#2'#'#0#0#7'TButton' |   +'#'#0#1#7'Command'#2'l'#8'ShortCut'#3'# '#0#1#7'Command'#2#16#8'ShortCut'#3 | ||||||
|   +#17'NewSettingsButton'#8'AutoSize'#9#25'BorderSpacing.InnerBorder'#2#4#7'Cap' |   +'#@'#0#1#7'Command'#2't'#8'ShortCut'#3'#`'#0#1#7'Command'#3#223#0#8'ShortCut' | ||||||
|   +'tion'#6#17'NewSettingsButton'#7'OnClick'#7#22'NewSettingsButtonClick'#8'Tab' |   +#2'-'#0#1#7'Command'#3#201#0#8'ShortCut'#3'-@'#0#1#7'Command'#3'\'#2#8'Short' | ||||||
|   +'Order'#2#4#4'Left'#2#6#6'Height'#2#26#3'Top'#2'|'#5'Width'#2'v'#0#0#0#0#7'T' |   +'Cut'#3'- '#0#1#7'Command'#3#246#1#8'ShortCut'#2'.'#0#1#7'Command'#3'['#2#8 | ||||||
|   +'Button'#18'OpenSettingsButton'#7'Anchors'#11#6'akLeft'#8'akBottom'#0#8'Auto' |   +'ShortCut'#3'. '#0#1#7'Command'#3#245#1#8'ShortCut'#2#8#0#1#7'Command'#3#245 | ||||||
|   +'Size'#9#20'BorderSpacing.Around'#2#5#25'BorderSpacing.InnerBorder'#2#4#7'Ca' |   +#1#8'ShortCut'#3#8' '#0#1#7'Command'#3#248#1#8'ShortCut'#3#8'@'#0#1#7'Comman' | ||||||
|   +'ption'#6#18'OpenSettingsButton'#7'OnClick'#7#23'OpenSettingsButtonClick'#8 |   +'d'#3'Y'#2#8'ShortCut'#4#8#128#0#0#0#1#7'Command'#3'Z'#2#8'ShortCut'#4#8#160 | ||||||
|   +'TabOrder'#2#1#22'AnchorSideLeft.Control'#7#5'Owner'#24'AnchorSideBottom.Con' |   +#0#0#0#1#7'Command'#3#253#1#8'ShortCut'#2#13#0#1#7'Command'#3#199#0#8'ShortC' | ||||||
|   +'trol'#7#5'Owner'#21'AnchorSideBottom.Side'#7#9'asrBottom'#4'Left'#2#5#6'Hei' |   +'ut'#3'A@'#0#1#7'Command'#3#201#0#8'ShortCut'#3'C@'#0#1#7'Command'#3'b'#2#8 | ||||||
|   +'ght'#2#26#3'Top'#3#214#1#5'Width'#2'|'#0#0#7'TButton'#18'SaveSettingsButton' |   +'ShortCut'#3'I`'#0#1#7'Command'#3#253#1#8'ShortCut'#3'M@'#0#1#7'Command'#3 | ||||||
|   +#7'Anchors'#11#6'akLeft'#8'akBottom'#0#8'AutoSize'#9#20'BorderSpacing.Around' |   +#254#1#8'ShortCut'#3'N@'#0#1#7'Command'#3#247#1#8'ShortCut'#3'T@'#0#1#7'Comm' | ||||||
|   +#2#5#25'BorderSpacing.InnerBorder'#2#4#7'Caption'#6#18'SaveSettingsButton'#7 |   +'and'#3'c'#2#8'ShortCut'#3'U`'#0#1#7'Command'#3'\'#2#8'ShortCut'#3'V@'#0#1#7 | ||||||
|   +'OnClick'#7#23'SaveSettingsButtonClick'#8'TabOrder'#2#2#22'AnchorSideLeft.Co' |   +'Command'#3'['#2#8'ShortCut'#3'X@'#0#1#7'Command'#3#251#1#8'ShortCut'#3'Y@'#0 | ||||||
|   +'ntrol'#7#18'OpenSettingsButton'#19'AnchorSideLeft.Side'#7#9'asrBottom'#24'A' |   +#1#7'Command'#3#250#1#8'ShortCut'#3'Y`'#0#1#7'Command'#3'Y'#2#8'ShortCut'#3 | ||||||
|   +'nchorSideBottom.Control'#7#5'Owner'#21'AnchorSideBottom.Side'#7#9'asrBottom' |   +'Z@'#0#1#7'Command'#3'Z'#2#8'ShortCut'#3'Z`'#0#1#7'Command'#3'-'#1#8'ShortCu' | ||||||
|   +#4'Left'#3#134#0#6'Height'#2#26#3'Top'#3#214#1#5'Width'#2'z'#0#0#7'TButton' |   +'t'#3'0@'#0#1#7'Command'#3'.'#1#8'ShortCut'#3'1@'#0#1#7'Command'#3'/'#1#8'Sh' | ||||||
|   +#11'CloseButton'#7'Anchors'#11#7'akRight'#8'akBottom'#0#8'AutoSize'#9#20'Bor' |   +'ortCut'#3'2@'#0#1#7'Command'#3'0'#1#8'ShortCut'#3'3@'#0#1#7'Command'#3'1'#1 | ||||||
|   +'derSpacing.Around'#2#5#25'BorderSpacing.InnerBorder'#2#4#7'Caption'#6#11'Cl' |   +#8'ShortCut'#3'4@'#0#1#7'Command'#3'2'#1#8'ShortCut'#3'5@'#0#1#7'Command'#3 | ||||||
|   +'oseButton'#7'OnClick'#7#16'CloseButtonClick'#8'TabOrder'#2#3#23'AnchorSideR' |   +'3'#1#8'ShortCut'#3'6@'#0#1#7'Command'#3'4'#1#8'ShortCut'#3'7@'#0#1#7'Comman' | ||||||
|   +'ight.Control'#7#5'Owner'#20'AnchorSideRight.Side'#7#9'asrBottom'#24'AnchorS' |   +'d'#3'5'#1#8'ShortCut'#3'8@'#0#1#7'Command'#3'6'#1#8'ShortCut'#3'9@'#0#1#7'C' | ||||||
|   +'ideBottom.Control'#7#5'Owner'#21'AnchorSideBottom.Side'#7#9'asrBottom'#4'Le' |   +'ommand'#3'_'#1#8'ShortCut'#3'0`'#0#1#7'Command'#3'`'#1#8'ShortCut'#3'1`'#0#1 | ||||||
|   +'ft'#3#187#2#6'Height'#2#26#3'Top'#3#214#1#5'Width'#2'Q'#0#0#0 |   +#7'Command'#3'a'#1#8'ShortCut'#3'2`'#0#1#7'Command'#3'b'#1#8'ShortCut'#3'3`' | ||||||
|  |   +#0#1#7'Command'#3'c'#1#8'ShortCut'#3'4`'#0#1#7'Command'#3'd'#1#8'ShortCut'#3 | ||||||
|  |   ,'5`'#0#1#7'Command'#3'e'#1#8'ShortCut'#3'6`'#0#1#7'Command'#3'f'#1#8'ShortCu' | ||||||
|  |   +'t'#3'7`'#0#1#7'Command'#3'g'#1#8'ShortCut'#3'8`'#0#1#7'Command'#3'h'#1#8'Sh' | ||||||
|  |   +'ortCut'#3'9`'#0#1#7'Command'#3#231#0#8'ShortCut'#3'N`'#0#1#7'Command'#3#232 | ||||||
|  |   +#0#8'ShortCut'#3'C`'#0#1#7'Command'#3#233#0#8'ShortCut'#3'L`'#0#1#7'Command' | ||||||
|  |   +#3'd'#2#8'ShortCut'#2#9#0#1#7'Command'#3'e'#2#8'ShortCut'#3#9' '#0#1#7'Comma' | ||||||
|  |   +'nd'#3#250#0#8'ShortCut'#3'B`'#0#0#13'Lines.Strings'#1#6#19'ConvertErrorSynE' | ||||||
|  |   +'dit'#0#7'Options'#11#12'eoAutoIndent'#17'eoDragDropEditing'#11'eoGroupUndo' | ||||||
|  |   +#16'eoShowScrollHint'#18'eoShowSpecialChars'#16'eoSmartTabDelete'#11'eoSmart' | ||||||
|  |   +'Tabs'#14'eoTabsToSpaces'#20'eoTrimTrailingSpaces'#18'eoBracketHighlight'#0#8 | ||||||
|  |   +'ReadOnly'#9#22'SelectedColor.OnChange'#13#6'Cursor'#7#7'crIBeam'#6'Height'#3 | ||||||
|  |   +#130#0#5'Width'#3#252#2#0#0#0#0#9'TTabSheet'#16'SettingsTabSheet'#7'Caption' | ||||||
|  |   +#6#16'SettingsTabSheet'#12'ClientHeight'#3#179#1#11'ClientWidth'#3#13#3#4'Le' | ||||||
|  |   +'ft'#2#2#6'Height'#3#179#1#3'Top'#2#28#5'Width'#3#13#3#0#6'TLabel'#18'H2PasF' | ||||||
|  |   +'ilenameLabel'#7'Caption'#6#18'H2PasFilenameLabel'#5'Color'#7#6'clNone'#11'P' | ||||||
|  |   +'arentColor'#8#21'AnchorSideTop.Control'#7#17'H2PasFilenameEdit'#18'AnchorSi' | ||||||
|  |   +'deTop.Side'#7#9'asrCenter'#4'Left'#2#6#6'Height'#2#13#3'Top'#2#9#5'Width'#2 | ||||||
|  |   +'x'#0#0#9'TCheckBox'#30'OpenLastProjectOnStartCheckBox'#7'Caption'#6#30'Open' | ||||||
|  |   +'LastProjectOnStartCheckBox'#8'OnChange'#7'$OpenLastProjectOnStartCheckBoxCh' | ||||||
|  |   +'ange'#8'TabOrder'#2#0#4'Left'#2#6#6'Height'#2#20#3'Top'#2'*'#5'Width'#3#216 | ||||||
|  |   +#0#0#0#7'TButton'#20'SaveSettingsAsButton'#8'AutoSize'#9#25'BorderSpacing.In' | ||||||
|  |   +'nerBorder'#2#4#7'Caption'#6#20'SaveSettingsAsButton'#7'OnClick'#7#25'SaveSe' | ||||||
|  |   +'ttingsAsButtonClick'#8'TabOrder'#2#1#4'Left'#2#6#6'Height'#2#26#3'Top'#2'R' | ||||||
|  |   +#5'Width'#3#137#0#0#0#5'TEdit'#17'H2PasFilenameEdit'#18'BorderSpacing.Left'#2 | ||||||
|  |   +#6#17'BorderSpacing.Top'#2#6#13'OnEditingDone'#7#28'H2PasFilenameEditEditing' | ||||||
|  |   +'Done'#8'TabOrder'#2#2#4'Text'#6#17'H2PasFilenameEdit'#22'AnchorSideLeft.Con' | ||||||
|  |   +'trol'#7#18'H2PasFilenameLabel'#19'AnchorSideLeft.Side'#7#9'asrBottom'#4'Lef' | ||||||
|  |   +'t'#3#132#0#6'Height'#2#23#3'Top'#2#4#5'Width'#3'`'#1#0#0#7'TButton'#25'h2pa' | ||||||
|  |   +'sFilenameBrowseButton'#7'Anchors'#11#5'akTop'#6'akLeft'#8'akBottom'#0#25'Bo' | ||||||
|  |   +'rderSpacing.InnerBorder'#2#4#7'Caption'#6#3'...'#7'OnClick'#7#30'h2pasFilen' | ||||||
|  |   +'ameBrowseButtonClick'#8'TabOrder'#2#3#22'AnchorSideLeft.Control'#7#17'H2Pas' | ||||||
|  |   +'FilenameEdit'#19'AnchorSideLeft.Side'#7#9'asrBottom'#21'AnchorSideTop.Contr' | ||||||
|  |   +'ol'#7#17'H2PasFilenameEdit'#24'AnchorSideBottom.Control'#7#17'H2PasFilename' | ||||||
|  |   +'Edit'#21'AnchorSideBottom.Side'#7#9'asrBottom'#4'Left'#3#228#1#6'Height'#2 | ||||||
|  |   +#23#3'Top'#2#4#5'Width'#2'#'#0#0#7'TButton'#17'NewSettingsButton'#8'AutoSize' | ||||||
|  |   +#9#25'BorderSpacing.InnerBorder'#2#4#7'Caption'#6#17'NewSettingsButton'#7'On' | ||||||
|  |   +'Click'#7#22'NewSettingsButtonClick'#8'TabOrder'#2#4#4'Left'#2#6#6'Height'#2 | ||||||
|  |   +#26#3'Top'#2'|'#5'Width'#2'v'#0#0#0#0#7'TButton'#18'OpenSettingsButton'#7'An' | ||||||
|  |   +'chors'#11#6'akLeft'#8'akBottom'#0#8'AutoSize'#9#20'BorderSpacing.Around'#2#5 | ||||||
|  |   +#25'BorderSpacing.InnerBorder'#2#4#7'Caption'#6#18'OpenSettingsButton'#7'OnC' | ||||||
|  |   +'lick'#7#23'OpenSettingsButtonClick'#8'TabOrder'#2#1#22'AnchorSideLeft.Contr' | ||||||
|  |   +'ol'#7#5'Owner'#24'AnchorSideBottom.Control'#7#5'Owner'#21'AnchorSideBottom.' | ||||||
|  |   +'Side'#7#9'asrBottom'#4'Left'#2#5#6'Height'#2#26#3'Top'#3#214#1#5'Width'#2'|' | ||||||
|  |   +#0#0#7'TButton'#18'SaveSettingsButton'#7'Anchors'#11#6'akLeft'#8'akBottom'#0 | ||||||
|  |   +#8'AutoSize'#9#20'BorderSpacing.Around'#2#5#25'BorderSpacing.InnerBorder'#2#4 | ||||||
|  |   +#7'Caption'#6#18'SaveSettingsButton'#7'OnClick'#7#23'SaveSettingsButtonClick' | ||||||
|  |   +#8'TabOrder'#2#2#22'AnchorSideLeft.Control'#7#18'OpenSettingsButton'#19'Anch' | ||||||
|  |   +'orSideLeft.Side'#7#9'asrBottom'#24'AnchorSideBottom.Control'#7#5'Owner'#21 | ||||||
|  |   +'AnchorSideBottom.Side'#7#9'asrBottom'#4'Left'#3#134#0#6'Height'#2#26#3'Top' | ||||||
|  |   +#3#214#1#5'Width'#2'z'#0#0#7'TButton'#11'CloseButton'#7'Anchors'#11#7'akRigh' | ||||||
|  |   +'t'#8'akBottom'#0#8'AutoSize'#9#20'BorderSpacing.Around'#2#5#25'BorderSpacin' | ||||||
|  |   +'g.InnerBorder'#2#4#7'Caption'#6#11'CloseButton'#7'OnClick'#7#16'CloseButton' | ||||||
|  |   +'Click'#8'TabOrder'#2#3#23'AnchorSideRight.Control'#7#5'Owner'#20'AnchorSide' | ||||||
|  |   +'Right.Side'#7#9'asrBottom'#24'AnchorSideBottom.Control'#7#5'Owner'#21'Ancho' | ||||||
|  |   +'rSideBottom.Side'#7#9'asrBottom'#4'Left'#3#187#2#6'Height'#2#26#3'Top'#3#214 | ||||||
|  |   +#1#5'Width'#2'Q'#0#0#10'TSynCppSyn'#10'SynCppSyn1'#13'DefaultFilter'#6'BC++-' | ||||||
|  |   +'Quelltexte (*.c,*.cpp,*.h,*.hpp,*.hh)|*.c;*.cpp;*.h;*.hpp;*.hh'#7'Enabled'#8 | ||||||
|  |   +#4'left'#3#174#0#3'top'#2'\'#0#0#0 | ||||||
| ]); | ]); | ||||||
|  | |||||||
| @ -28,6 +28,8 @@ uses | |||||||
|   SynEdit, SynHighlighterCPP, |   SynEdit, SynHighlighterCPP, | ||||||
|   FileProcs, |   FileProcs, | ||||||
|   IDEMsgIntf, MenuIntf, IDECommands, BaseIDEIntf, IDEDialogs, LazIDEIntf, |   IDEMsgIntf, MenuIntf, IDECommands, BaseIDEIntf, IDEDialogs, LazIDEIntf, | ||||||
|  |   SrcEditorIntf, | ||||||
|  |   CodeToolManager, CodeCache, | ||||||
|   H2PasStrConsts, H2PasConvert; |   H2PasStrConsts, H2PasConvert; | ||||||
| 
 | 
 | ||||||
| type | type | ||||||
| @ -35,20 +37,13 @@ type | |||||||
|   { TH2PasDialog } |   { TH2PasDialog } | ||||||
| 
 | 
 | ||||||
|   TH2PasDialog = class(TForm) |   TH2PasDialog = class(TForm) | ||||||
|     h2pasOptionsCheckGroup: TCheckGroup; |  | ||||||
|     ConvertButton: TButton; |  | ||||||
|     NewSettingsButton: TButton; |  | ||||||
|     h2pasFilenameBrowseButton: TButton; |  | ||||||
|     H2PasFilenameEdit: TEdit; |  | ||||||
|     H2PasFilenameLabel: TLabel; |  | ||||||
|     OutputDirBrowseButton: TButton; |  | ||||||
|     MainPageControl: TPageControl; |     MainPageControl: TPageControl; | ||||||
|  |     SynCppSyn1: TSynCppSyn; | ||||||
| 
 | 
 | ||||||
|     // c header files |     // c header files | ||||||
|     FilesTabSheet: TTabSheet; |     FilesTabSheet: TTabSheet; | ||||||
|     CHeaderFilesSplitter1: TSplitter; |     CHeaderFilesSplitter1: TSplitter; | ||||||
|     AddCHeaderFilesButton: TButton; |     AddCHeaderFilesButton: TButton; | ||||||
|     ConvertTabSheet: TTabSheet; |  | ||||||
|     UnselectAllCHeaderFilesButton: TButton; |     UnselectAllCHeaderFilesButton: TButton; | ||||||
|     SelectAllCHeaderFilesButton: TButton; |     SelectAllCHeaderFilesButton: TButton; | ||||||
|     DeleteCHeaderFilesButton: TButton; |     DeleteCHeaderFilesButton: TButton; | ||||||
| @ -56,15 +51,27 @@ type | |||||||
| 
 | 
 | ||||||
|     // h2pas |     // h2pas | ||||||
|     h2pasOptionsTabSheet: TTabSheet; |     h2pasOptionsTabSheet: TTabSheet; | ||||||
|  |     h2pasOptionsCheckGroup: TCheckGroup; | ||||||
|     LibnameEdit: TEdit; |     LibnameEdit: TEdit; | ||||||
|     LibNameLabel: TLabel; |     LibNameLabel: TLabel; | ||||||
|     OutputExtEdit: TEdit; |     OutputExtEdit: TEdit; | ||||||
|     OutputExtLabel: TLabel; |     OutputExtLabel: TLabel; | ||||||
|     OutputDirEdit: TEdit; |     OutputDirEdit: TEdit; | ||||||
|     OutputDirLabel: TLabel; |     OutputDirLabel: TLabel; | ||||||
|  |     OutputDirBrowseButton: TButton; | ||||||
|  | 
 | ||||||
|  |     // convert | ||||||
|  |     ConvertTabSheet: TTabSheet; | ||||||
|  |     ConvertButton: TButton; | ||||||
|  |     ConvertErrorGroupBox: TGroupBox; | ||||||
|  |     ConvertErrorSynEdit: TSynEdit; | ||||||
| 
 | 
 | ||||||
|     // settings |     // settings | ||||||
|     SettingsTabSheet: TTabSheet; |     SettingsTabSheet: TTabSheet; | ||||||
|  |     h2pasFilenameBrowseButton: TButton; | ||||||
|  |     H2PasFilenameEdit: TEdit; | ||||||
|  |     H2PasFilenameLabel: TLabel; | ||||||
|  |     NewSettingsButton: TButton; | ||||||
|     SaveSettingsAsButton: TButton; |     SaveSettingsAsButton: TButton; | ||||||
|     OpenLastProjectOnStartCheckBox: TCheckBox; |     OpenLastProjectOnStartCheckBox: TCheckBox; | ||||||
| 
 | 
 | ||||||
| @ -106,6 +113,7 @@ type | |||||||
|     procedure UpdateProjectChanged; // show project settings |     procedure UpdateProjectChanged; // show project settings | ||||||
|     procedure UpdateCaption; |     procedure UpdateCaption; | ||||||
|     procedure ClearMessages; |     procedure ClearMessages; | ||||||
|  |     procedure UpdateHighlighter; | ||||||
| 
 | 
 | ||||||
|     // project settings |     // project settings | ||||||
|     procedure UpdateFilesPage; |     procedure UpdateFilesPage; | ||||||
| @ -122,6 +130,8 @@ type | |||||||
|     function OnIDESavedAll(Sender: TObject): TModalResult; |     function OnIDESavedAll(Sender: TObject): TModalResult; | ||||||
|   public |   public | ||||||
|     function Convert: TModalResult; |     function Convert: TModalResult; | ||||||
|  |     procedure ShowH2PasError(MsgLine: integer); | ||||||
|  |     procedure ClearError; | ||||||
| 
 | 
 | ||||||
|     function SaveSettings: TModalResult; |     function SaveSettings: TModalResult; | ||||||
|     function SaveGlobalSettings: TModalResult; |     function SaveGlobalSettings: TModalResult; | ||||||
| @ -213,6 +223,9 @@ begin | |||||||
|   FConverter:=TH2PasConverter.Create; |   FConverter:=TH2PasConverter.Create; | ||||||
|   LoadGlobalSettings; |   LoadGlobalSettings; | ||||||
|    |    | ||||||
|  |   ClearError; | ||||||
|  |   UpdateHighlighter; | ||||||
|  | 
 | ||||||
|   // create project |   // create project | ||||||
|   if Converter.AutoOpenLastProject |   if Converter.AutoOpenLastProject | ||||||
|   and FileExists(Converter.CurrentProjectFilename) then |   and FileExists(Converter.CurrentProjectFilename) then | ||||||
| @ -509,6 +522,13 @@ begin | |||||||
|   IDEMessagesWindow.Clear; |   IDEMessagesWindow.Clear; | ||||||
| end; | end; | ||||||
| 
 | 
 | ||||||
|  | procedure TH2PasDialog.UpdateHighlighter; | ||||||
|  | begin | ||||||
|  |   SourceEditorWindow.GetHighlighterSettings(SynCppSyn1); | ||||||
|  |   SourceEditorWindow.GetEditorControlSettings(ConvertErrorSynEdit); | ||||||
|  |   ConvertErrorSynEdit.Gutter.ShowLineNumbers:=true; | ||||||
|  | end; | ||||||
|  | 
 | ||||||
| procedure TH2PasDialog.UpdateFilesPage; | procedure TH2PasDialog.UpdateFilesPage; | ||||||
| var | var | ||||||
|   i: Integer; |   i: Integer; | ||||||
| @ -647,6 +667,7 @@ end; | |||||||
| function TH2PasDialog.Convert: TModalResult; | function TH2PasDialog.Convert: TModalResult; | ||||||
| begin | begin | ||||||
|   Result:=mrCancel; |   Result:=mrCancel; | ||||||
|  |   ClearError; | ||||||
|    |    | ||||||
|   if not Project.HasEnabledFiles then begin |   if not Project.HasEnabledFiles then begin | ||||||
|     IDEMessageDialog('Nothing to do', |     IDEMessageDialog('Nothing to do', | ||||||
| @ -670,6 +691,62 @@ begin | |||||||
|   LazarusIDE.SaveSourceEditorChangesToCodeCache(-1); |   LazarusIDE.SaveSourceEditorChangesToCodeCache(-1); | ||||||
|    |    | ||||||
|   Result:=Converter.Execute; |   Result:=Converter.Execute; | ||||||
|  |   if Result<>mrOk then begin | ||||||
|  |     ShowH2PasError(-1); | ||||||
|  |   end; | ||||||
|  | end; | ||||||
|  | 
 | ||||||
|  | procedure TH2PasDialog.ShowH2PasError(MsgLine: integer); | ||||||
|  | var | ||||||
|  |   Line: TIDEMessageLine; | ||||||
|  |   LineNumber: integer; | ||||||
|  |   Column: integer; | ||||||
|  |   CodeBuf: TCodeBuffer; | ||||||
|  |   NewPos: TPoint; | ||||||
|  |   Filename: string; | ||||||
|  |   s: String; | ||||||
|  | begin | ||||||
|  |   if MsgLine<0 then | ||||||
|  |     MsgLine:=Converter.FindH2PasErrorMessage; | ||||||
|  |   if (MsgLine<0) or (MsgLine>=IDEMessagesWindow.LinesCount) then begin | ||||||
|  |     ClearError; | ||||||
|  |     exit; | ||||||
|  |   end; | ||||||
|  |    | ||||||
|  |   Line:=IDEMessagesWindow.Lines[MsgLine]; | ||||||
|  |   if not Converter.GetH2PasErrorPostion(Line.Msg,Filename,LineNumber,Column) | ||||||
|  |   then exit; | ||||||
|  |   DebugLn(['TH2PasDialog.ShowH2PasError LineNumber=',LineNumber,' Column=',Column,' Filename=',Filename]); | ||||||
|  |    | ||||||
|  |   // open error position in synedit | ||||||
|  |   CodeBuf:=CodeToolBoss.LoadFile(Filename,false,false); | ||||||
|  |   if CodeBuf=nil then exit; | ||||||
|  |   ConvertErrorSynEdit.BeginUpdate; | ||||||
|  |   CodeBuf.AssignTo(ConvertErrorSynEdit.Lines,false); | ||||||
|  |   NewPos:=Point(Column,LineNumber); | ||||||
|  |   if NewPos.Y<1 then NewPos.Y:=1; | ||||||
|  |   if NewPos.X<1 then NewPos.X:=1; | ||||||
|  |   ConvertErrorSynEdit.LogicalCaretXY:=NewPos; | ||||||
|  |   ConvertErrorSynEdit.TopLine:=NewPos.Y-3; | ||||||
|  |   ConvertErrorSynEdit.EndUpdate; | ||||||
|  | 
 | ||||||
|  |   // show error position in groupbox | ||||||
|  |   s:='Error: '; | ||||||
|  |   if LineNumber>=1 then | ||||||
|  |     s:=s+IntToStr(LineNumber); | ||||||
|  |   if Column>=1 then begin | ||||||
|  |     if LineNumber>=1 then | ||||||
|  |       s:=s+','; | ||||||
|  |     s:=s+IntToStr(Column); | ||||||
|  |   end; | ||||||
|  |   s:=s+' '+Filename; | ||||||
|  |   ConvertErrorGroupBox.Caption:=s; | ||||||
|  | end; | ||||||
|  | 
 | ||||||
|  | procedure TH2PasDialog.ClearError; | ||||||
|  | begin | ||||||
|  |   ConvertErrorSynEdit.Lines.Clear; | ||||||
|  |   ConvertErrorGroupBox.Caption:='No error'; | ||||||
| end; | end; | ||||||
| 
 | 
 | ||||||
| function TH2PasDialog.SaveSettings: TModalResult; | function TH2PasDialog.SaveSettings: TModalResult; | ||||||
| @ -845,3 +922,4 @@ initialization | |||||||
| 
 | 
 | ||||||
| end. | end. | ||||||
| 
 | 
 | ||||||
|  | 
 | ||||||
|  | |||||||
| @ -45,7 +45,7 @@ type | |||||||
|     procedure Add(const Msg, CurDir: String; ProgressLine: boolean; |     procedure Add(const Msg, CurDir: String; ProgressLine: boolean; | ||||||
|                   OriginalIndex: integer); |                   OriginalIndex: integer); | ||||||
|     procedure AddMsg(const Msg, CurDir: String; OriginalIndex: integer); |     procedure AddMsg(const Msg, CurDir: String; OriginalIndex: integer); | ||||||
|     procedure AddProgress(const Msg, CurDir: String; OriginalIndex: integer); |     procedure AddProgress(Line: TIDEScanMessageLine); | ||||||
|   public |   public | ||||||
|     property Options: TCompilerOptions read FOptions write SetOptions; |     property Options: TCompilerOptions read FOptions write SetOptions; | ||||||
|     property Test: TCompilerOptionsTest read FTest; |     property Test: TCompilerOptionsTest read FTest; | ||||||
| @ -228,10 +228,9 @@ begin | |||||||
|   Add(Msg,CurDir,false,OriginalIndex); |   Add(Msg,CurDir,false,OriginalIndex); | ||||||
| end; | end; | ||||||
| 
 | 
 | ||||||
| procedure TCheckCompilerOptsDlg.AddProgress(const Msg, CurDir: String; | procedure TCheckCompilerOptsDlg.AddProgress(Line: TIDEScanMessageLine); | ||||||
|   OriginalIndex: integer); |  | ||||||
| begin | begin | ||||||
|   Add(Msg,CurDir,false,OriginalIndex); |   Add(Line.Line,Line.WorkingDirectory,false,Line.LineNumber); | ||||||
| end; | end; | ||||||
| 
 | 
 | ||||||
| initialization | initialization | ||||||
|  | |||||||
| @ -157,7 +157,7 @@ begin | |||||||
|         if OutputFilter<>nil then begin |         if OutputFilter<>nil then begin | ||||||
|           OutputFilter.Options:=[ofoSearchForFPCMessages,ofoExceptionOnError]; |           OutputFilter.Options:=[ofoSearchForFPCMessages,ofoExceptionOnError]; | ||||||
|           OutputFilter.CompilerOptions:=AProject.CompilerOptions; |           OutputFilter.CompilerOptions:=AProject.CompilerOptions; | ||||||
|           OutputFilter.Execute(TheProcess); |           OutputFilter.Execute(TheProcess,Self); | ||||||
|         end else begin |         end else begin | ||||||
|           TheProcess.Execute; |           TheProcess.Execute; | ||||||
|         end; |         end; | ||||||
| @ -185,8 +185,9 @@ end; | |||||||
| procedure TCompiler.WriteError(const Msg: string); | procedure TCompiler.WriteError(const Msg: string); | ||||||
| begin | begin | ||||||
|   DebugLn('TCompiler.WriteError ',Msg); |   DebugLn('TCompiler.WriteError ',Msg); | ||||||
|   if OutputFilter<>nil then |   if OutputFilter<>nil then begin | ||||||
|     OutputFilter.ReadLine(Msg,true); |     OutputFilter.ReadConstLine(Msg,true); | ||||||
|  |   end; | ||||||
| end; | end; | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -81,7 +81,7 @@ uses | |||||||
| type | type | ||||||
|   TPreviewEditor = TSynEdit; |   TPreviewEditor = TSynEdit; | ||||||
|   TPreviewPasSyn = TSynFreePascalSyn; |   TPreviewPasSyn = TSynFreePascalSyn; | ||||||
|                                                                                                                                                                                                                                                                                                                                                                                         TCustomSyn     = TSynCustomHighlighter; |   TCustomSyn     = TSynCustomHighlighter; | ||||||
|   TSynHighlightElement = TSynHighlighterAttributes; |   TSynHighlightElement = TSynHighlighterAttributes; | ||||||
|   TCustomSynClass = class of TCustomSyn; |   TCustomSynClass = class of TCustomSyn; | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -81,9 +81,9 @@ type | |||||||
|     function Load(Config: TConfigStorage): TModalResult; |     function Load(Config: TConfigStorage): TModalResult; | ||||||
|     function Load(Config: TConfigStorage; const Path: string): TModalResult; |     function Load(Config: TConfigStorage; const Path: string): TModalResult; | ||||||
|     procedure LoadShortCuts(KeyCommandRelationList: TKeyCommandRelationList); |     procedure LoadShortCuts(KeyCommandRelationList: TKeyCommandRelationList); | ||||||
|     function Run(ExtTool: TExternalToolOptions; |     function Run(ExtTool: TIDEExternalToolOptions; | ||||||
|                  Macros: TTransferMacroList): TModalResult; |                  Macros: TTransferMacroList): TModalResult; | ||||||
|     function Run(ExtTool: TExternalToolOptions; |     function Run(ExtTool: TIDEExternalToolOptions; | ||||||
|                  Macros: TTransferMacroList; |                  Macros: TTransferMacroList; | ||||||
|                  TheOutputFilter: TOutputFilter; |                  TheOutputFilter: TOutputFilter; | ||||||
|                  CompilerOptions: TBaseCompilerOptions): TModalResult; |                  CompilerOptions: TBaseCompilerOptions): TModalResult; | ||||||
| @ -164,6 +164,7 @@ begin | |||||||
| end; | end; | ||||||
| 
 | 
 | ||||||
| { TExternalToolList } | { TExternalToolList } | ||||||
|  | 
 | ||||||
| function TExternalToolList.GetToolOpts(Index: integer): TExternalToolOptions; | function TExternalToolList.GetToolOpts(Index: integer): TExternalToolOptions; | ||||||
| begin | begin | ||||||
|   Result:=TExternalToolOptions(inherited Items[Index]); |   Result:=TExternalToolOptions(inherited Items[Index]); | ||||||
| @ -281,7 +282,7 @@ begin | |||||||
|   end; |   end; | ||||||
| end; | end; | ||||||
| 
 | 
 | ||||||
| function TExternalToolList.Run(ExtTool: TExternalToolOptions; | function TExternalToolList.Run(ExtTool: TIDEExternalToolOptions; | ||||||
|   Macros: TTransferMacroList): TModalResult; |   Macros: TTransferMacroList): TModalResult; | ||||||
| begin | begin | ||||||
|   Result:=Run(ExtTool,Macros,nil,nil); |   Result:=Run(ExtTool,Macros,nil,nil); | ||||||
| @ -295,7 +296,7 @@ begin | |||||||
|   Run(Items[Index],Macros); |   Run(Items[Index],Macros); | ||||||
| end; | end; | ||||||
| 
 | 
 | ||||||
| function TExternalToolList.Run(ExtTool: TExternalToolOptions; | function TExternalToolList.Run(ExtTool: TIDEExternalToolOptions; | ||||||
|   Macros: TTransferMacroList; TheOutputFilter: TOutputFilter; |   Macros: TTransferMacroList; TheOutputFilter: TOutputFilter; | ||||||
|   CompilerOptions: TBaseCompilerOptions): TModalResult; |   CompilerOptions: TBaseCompilerOptions): TModalResult; | ||||||
| var WorkingDir, Filename, Params, CmdLine, Title: string; | var WorkingDir, Filename, Params, CmdLine, Title: string; | ||||||
| @ -368,8 +369,8 @@ begin | |||||||
|           try |           try | ||||||
|             Result:=mrCancel; |             Result:=mrCancel; | ||||||
|             try |             try | ||||||
|               if TheOutputFilter.Execute(TheProcess) then begin |               if TheOutputFilter.Execute(TheProcess,Self,ExtTool) then begin | ||||||
|                 TheOutputFilter.ReadLine('"'+Title+'" completed',true); |                 TheOutputFilter.ReadConstLine('"'+Title+'" completed',true); | ||||||
|               end; |               end; | ||||||
|               if TheOutputFilter.ErrorExists then begin |               if TheOutputFilter.ErrorExists then begin | ||||||
|                 ErrorOccurred:=true; |                 ErrorOccurred:=true; | ||||||
|  | |||||||
| @ -48,6 +48,20 @@ uses | |||||||
|   KeyMapping, TransferMacros, IDEProcs, LazarusIDEStrConsts; |   KeyMapping, TransferMacros, IDEProcs, LazarusIDEStrConsts; | ||||||
| 
 | 
 | ||||||
| type | type | ||||||
|  |   { TExternalToolOptions } | ||||||
|  | 
 | ||||||
|  |   TExternalToolOptions = class(TIDEExternalToolOptions) | ||||||
|  |   private | ||||||
|  |     fKey: word; | ||||||
|  |     fShift: TShiftState; | ||||||
|  |   public | ||||||
|  |     procedure Assign(Source: TPersistent); override; | ||||||
|  |     procedure Clear; override; | ||||||
|  |     // key and shift are loaded with the keymapping in the editoroptions | ||||||
|  |     property Key: word read fKey write fKey; | ||||||
|  |     property Shift: TShiftState read fShift write fShift; | ||||||
|  |   end; | ||||||
|  | 
 | ||||||
|   { |   { | ||||||
|     the editor dialog for a single external tool |     the editor dialog for a single external tool | ||||||
|   } |   } | ||||||
| @ -83,7 +97,7 @@ type | |||||||
|     procedure MacrosInsertButtonClick(Sender: TObject); |     procedure MacrosInsertButtonClick(Sender: TObject); | ||||||
|     procedure MacrosListboxClick(Sender: TObject); |     procedure MacrosListboxClick(Sender: TObject); | ||||||
|   private |   private | ||||||
|     fOptions: TExternalToolOptions;  |     fOptions: TExternalToolOptions; | ||||||
|     fTransferMacros: TTransferMacroList; |     fTransferMacros: TTransferMacroList; | ||||||
|     GrabbingKey: integer; // 0=none, 1=Default key |     GrabbingKey: integer; // 0=none, 1=Default key | ||||||
|     procedure ActivateGrabbing(AGrabbingKey: integer); |     procedure ActivateGrabbing(AGrabbingKey: integer); | ||||||
| @ -687,4 +701,26 @@ begin | |||||||
|   MacrosInsertButton.Enabled:=(MacrosListbox.ItemIndex>=0); |   MacrosInsertButton.Enabled:=(MacrosListbox.ItemIndex>=0); | ||||||
| end; | end; | ||||||
| 
 | 
 | ||||||
|  | { TExternalToolOptions } | ||||||
|  | 
 | ||||||
|  | procedure TExternalToolOptions.Assign(Source: TPersistent); | ||||||
|  | var | ||||||
|  |   Src: TExternalToolOptions; | ||||||
|  | begin | ||||||
|  |   if Source is TExternalToolOptions then begin | ||||||
|  |     Src:=TExternalToolOptions(Source); | ||||||
|  |     fKey:=Src.fKey; | ||||||
|  |     fShift:=Src.fShift; | ||||||
|  |   end else begin | ||||||
|  |     inherited Assign(Source); | ||||||
|  |   end; | ||||||
|  | end; | ||||||
|  | 
 | ||||||
|  | procedure TExternalToolOptions.Clear; | ||||||
|  | begin | ||||||
|  |   fKey:=VK_UNKNOWN; | ||||||
|  |   fShift:=[]; | ||||||
|  |   inherited Clear; | ||||||
|  | end; | ||||||
|  | 
 | ||||||
| end. | end. | ||||||
|  | |||||||
| @ -696,6 +696,7 @@ type | |||||||
| 
 | 
 | ||||||
|     // external tools |     // external tools | ||||||
|     function PrepareForCompile: TModalResult; override; |     function PrepareForCompile: TModalResult; override; | ||||||
|  |     function RunExternalTool(Tool: TIDEExternalToolOptions): TModalResult; override; | ||||||
|     function DoRunExternalTool(Index: integer): TModalResult; |     function DoRunExternalTool(Index: integer): TModalResult; | ||||||
|     function DoSaveBuildIDEConfigs(Flags: TBuildLazarusFlags): TModalResult; override; |     function DoSaveBuildIDEConfigs(Flags: TBuildLazarusFlags): TModalResult; override; | ||||||
|     function DoBuildLazarus(Flags: TBuildLazarusFlags): TModalResult; override; |     function DoBuildLazarus(Flags: TBuildLazarusFlags): TModalResult; override; | ||||||
| @ -8521,6 +8522,13 @@ begin | |||||||
|   end; |   end; | ||||||
| end; | end; | ||||||
| 
 | 
 | ||||||
|  | function TMainIDE.RunExternalTool(Tool: TIDEExternalToolOptions): TModalResult; | ||||||
|  | begin | ||||||
|  |   SourceNotebook.ClearErrorLines; | ||||||
|  |   Result:=EnvironmentOptions.ExternalTools.Run(Tool,MacroList); | ||||||
|  |   DoCheckFilesOnDisk; | ||||||
|  | end; | ||||||
|  | 
 | ||||||
| function TMainIDE.DoCheckSyntax: TModalResult; | function TMainIDE.DoCheckSyntax: TModalResult; | ||||||
| var | var | ||||||
|   ActiveUnitInfo:TUnitInfo; |   ActiveUnitInfo:TUnitInfo; | ||||||
|  | |||||||
| @ -1233,7 +1233,7 @@ function TMainIDEBase.DoCheckAmbiguousSources(const AFilename: string; | |||||||
|   begin |   begin | ||||||
|     Result:=mrOk; |     Result:=mrOk; | ||||||
|     if Compiling then begin |     if Compiling then begin | ||||||
|       TheOutputFilter.ReadLine(Format(lisWarningAmbiguousFileFoundSourceFileIs, |       TheOutputFilter.ReadConstLine(Format(lisWarningAmbiguousFileFoundSourceFileIs, | ||||||
|         ['"', AmbiguousFilename, '"', '"', AFilename, '"']), true); |         ['"', AmbiguousFilename, '"', '"', AFilename, '"']), true); | ||||||
|     end; |     end; | ||||||
|   end; |   end; | ||||||
|  | |||||||
| @ -37,28 +37,12 @@ unit MsgView; | |||||||
| interface | interface | ||||||
| 
 | 
 | ||||||
| uses | uses | ||||||
|   Classes, |   Classes, SysUtils, AVL_Tree, | ||||||
|   AVL_Tree, |   LCLProc, LResources, ClipBrd, Controls, Dialogs, FileUtil, Forms, Menus, | ||||||
|   ClipBrd, |  | ||||||
|   Controls, |  | ||||||
|   DialogProcs, |  | ||||||
|   Dialogs, |  | ||||||
|   EnvironmentOpts, |  | ||||||
|   FileUtil, |  | ||||||
|   Forms, |  | ||||||
|   IDECommands, |  | ||||||
|   IDEOptionDefs, |  | ||||||
|   IDEProcs, |  | ||||||
|   InputHistory, |  | ||||||
|   KeyMapping, |  | ||||||
|   LazarusIDEStrConsts, |  | ||||||
|   LCLProc, |  | ||||||
|   LResources, |  | ||||||
|   MenuIntf, |  | ||||||
|   IDEMsgIntf, |  | ||||||
|   Menus, |  | ||||||
|   StdCtrls, |   StdCtrls, | ||||||
|   SysUtils; |   IDEExternToolIntf, IDECommands, MenuIntf, IDEMsgIntf, | ||||||
|  |   DialogProcs, EnvironmentOpts, | ||||||
|  |   LazarusIDEStrConsts, IDEOptionDefs, IDEProcs, InputHistory, KeyMapping; | ||||||
| 
 | 
 | ||||||
| type | type | ||||||
| 
 | 
 | ||||||
| @ -128,7 +112,7 @@ type | |||||||
|     procedure Add(const Msg, CurDir: string; |     procedure Add(const Msg, CurDir: string; | ||||||
|                   ProgressLine, VisibleLine: boolean; OriginalIndex: integer); |                   ProgressLine, VisibleLine: boolean; OriginalIndex: integer); | ||||||
|     procedure AddMsg(const Msg, CurDir: string; OriginalIndex: integer); override; |     procedure AddMsg(const Msg, CurDir: string; OriginalIndex: integer); override; | ||||||
|     procedure AddProgress(const Msg, CurDir: string; OriginalIndex: integer); |     procedure AddProgress(ScanLine: TIDEScanMessageLine); | ||||||
|     procedure AddSeparator; |     procedure AddSeparator; | ||||||
|     procedure CollectLineParts(Sender: TObject; SrcLines: TIDEMessageLineList); |     procedure CollectLineParts(Sender: TObject; SrcLines: TIDEMessageLineList); | ||||||
|     procedure ClearTillLastSeparator; |     procedure ClearTillLastSeparator; | ||||||
| @ -419,10 +403,9 @@ begin | |||||||
|   Add(Msg, CurDir, False, True, OriginalIndex); |   Add(Msg, CurDir, False, True, OriginalIndex); | ||||||
| end; | end; | ||||||
| 
 | 
 | ||||||
| procedure TMessagesView.AddProgress(const Msg, CurDir: string; | procedure TMessagesView.AddProgress(ScanLine: TIDEScanMessageLine); | ||||||
|   OriginalIndex: integer); |  | ||||||
| begin | begin | ||||||
|   Add(Msg, CurDir, True, True, OriginalIndex); |   Add(ScanLine.Line, ScanLine.WorkingDirectory, True, True,ScanLine.LineNumber); | ||||||
| end; | end; | ||||||
| 
 | 
 | ||||||
| procedure TMessagesView.AddSeparator; | procedure TMessagesView.AddSeparator; | ||||||
|  | |||||||
| @ -37,11 +37,12 @@ interface | |||||||
| 
 | 
 | ||||||
| uses | uses | ||||||
|   Classes, Math, SysUtils, Forms, Controls, CompilerOptions, Project, Process, |   Classes, Math, SysUtils, Forms, Controls, CompilerOptions, Project, Process, | ||||||
|   IDEProcs, DynQueue, FileUtil, LclProc, LazConf, AsyncProcess, IDEMsgIntf; |   AsyncProcess, LCLProc, DynQueue, FileUtil, | ||||||
|  |   IDEMsgIntf, IDEExternToolIntf, | ||||||
|  |   IDEProcs, LazConf; | ||||||
| 
 | 
 | ||||||
| type | type | ||||||
|   TOnOutputString = procedure(const Msg, Directory: String; |   TOnOutputString = procedure(Line: TIDEScanMessageLine) of object; | ||||||
|                               OriginalIndex: integer) of object; |  | ||||||
|   TOnAddFilteredLine = procedure(const Msg, Directory: String; |   TOnAddFilteredLine = procedure(const Msg, Directory: String; | ||||||
|                                  OriginalIndex: integer) of object; |                                  OriginalIndex: integer) of object; | ||||||
|   TOnGetIncludePath = function(const Directory: string; |   TOnGetIncludePath = function(const Directory: string; | ||||||
| @ -87,7 +88,22 @@ type | |||||||
|   end; |   end; | ||||||
|    |    | ||||||
|   TOFOnEndReading = procedure(Sender: TObject; Lines: TIDEMessageLineList) |   TOFOnEndReading = procedure(Sender: TObject; Lines: TIDEMessageLineList) | ||||||
|                                                                       of object; |                               of object; | ||||||
|  | 
 | ||||||
|  |   TOutputFilter = class; | ||||||
|  | 
 | ||||||
|  |   { TOFScanLine } | ||||||
|  | 
 | ||||||
|  |   TOFScanLine = class(TIDEScanMessageLine) | ||||||
|  |   private | ||||||
|  |     FFilter: TOutputFilter; | ||||||
|  |   public | ||||||
|  |     constructor Create(TheFilter: TOutputFilter); | ||||||
|  |     procedure Init(const aLine, aWorkDir: string; const aLineNumber: integer); | ||||||
|  |     procedure LineChanged(const OldValue: string); override; | ||||||
|  |     procedure WorkingDirectoryChanged(const OldValue: string); override; | ||||||
|  |     property Filter: TOutputFilter read FFilter; | ||||||
|  |   end; | ||||||
| 
 | 
 | ||||||
|   { TOutputFilter } |   { TOutputFilter } | ||||||
| 
 | 
 | ||||||
| @ -95,6 +111,7 @@ type | |||||||
|   private |   private | ||||||
|     FAsyncDataAvailable: boolean; |     FAsyncDataAvailable: boolean; | ||||||
|     FAsyncProcessTerminated: boolean; |     FAsyncProcessTerminated: boolean; | ||||||
|  |     FCaller: TObject; | ||||||
|     FCompilerOptions: TBaseCompilerOptions; |     FCompilerOptions: TBaseCompilerOptions; | ||||||
|     FBufferingOutputLock: integer; |     FBufferingOutputLock: integer; | ||||||
|     fCurrentDirectory: string; |     fCurrentDirectory: string; | ||||||
| @ -109,6 +126,7 @@ type | |||||||
|     fOnGetIncludePath: TOnGetIncludePath; |     fOnGetIncludePath: TOnGetIncludePath; | ||||||
|     fOnAddFilteredLine: TOnAddFilteredLine; |     fOnAddFilteredLine: TOnAddFilteredLine; | ||||||
|     fOptions: TOuputFilterOptions; |     fOptions: TOuputFilterOptions; | ||||||
|  |     FScanLine: TOFScanLine; | ||||||
|     FStopExecute: boolean; |     FStopExecute: boolean; | ||||||
|     FLasTOutputLineParts: integer; |     FLasTOutputLineParts: integer; | ||||||
|     fLastOutputTime: TDateTime; |     fLastOutputTime: TDateTime; | ||||||
| @ -116,6 +134,7 @@ type | |||||||
|     fLastSearchedIncFilename: string; |     fLastSearchedIncFilename: string; | ||||||
|     fProcess: TProcess; |     fProcess: TProcess; | ||||||
|     FAsyncOutput: TDynamicDataQueue; |     FAsyncOutput: TDynamicDataQueue; | ||||||
|  |     FTool: TIDEExternalToolOptions; | ||||||
|     procedure DoAddFilteredLine(const s: string; OriginalIndex: integer = -1); |     procedure DoAddFilteredLine(const s: string; OriginalIndex: integer = -1); | ||||||
|     procedure DoAddLastLinkerMessages(SkipLastLine: boolean); |     procedure DoAddLastLinkerMessages(SkipLastLine: boolean); | ||||||
|     procedure DoAddLastAssemblerMessages; |     procedure DoAddLastAssemblerMessages; | ||||||
| @ -128,7 +147,8 @@ type | |||||||
|   public |   public | ||||||
|     ErrorExists: boolean; |     ErrorExists: boolean; | ||||||
|     Aborted: boolean; |     Aborted: boolean; | ||||||
|     function Execute(TheProcess: TProcess): boolean; |     function Execute(TheProcess: TProcess; aCaller: TObject = nil; | ||||||
|  |                      aTool: TIDEExternalToolOptions = nil): boolean; | ||||||
|     function GetSourcePosition(const Line: string; var Filename:string; |     function GetSourcePosition(const Line: string; var Filename:string; | ||||||
|       var CaretXY: TPoint; var MsgType: TErrorType): boolean; |       var CaretXY: TPoint; var MsgType: TErrorType): boolean; | ||||||
|     procedure Clear; |     procedure Clear; | ||||||
| @ -138,7 +158,8 @@ type | |||||||
|                                  MainSrcFile: string): boolean; |                                  MainSrcFile: string): boolean; | ||||||
|     function IsHintForParameterSenderNotUsed(const OutputLine: string): boolean; |     function IsHintForParameterSenderNotUsed(const OutputLine: string): boolean; | ||||||
|     function IsParsing: boolean; |     function IsParsing: boolean; | ||||||
|     procedure ReadLine(const s: string; DontFilterLine: boolean); |     procedure ReadLine(var s: string; DontFilterLine: boolean); | ||||||
|  |     procedure ReadConstLine(const s: string; DontFilterLine: boolean); | ||||||
|     function ReadFPCompilerLine(const s: string): boolean; |     function ReadFPCompilerLine(const s: string): boolean; | ||||||
|     function ReadMakeLine(const s: string): boolean; |     function ReadMakeLine(const s: string): boolean; | ||||||
|     procedure WriteOutput(Flush: boolean); |     procedure WriteOutput(Flush: boolean); | ||||||
| @ -154,15 +175,18 @@ type | |||||||
|     property LastMessageType: TOutputMessageType read fLastMessageType; |     property LastMessageType: TOutputMessageType read fLastMessageType; | ||||||
|     property OnGetIncludePath: TOnGetIncludePath |     property OnGetIncludePath: TOnGetIncludePath | ||||||
|                                  read fOnGetIncludePath write fOnGetIncludePath; |                                  read fOnGetIncludePath write fOnGetIncludePath; | ||||||
|     property OnReadLine: TOnOutputString read fOnReadLine write fOnReadLine; |     property OnReadLine: TOnOutputString read fOnReadLine write fOnReadLine;// used by the messages window | ||||||
|     property OnAddFilteredLine: TOnAddFilteredLine |     property OnAddFilteredLine: TOnAddFilteredLine | ||||||
|                                read fOnAddFilteredLine write fOnAddFilteredLine; |                                read fOnAddFilteredLine write fOnAddFilteredLine;// used by the messages window | ||||||
|     property Options: TOuputFilterOptions read fOptions write fOptions; |     property Options: TOuputFilterOptions read fOptions write fOptions; | ||||||
|     property CompilerOptions: TBaseCompilerOptions read FCompilerOptions |     property CompilerOptions: TBaseCompilerOptions read FCompilerOptions | ||||||
|                                                write FCompilerOptions; |                                                write FCompilerOptions; | ||||||
|     property CurrentMessageParts: TStrings read GetCurrentMessageParts; |     property CurrentMessageParts: TStrings read GetCurrentMessageParts; | ||||||
|     property AsyncProcessTerminated: boolean read FAsyncProcessTerminated; |     property AsyncProcessTerminated: boolean read FAsyncProcessTerminated; | ||||||
|     property OnEndReading: TOFOnEndReading read FOnEndReading write FOnEndReading; |     property OnEndReading: TOFOnEndReading read FOnEndReading write FOnEndReading; | ||||||
|  |     property Caller: TObject read FCaller; | ||||||
|  |     property ScanLine: TOFScanLine read FScanLine; | ||||||
|  |     property Tool: TIDEExternalToolOptions read FTool; | ||||||
|   end; |   end; | ||||||
|    |    | ||||||
|   EOutputFilterError = class(Exception) |   EOutputFilterError = class(Exception) | ||||||
| @ -212,7 +236,8 @@ begin | |||||||
|   fLastSearchedIncFilename:=''; |   fLastSearchedIncFilename:=''; | ||||||
| end; | end; | ||||||
| 
 | 
 | ||||||
| function TOutputFilter.Execute(TheProcess: TProcess): boolean; | function TOutputFilter.Execute(TheProcess: TProcess; aCaller: TObject; | ||||||
|  |   aTool: TIDEExternalToolOptions): boolean; | ||||||
| const | const | ||||||
|   BufSize = 4096; |   BufSize = 4096; | ||||||
| var | var | ||||||
| @ -223,6 +248,10 @@ begin | |||||||
|   Result:=true; |   Result:=true; | ||||||
|   Clear; |   Clear; | ||||||
|   fProcess:=TheProcess; |   fProcess:=TheProcess; | ||||||
|  |   FCaller:=aCaller; | ||||||
|  |   FTool:=aTool; | ||||||
|  |   FScanLine:=TOFScanLine.Create(Self); | ||||||
|  |    | ||||||
|   //debugln('TOutputFilter.Execute A CurrentDirectory="',TheProcess.CurrentDirectory,'"'); |   //debugln('TOutputFilter.Execute A CurrentDirectory="',TheProcess.CurrentDirectory,'"'); | ||||||
|   fCurrentDirectory:=TrimFilename(fProcess.CurrentDirectory); |   fCurrentDirectory:=TrimFilename(fProcess.CurrentDirectory); | ||||||
|   if fCurrentDirectory='' then fCurrentDirectory:=GetCurrentDir; |   if fCurrentDirectory='' then fCurrentDirectory:=GetCurrentDir; | ||||||
| @ -250,7 +279,7 @@ begin | |||||||
|         fProcess.Terminate(0); |         fProcess.Terminate(0); | ||||||
|         Aborted:=true; |         Aborted:=true; | ||||||
|         Result:=false; |         Result:=false; | ||||||
|         ReadLine('aborted',true); |         ReadConstLine('aborted',true); | ||||||
|         break; |         break; | ||||||
|       end; |       end; | ||||||
| 
 | 
 | ||||||
| @ -314,10 +343,13 @@ begin | |||||||
|     fProcess:=nil; |     fProcess:=nil; | ||||||
|     FreeAndNil(FAsyncOutput); |     FreeAndNil(FAsyncOutput); | ||||||
|     if Assigned(OnEndReading) then OnEndReading(Self,fOutput); |     if Assigned(OnEndReading) then OnEndReading(Self,fOutput); | ||||||
|  |     FreeAndNil(FScanLine); | ||||||
|  |     FTool:=nil; | ||||||
|  |     FCaller:=nil; | ||||||
|   end; |   end; | ||||||
| end; | end; | ||||||
| 
 | 
 | ||||||
| procedure TOutputFilter.ReadLine(const s: string; DontFilterLine: boolean); | procedure TOutputFilter.ReadLine(var s: string; DontFilterLine: boolean); | ||||||
| // this is called for every line written by the external tool (=Output) | // this is called for every line written by the external tool (=Output) | ||||||
| // it parses the output | // it parses the output | ||||||
| begin | begin | ||||||
| @ -326,8 +358,17 @@ begin | |||||||
|   fLastErrorType:=etNone; |   fLastErrorType:=etNone; | ||||||
|   fOutput.Add(s); |   fOutput.Add(s); | ||||||
|   WriteOutput(false); |   WriteOutput(false); | ||||||
|   if Assigned(OnReadLine) then |   if FScanLine<>nil then begin | ||||||
|     OnReadLine(s,fCurrentDirectory,fOutput.Count-1); |     FScanLine.Init(s,fCurrentDirectory,fOutput.Count-1); | ||||||
|  |     if Tool<>nil then begin | ||||||
|  |       Tool.ParseLine(Self,FScanLine); | ||||||
|  |       s:=FScanLine.Line; | ||||||
|  |     end; | ||||||
|  |     if Assigned(OnReadLine) then begin | ||||||
|  |       OnReadLine(FScanLine); | ||||||
|  |       s:=FScanLine.Line; | ||||||
|  |     end; | ||||||
|  |   end; | ||||||
| 
 | 
 | ||||||
|   if DontFilterLine then begin |   if DontFilterLine then begin | ||||||
|     DoAddFilteredLine(s); |     DoAddFilteredLine(s); | ||||||
| @ -342,6 +383,15 @@ begin | |||||||
|   end; |   end; | ||||||
| end; | end; | ||||||
| 
 | 
 | ||||||
|  | procedure TOutputFilter.ReadConstLine(const s: string; DontFilterLine: boolean | ||||||
|  |   ); | ||||||
|  | var | ||||||
|  |   Line: String; | ||||||
|  | begin | ||||||
|  |   Line:=s; | ||||||
|  |   ReadLine(Line,DontFilterLine); | ||||||
|  | end; | ||||||
|  | 
 | ||||||
| function TOutputFilter.ReadFPCompilerLine(const s: string): boolean; | function TOutputFilter.ReadFPCompilerLine(const s: string): boolean; | ||||||
| { returns true, if it is a compiler message | { returns true, if it is a compiler message | ||||||
|    Examples for freepascal compiler messages: |    Examples for freepascal compiler messages: | ||||||
| @ -1207,6 +1257,32 @@ begin | |||||||
|   FOriginalIndices[Index2]:=i; |   FOriginalIndices[Index2]:=i; | ||||||
| end; | end; | ||||||
| 
 | 
 | ||||||
|  | { TOFScanLine } | ||||||
|  | 
 | ||||||
|  | constructor TOFScanLine.Create(TheFilter: TOutputFilter); | ||||||
|  | begin | ||||||
|  |   FFilter:=TheFilter; | ||||||
|  |   inherited Create(Filter.Caller,Filter.Tool); | ||||||
|  | end; | ||||||
|  | 
 | ||||||
|  | procedure TOFScanLine.Init(const aLine, aWorkDir: string; | ||||||
|  |   const aLineNumber: integer); | ||||||
|  | begin | ||||||
|  |   Line:=aLine; | ||||||
|  |   WorkingDirectory:=aWorkDir; | ||||||
|  |   SetLineNumber(aLineNumber); | ||||||
|  | end; | ||||||
|  | 
 | ||||||
|  | procedure TOFScanLine.LineChanged(const OldValue: string); | ||||||
|  | begin | ||||||
|  | 
 | ||||||
|  | end; | ||||||
|  | 
 | ||||||
|  | procedure TOFScanLine.WorkingDirectoryChanged(const OldValue: string); | ||||||
|  | begin | ||||||
|  | 
 | ||||||
|  | end; | ||||||
|  | 
 | ||||||
| end. | end. | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -669,6 +669,7 @@ type | |||||||
|     procedure PasteClicked(Sender: TObject); |     procedure PasteClicked(Sender: TObject); | ||||||
|     procedure CopyFilenameClicked(Sender: TObject); |     procedure CopyFilenameClicked(Sender: TObject); | ||||||
| 
 | 
 | ||||||
|  |     // bookmarks | ||||||
|     Procedure ToggleBookmark(Value: Integer); |     Procedure ToggleBookmark(Value: Integer); | ||||||
|     Procedure SetBookmark(Value: Integer); |     Procedure SetBookmark(Value: Integer); | ||||||
|     Procedure GotoBookmark(Value: Integer); |     Procedure GotoBookmark(Value: Integer); | ||||||
| @ -676,6 +677,8 @@ type | |||||||
|     Procedure ReloadEditorOptions; |     Procedure ReloadEditorOptions; | ||||||
|     procedure CheckFont; |     procedure CheckFont; | ||||||
|     Procedure GetSynEditPreviewSettings(APreviewEditor: TObject); |     Procedure GetSynEditPreviewSettings(APreviewEditor: TObject); | ||||||
|  |     function GetEditorControlSettings(EditControl: TControl): boolean; override; | ||||||
|  |     function GetHighlighterSettings(Highlighter: TObject): boolean; override; | ||||||
| 
 | 
 | ||||||
|     Property CodeTemplateModul: TSynEditAutoComplete |     Property CodeTemplateModul: TSynEditAutoComplete | ||||||
|                                read FCodeTemplateModul write FCodeTemplateModul; |                                read FCodeTemplateModul write FCodeTemplateModul; | ||||||
| @ -5014,7 +5017,6 @@ Begin | |||||||
|     Notebook.Pages.Delete(PageIndex); |     Notebook.Pages.Delete(PageIndex); | ||||||
|     //writeln('TSourceNotebook.CloseFile C  PageIndex=',PageIndex,' Notebook.PageCount=',Notebook.PageCount); |     //writeln('TSourceNotebook.CloseFile C  PageIndex=',PageIndex,' Notebook.PageCount=',Notebook.PageCount); | ||||||
|     UpdateStatusBar; |     UpdateStatusBar; | ||||||
|     ActiveControl:=Notebook.Page[Notebook.PageIndex]; |  | ||||||
|   end else |   end else | ||||||
|   begin |   begin | ||||||
|     //writeln('TSourceNotebook.CloseFile D  PageIndex=',PageIndex); |     //writeln('TSourceNotebook.CloseFile D  PageIndex=',PageIndex); | ||||||
| @ -5689,6 +5691,29 @@ begin | |||||||
|   ASynEdit.Highlighter:=Highlighters[lshFreePascal]; |   ASynEdit.Highlighter:=Highlighters[lshFreePascal]; | ||||||
| end; | end; | ||||||
| 
 | 
 | ||||||
|  | function TSourceNotebook.GetEditorControlSettings(EditControl: TControl | ||||||
|  |   ): boolean; | ||||||
|  | begin | ||||||
|  |   Result:=true; | ||||||
|  |   if EditControl is TSynEdit then begin | ||||||
|  |     EditorOpts.GetSynEditSettings(TSynEdit(EditControl)); | ||||||
|  |     Result:=true; | ||||||
|  |   end else begin | ||||||
|  |     Result:=false; | ||||||
|  |   end; | ||||||
|  | end; | ||||||
|  | 
 | ||||||
|  | function TSourceNotebook.GetHighlighterSettings(Highlighter: TObject): boolean; | ||||||
|  | begin | ||||||
|  |   Result:=true; | ||||||
|  |   if Highlighter is TSynCustomHighlighter then begin | ||||||
|  |     EditorOpts.GetHighlighterSettings(TSynCustomHighlighter(Highlighter)); | ||||||
|  |     Result:=true; | ||||||
|  |   end else begin | ||||||
|  |     Result:=false; | ||||||
|  |   end; | ||||||
|  | end; | ||||||
|  | 
 | ||||||
| procedure TSourceNotebook.ClearErrorLines; | procedure TSourceNotebook.ClearErrorLines; | ||||||
| var i: integer; | var i: integer; | ||||||
| begin | begin | ||||||
|  | |||||||
| @ -20,124 +20,152 @@ unit IDEExternToolIntf; | |||||||
| interface | interface | ||||||
| 
 | 
 | ||||||
| uses | uses | ||||||
|   Classes, SysUtils, LCLType, LazConfigStorage, Forms, Controls, |   Classes, SysUtils, LCLType, LazConfigStorage, Forms, Controls, BaseIDEIntf; | ||||||
|   BaseIDEIntf; |  | ||||||
| 
 | 
 | ||||||
| { The xml format version: | { The xml format version: | ||||||
|     When the format changes (new values, changed formats) we can distinguish old |     When the format changes (new values, changed formats) we can distinguish old | ||||||
|     files and are able to convert them. |     files and are able to convert them. | ||||||
| } | } | ||||||
| const ExternalToolOptionsFormat = '1.0'; | const | ||||||
|  |   ExternalToolOptionsVersion = '1'; | ||||||
| 
 | 
 | ||||||
| type | type | ||||||
|  |   TIDEExternalToolOptions = class; | ||||||
|  | 
 | ||||||
|  |   { TIDEScanMessageLine } | ||||||
|  | 
 | ||||||
|  |   TIDEScanMessageLine = class(TPersistent) | ||||||
|  |   private | ||||||
|  |     FCaller: TObject; | ||||||
|  |     FLine: string; | ||||||
|  |     FLineNumber: integer; | ||||||
|  |     FTool: TIDEExternalToolOptions; | ||||||
|  |     FWorkingDirectory: string; | ||||||
|  |     procedure SetLine(const AValue: string); | ||||||
|  |     procedure SetWorkingDirectory(const AValue: string); | ||||||
|  |   protected | ||||||
|  |     procedure SetTool(const AValue: TIDEExternalToolOptions); | ||||||
|  |     procedure SetLineNumber(const NewLineNumber: integer); | ||||||
|  |     procedure LineChanged(const OldValue: string); virtual; abstract; | ||||||
|  |     procedure WorkingDirectoryChanged(const OldValue: string); virtual; abstract; | ||||||
|  |   public | ||||||
|  |     constructor Create(TheCaller: TObject = nil; TheTool: TIDEExternalToolOptions = nil); | ||||||
|  |     property Caller: TObject read FCaller; | ||||||
|  |     property Line: string read FLine write SetLine; | ||||||
|  |     property WorkingDirectory: string read FWorkingDirectory write SetWorkingDirectory; | ||||||
|  |     property LineNumber: integer read FLineNumber; | ||||||
|  |     property Tool: TIDEExternalToolOptions read FTool; | ||||||
|  |   end; | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |   TOnIDEExtToolParseLine = procedure(Sender: TObject; | ||||||
|  |                                      Line: TIDEScanMessageLine) of object; | ||||||
|  | 
 | ||||||
|   { |   { | ||||||
|     TExternalToolOptions - the storage object for a single external tool |     TIDEExternalToolOptions - the storage object for a single external tool | ||||||
|   } |   } | ||||||
|   TExternalToolOptions = class |   TIDEExternalToolOptions = class(TPersistent) | ||||||
|   private |   private | ||||||
|     fCmdLineParams: string; |     fCmdLineParams: string; | ||||||
|     FEnvironmentOverrides: TStringList; |     FEnvironmentOverrides: TStringList; | ||||||
|     fFilename: string; |     fFilename: string; | ||||||
|     fKey: word; |     FOnParseLine: TOnIDEExtToolParseLine; | ||||||
|     FScanOutput: boolean; |     FScanOutput: boolean; | ||||||
|     fScanOutputForFPCMessages: boolean; |     fScanOutputForFPCMessages: boolean; | ||||||
|     fScanOutputForMakeMessages: boolean; |     fScanOutputForMakeMessages: boolean; | ||||||
|     fShift: TShiftState; |  | ||||||
|     FShowAllOutput: boolean; |     FShowAllOutput: boolean; | ||||||
|     fTitle: string; |     fTitle: string; | ||||||
|     fWorkingDirectory: string; |     fWorkingDirectory: string; | ||||||
|     procedure SetScanOutput(const AValue: boolean); |     procedure SetScanOutput(const AValue: boolean); | ||||||
|     procedure SetShowAllOutput(const AValue: boolean); |     procedure SetShowAllOutput(const AValue: boolean); | ||||||
|   public |   public | ||||||
|     procedure Assign(Source: TExternalToolOptions); |  | ||||||
|     constructor Create; |     constructor Create; | ||||||
|     destructor Destroy; override; |     destructor Destroy; override; | ||||||
|     procedure Clear; |     procedure Assign(Source: TPersistent); override; | ||||||
|  |     procedure Clear; virtual; | ||||||
|     function NeedsOutputFilter: boolean; |     function NeedsOutputFilter: boolean; | ||||||
|     function Load(Config: TConfigStorage): TModalResult; |     function Load(Config: TConfigStorage): TModalResult; virtual; | ||||||
|     function Save(Config: TConfigStorage): TModalResult; |     function Save(Config: TConfigStorage): TModalResult; virtual; | ||||||
|     function ShortDescription: string; |     function ShortDescription: string; | ||||||
|     procedure AssignEnvironmentTo(Strings: TStrings); |     procedure AssignEnvironmentTo(Strings: TStrings); | ||||||
|  |     procedure ParseLine(Sender: TObject; Line: TIDEScanMessageLine); virtual; | ||||||
| 
 | 
 | ||||||
|     property CmdLineParams: string read fCmdLineParams write fCmdLineParams; |     property CmdLineParams: string read fCmdLineParams write fCmdLineParams; | ||||||
|     property Filename: string read fFilename write fFilename; |     property Filename: string read fFilename write fFilename; | ||||||
|     property Key: word read fKey write fKey; |  | ||||||
|     property Title: string read fTitle write fTitle; |     property Title: string read fTitle write fTitle; | ||||||
|     property ScanOutputForFPCMessages: boolean |     property ScanOutputForFPCMessages: boolean | ||||||
|       read fScanOutputForFPCMessages write fScanOutputForFPCMessages; |       read fScanOutputForFPCMessages write fScanOutputForFPCMessages; | ||||||
|     property ScanOutputForMakeMessages: boolean |     property ScanOutputForMakeMessages: boolean | ||||||
|       read fScanOutputForMakeMessages write fScanOutputForMakeMessages; |       read fScanOutputForMakeMessages write fScanOutputForMakeMessages; | ||||||
|     property Shift: TShiftState read fShift write fShift; |  | ||||||
|     property WorkingDirectory: string |     property WorkingDirectory: string | ||||||
|       read fWorkingDirectory write fWorkingDirectory; |       read fWorkingDirectory write fWorkingDirectory; | ||||||
|     property EnvironmentOverrides: TStringList read FEnvironmentOverrides; |     property EnvironmentOverrides: TStringList read FEnvironmentOverrides; | ||||||
|     property ScanOutput: boolean read FScanOutput write SetScanOutput; |     property ScanOutput: boolean read FScanOutput write SetScanOutput; | ||||||
|     property ShowAllOutput: boolean read FShowAllOutput write SetShowAllOutput; |     property ShowAllOutput: boolean read FShowAllOutput write SetShowAllOutput; | ||||||
|  |     property OnParseLine: TOnIDEExtToolParseLine read FOnParseLine write FOnParseLine; | ||||||
|   end; |   end; | ||||||
| 
 | 
 | ||||||
| implementation | implementation | ||||||
| 
 | 
 | ||||||
| { TExternalToolOptions } | { TIDEExternalToolOptions } | ||||||
| 
 | 
 | ||||||
| procedure TExternalToolOptions.SetScanOutput(const AValue: boolean); | procedure TIDEExternalToolOptions.SetScanOutput(const AValue: boolean); | ||||||
| begin | begin | ||||||
|   if FScanOutput=AValue then exit; |   if FScanOutput=AValue then exit; | ||||||
|   FScanOutput:=AValue; |   FScanOutput:=AValue; | ||||||
| end; | end; | ||||||
| 
 | 
 | ||||||
| procedure TExternalToolOptions.SetShowAllOutput(const AValue: boolean); | procedure TIDEExternalToolOptions.SetShowAllOutput(const AValue: boolean); | ||||||
| begin | begin | ||||||
|   if FShowAllOutput=AValue then exit; |   if FShowAllOutput=AValue then exit; | ||||||
|   FShowAllOutput:=AValue; |   FShowAllOutput:=AValue; | ||||||
| end; | end; | ||||||
| 
 | 
 | ||||||
| procedure TExternalToolOptions.Assign(Source: TExternalToolOptions); | procedure TIDEExternalToolOptions.Assign(Source: TPersistent); | ||||||
|  | var | ||||||
|  |   Src: TIDEExternalToolOptions; | ||||||
| begin | begin | ||||||
|   if Source=Self then exit; |   if Source=Self then exit; | ||||||
|   if Source=nil then |   if Source is TIDEExternalToolOptions then begin | ||||||
|     Clear |     Src:=TIDEExternalToolOptions(Source); | ||||||
|   else begin |     fTitle:=Src.fTitle; | ||||||
|     fTitle:=Source.fTitle; |     fFilename:=Src.fFilename; | ||||||
|     fFilename:=Source.fFilename; |     fCmdLineParams:=Src.fCmdLineParams; | ||||||
|     fCmdLineParams:=Source.fCmdLineParams; |     fWorkingDirectory:=Src.fWorkingDirectory; | ||||||
|     fWorkingDirectory:=Source.fWorkingDirectory; |     fScanOutputForFPCMessages:=Src.fScanOutputForFPCMessages; | ||||||
|     fKey:=Source.fKey; |     fScanOutputForMakeMessages:=Src.fScanOutputForMakeMessages; | ||||||
|     fShift:=Source.fShift; |     FScanOutput:=Src.FScanOutput; | ||||||
|     fScanOutputForFPCMessages:=Source.fScanOutputForFPCMessages; |     FShowAllOutput:=Src.FShowAllOutput; | ||||||
|     fScanOutputForMakeMessages:=Source.fScanOutputForMakeMessages; |   end else | ||||||
|     FScanOutput:=Source.FScanOutput; |     inherited Assign(Source); | ||||||
|     FShowAllOutput:=Source.FShowAllOutput; |  | ||||||
|   end; |  | ||||||
| end; | end; | ||||||
| 
 | 
 | ||||||
| constructor TExternalToolOptions.Create; | constructor TIDEExternalToolOptions.Create; | ||||||
| begin | begin | ||||||
|   inherited Create; |   inherited Create; | ||||||
|   FEnvironmentOverrides:=TStringList.Create; |   FEnvironmentOverrides:=TStringList.Create; | ||||||
|   Clear; |   Clear; | ||||||
| end; | end; | ||||||
| 
 | 
 | ||||||
| destructor TExternalToolOptions.Destroy; | destructor TIDEExternalToolOptions.Destroy; | ||||||
| begin | begin | ||||||
|   FEnvironmentOverrides.Free; |   FEnvironmentOverrides.Free; | ||||||
|   inherited Destroy; |   inherited Destroy; | ||||||
| end; | end; | ||||||
| 
 | 
 | ||||||
| procedure TExternalToolOptions.Clear; | procedure TIDEExternalToolOptions.Clear; | ||||||
| begin | begin | ||||||
|   fTitle:=''; |   fTitle:=''; | ||||||
|   fFilename:=''; |   fFilename:=''; | ||||||
|   fCmdLineParams:=''; |   fCmdLineParams:=''; | ||||||
|   fWorkingDirectory:=''; |   fWorkingDirectory:=''; | ||||||
|   fKey:=VK_UNKNOWN; |  | ||||||
|   fShift:=[]; |  | ||||||
|   fScanOutputForFPCMessages:=false; |   fScanOutputForFPCMessages:=false; | ||||||
|   fScanOutputForMakeMessages:=false; |   fScanOutputForMakeMessages:=false; | ||||||
|   FScanOutput:=false; |   FScanOutput:=false; | ||||||
|   FShowAllOutput:=false; |   FShowAllOutput:=false; | ||||||
| end; | end; | ||||||
| 
 | 
 | ||||||
| function TExternalToolOptions.Load(Config: TConfigStorage): TModalResult; | function TIDEExternalToolOptions.Load(Config: TConfigStorage): TModalResult; | ||||||
| begin | begin | ||||||
|   Clear; |   Clear; | ||||||
|   fTitle:=Config.GetValue('Title/Value',''); |   fTitle:=Config.GetValue('Title/Value',''); | ||||||
| @ -150,13 +178,12 @@ begin | |||||||
|                                   'ScanOutputForMakeMessages/Value',false); |                                   'ScanOutputForMakeMessages/Value',false); | ||||||
|   FShowAllOutput:=Config.GetValue('ShowAllOutput/Value',false); |   FShowAllOutput:=Config.GetValue('ShowAllOutput/Value',false); | ||||||
|   Config.GetValue('EnvironmentOverrides/',FEnvironmentOverrides); |   Config.GetValue('EnvironmentOverrides/',FEnvironmentOverrides); | ||||||
|   // key and shift are loaded with the keymapping in the editoroptions |  | ||||||
|   Result:=mrOk; |   Result:=mrOk; | ||||||
| end; | end; | ||||||
| 
 | 
 | ||||||
| function TExternalToolOptions.Save(Config: TConfigStorage): TModalResult; | function TIDEExternalToolOptions.Save(Config: TConfigStorage): TModalResult; | ||||||
| begin | begin | ||||||
|   Config.SetValue('Format/Version',ExternalToolOptionsFormat); |   Config.SetValue('Format/Version',ExternalToolOptionsVersion); | ||||||
|   Config.SetDeleteValue('Title/Value',fTitle,''); |   Config.SetDeleteValue('Title/Value',fTitle,''); | ||||||
|   Config.SetDeleteValue('Filename/Value',fFilename,''); |   Config.SetDeleteValue('Filename/Value',fFilename,''); | ||||||
|   Config.SetDeleteValue('CmdLineParams/Value',fCmdLineParams,''); |   Config.SetDeleteValue('CmdLineParams/Value',fCmdLineParams,''); | ||||||
| @ -169,25 +196,70 @@ begin | |||||||
|              false); |              false); | ||||||
|   Config.SetDeleteValue('ShowAllOutput/Value',FShowAllOutput,false); |   Config.SetDeleteValue('ShowAllOutput/Value',FShowAllOutput,false); | ||||||
|   Config.SetValue('EnvironmentOverrides/',FEnvironmentOverrides); |   Config.SetValue('EnvironmentOverrides/',FEnvironmentOverrides); | ||||||
|   // key and shift are saved with the keymapping in the editoroptions |  | ||||||
|   Result:=mrOk; |   Result:=mrOk; | ||||||
| end; | end; | ||||||
| 
 | 
 | ||||||
| function TExternalToolOptions.ShortDescription: string; | function TIDEExternalToolOptions.ShortDescription: string; | ||||||
| begin | begin | ||||||
|   Result:=Title; |   Result:=Title; | ||||||
| end; | end; | ||||||
| 
 | 
 | ||||||
| procedure TExternalToolOptions.AssignEnvironmentTo(Strings: TStrings); | procedure TIDEExternalToolOptions.AssignEnvironmentTo(Strings: TStrings); | ||||||
| begin | begin | ||||||
|   BaseIDEIntf.AssignEnvironmentTo(Strings,EnvironmentOverrides); |   BaseIDEIntf.AssignEnvironmentTo(Strings,EnvironmentOverrides); | ||||||
| end; | end; | ||||||
| 
 | 
 | ||||||
| function TExternalToolOptions.NeedsOutputFilter: boolean; | procedure TIDEExternalToolOptions.ParseLine(Sender: TObject; | ||||||
|  |   Line: TIDEScanMessageLine); | ||||||
|  | begin | ||||||
|  |   if Assigned(OnParseLine) then | ||||||
|  |     OnParseLine(Sender,Line); | ||||||
|  | end; | ||||||
|  | 
 | ||||||
|  | function TIDEExternalToolOptions.NeedsOutputFilter: boolean; | ||||||
| begin | begin | ||||||
|   Result:=ScanOutput or ScanOutputForFPCMessages or ScanOutputForMakeMessages |   Result:=ScanOutput or ScanOutputForFPCMessages or ScanOutputForMakeMessages | ||||||
|                      or ShowAllOutput; |                      or ShowAllOutput; | ||||||
| end; | end; | ||||||
| 
 | 
 | ||||||
|  | { TIDEScanMessageLine } | ||||||
|  | 
 | ||||||
|  | procedure TIDEScanMessageLine.SetLine(const AValue: string); | ||||||
|  | var | ||||||
|  |   OldLine: String; | ||||||
|  | begin | ||||||
|  |   if FLine=AValue then exit; | ||||||
|  |   OldLine:=FLine; | ||||||
|  |   FLine:=AValue; | ||||||
|  |   LineChanged(OldLine); | ||||||
|  | end; | ||||||
|  | 
 | ||||||
|  | procedure TIDEScanMessageLine.SetWorkingDirectory(const AValue: string); | ||||||
|  | var | ||||||
|  |   OldDir: String; | ||||||
|  | begin | ||||||
|  |   if FWorkingDirectory=AValue then exit; | ||||||
|  |   OldDir:=FWorkingDirectory; | ||||||
|  |   FWorkingDirectory:=AValue; | ||||||
|  |   WorkingDirectoryChanged(OldDir); | ||||||
|  | end; | ||||||
|  | 
 | ||||||
|  | procedure TIDEScanMessageLine.SetTool(const AValue: TIDEExternalToolOptions); | ||||||
|  | begin | ||||||
|  |   FTool:=AValue; | ||||||
|  | end; | ||||||
|  | 
 | ||||||
|  | procedure TIDEScanMessageLine.SetLineNumber(const NewLineNumber: integer); | ||||||
|  | begin | ||||||
|  |   FLineNumber:=NewLineNumber; | ||||||
|  | end; | ||||||
|  | 
 | ||||||
|  | constructor TIDEScanMessageLine.Create(TheCaller: TObject; | ||||||
|  |   TheTool: TIDEExternalToolOptions); | ||||||
|  | begin | ||||||
|  |   FCaller:=TheCaller; | ||||||
|  |   FTool:=TheTool; | ||||||
|  | end; | ||||||
|  | 
 | ||||||
| end. | end. | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -22,7 +22,7 @@ unit IDEMsgIntf; | |||||||
| interface | interface | ||||||
| 
 | 
 | ||||||
| uses | uses | ||||||
|   Classes, SysUtils, Forms, LCLProc, TextTools, IDECommands; |   Classes, SysUtils, Forms, LCLProc, TextTools, IDECommands, IDEExternToolIntf; | ||||||
|    |    | ||||||
| type | type | ||||||
| 
 | 
 | ||||||
| @ -184,7 +184,7 @@ type | |||||||
|     property Lines[Index: integer]: TIDEMessageLine read GetLines; default; |     property Lines[Index: integer]: TIDEMessageLine read GetLines; default; | ||||||
|     function LinesCount: integer; virtual; abstract; |     function LinesCount: integer; virtual; abstract; | ||||||
|   end; |   end; | ||||||
|    | 
 | ||||||
| var | var | ||||||
|   IDEMsgQuickFixes: TIDEMsgQuickFixItems; // initialized by the IDE |   IDEMsgQuickFixes: TIDEMsgQuickFixItems; // initialized by the IDE | ||||||
|   IDEMessagesWindow: TIDEMessagesWindowInterface;// initialized by the IDE |   IDEMessagesWindow: TIDEMessagesWindowInterface;// initialized by the IDE | ||||||
|  | |||||||
| @ -23,7 +23,7 @@ interface | |||||||
| 
 | 
 | ||||||
| uses | uses | ||||||
|   Classes, SysUtils, LCLProc, Forms, Controls, Dialogs, PropEdits, LazHelpHTML, |   Classes, SysUtils, LCLProc, Forms, Controls, Dialogs, PropEdits, LazHelpHTML, | ||||||
|   ProjectIntf, SrcEditorIntf; |   IDEExternToolIntf, ProjectIntf, SrcEditorIntf; | ||||||
| 
 | 
 | ||||||
| type | type | ||||||
|   // open file flags |   // open file flags | ||||||
| @ -132,10 +132,12 @@ type | |||||||
|     constructor Create(TheOwner: TComponent); override; |     constructor Create(TheOwner: TComponent); override; | ||||||
|     destructor Destroy; override; |     destructor Destroy; override; | ||||||
|      |      | ||||||
|  |     // find file | ||||||
|     function FindUnitFile(const AFilename: string): string; virtual; abstract; |     function FindUnitFile(const AFilename: string): string; virtual; abstract; | ||||||
|     function FindSourceFile(const AFilename, BaseDirectory: string; |     function FindSourceFile(const AFilename, BaseDirectory: string; | ||||||
|                             Flags: TFindSourceFlags): string; virtual; abstract; |                             Flags: TFindSourceFlags): string; virtual; abstract; | ||||||
| 
 | 
 | ||||||
|  |     // file | ||||||
|     function DoNewEditorFile(NewFileDescriptor: TProjectFileDescriptor; |     function DoNewEditorFile(NewFileDescriptor: TProjectFileDescriptor; | ||||||
|         NewFilename: string; const NewSource: string; |         NewFilename: string; const NewSource: string; | ||||||
|         NewFlags: TNewFlags): TModalResult; |         NewFlags: TNewFlags): TModalResult; | ||||||
| @ -154,6 +156,8 @@ type | |||||||
|         const CursorPosition: TPoint; TopLine: integer; |         const CursorPosition: TPoint; TopLine: integer; | ||||||
|         PageIndex: integer; Flags: TOpenFlags): TModalResult; virtual; abstract; |         PageIndex: integer; Flags: TOpenFlags): TModalResult; virtual; abstract; | ||||||
| 
 | 
 | ||||||
|  |     // project | ||||||
|  |     property ActiveProject: TLazProject read GetActiveProject; | ||||||
|     function DoNewProject(ProjectDesc: TProjectDescriptor): TModalResult; virtual; abstract; |     function DoNewProject(ProjectDesc: TProjectDescriptor): TModalResult; virtual; abstract; | ||||||
|     function DoSaveProject(Flags: TSaveFlags): TModalResult; virtual; abstract; |     function DoSaveProject(Flags: TSaveFlags): TModalResult; virtual; abstract; | ||||||
|     function DoCloseProject: TModalResult; virtual; abstract; |     function DoCloseProject: TModalResult; virtual; abstract; | ||||||
| @ -162,6 +166,7 @@ type | |||||||
|     function DoPublishProject(Flags: TSaveFlags; |     function DoPublishProject(Flags: TSaveFlags; | ||||||
|                               ShowDialog: boolean): TModalResult; virtual; abstract; |                               ShowDialog: boolean): TModalResult; virtual; abstract; | ||||||
| 
 | 
 | ||||||
|  |     // configs | ||||||
|     function GetPrimaryConfigPath: String; virtual; abstract; |     function GetPrimaryConfigPath: String; virtual; abstract; | ||||||
|     function GetSecondaryConfigPath: String; virtual; abstract; |     function GetSecondaryConfigPath: String; virtual; abstract; | ||||||
|     procedure CopySecondaryConfigFile(const AFilename: String); virtual; abstract; |     procedure CopySecondaryConfigFile(const AFilename: String); virtual; abstract; | ||||||
| @ -169,13 +174,16 @@ type | |||||||
|     function CreateNewUniqueFilename(const Prefix, Ext: string; |     function CreateNewUniqueFilename(const Prefix, Ext: string; | ||||||
|                           NewOwner: TObject; Flags: TSearchIDEFileFlags; |                           NewOwner: TObject; Flags: TSearchIDEFileFlags; | ||||||
|                           TryWithoutNumber: boolean): string; virtual; abstract; |                           TryWithoutNumber: boolean): string; virtual; abstract; | ||||||
|         | 
 | ||||||
|  |     // macros | ||||||
|     function SubstituteMacros(var s: string): boolean; virtual; abstract; |     function SubstituteMacros(var s: string): boolean; virtual; abstract; | ||||||
| 
 | 
 | ||||||
|  |     // codetools | ||||||
|     function BeginCodeTools: boolean; virtual; abstract; |     function BeginCodeTools: boolean; virtual; abstract; | ||||||
|     procedure DoJumpToCodeToolBossError; virtual; abstract; |     procedure DoJumpToCodeToolBossError; virtual; abstract; | ||||||
|     procedure SaveSourceEditorChangesToCodeCache(PageIndex: integer); virtual; abstract; |     procedure SaveSourceEditorChangesToCodeCache(PageIndex: integer); virtual; abstract; | ||||||
|      | 
 | ||||||
|  |     // progress and error messages | ||||||
|     function ShowProgress(const SomeText: string; |     function ShowProgress(const SomeText: string; | ||||||
|                           Step, MaxStep: integer): boolean; virtual; abstract; // False if canceled by user |                           Step, MaxStep: integer): boolean; virtual; abstract; // False if canceled by user | ||||||
|     function DoJumpToCompilerMessage(Index:integer; |     function DoJumpToCompilerMessage(Index:integer; | ||||||
| @ -183,13 +191,15 @@ type | |||||||
|     procedure DoJumpToNextError(DirectionDown: boolean); virtual; abstract; |     procedure DoJumpToNextError(DirectionDown: boolean); virtual; abstract; | ||||||
|     procedure DoShowMessagesView; virtual; abstract; |     procedure DoShowMessagesView; virtual; abstract; | ||||||
| 
 | 
 | ||||||
|  |     // designer | ||||||
|     function GetDesignerWithProjectFile(AFile: TLazProjectFile; |     function GetDesignerWithProjectFile(AFile: TLazProjectFile; | ||||||
|                               LoadForm: boolean): TIDesigner; virtual; abstract; |                               LoadForm: boolean): TIDesigner; virtual; abstract; | ||||||
|     function GetProjectFileWithRootComponent(AComponent: TComponent): TLazProjectFile; virtual; abstract; |     function GetProjectFileWithRootComponent(AComponent: TComponent): TLazProjectFile; virtual; abstract; | ||||||
|     function GetProjectFileWithDesigner(ADesigner: TIDesigner): TLazProjectFile; virtual; abstract; |     function GetProjectFileWithDesigner(ADesigner: TIDesigner): TLazProjectFile; virtual; abstract; | ||||||
|   public |  | ||||||
|     property ActiveProject: TLazProject read GetActiveProject; |  | ||||||
|      |      | ||||||
|  |     // external tools | ||||||
|  |     function RunExternalTool(Tool: TIDEExternalToolOptions): TModalResult; virtual; abstract; | ||||||
|  | 
 | ||||||
|     // events |     // events | ||||||
|     procedure RemoveAllHandlersOfObject(AnObject: TObject); |     procedure RemoveAllHandlersOfObject(AnObject: TObject); | ||||||
|     procedure AddHandlerOnSavingAll(const OnSaveAllEvent: TModalResultFunction; |     procedure AddHandlerOnSavingAll(const OnSaveAllEvent: TModalResultFunction; | ||||||
|  | |||||||
| @ -136,6 +136,9 @@ type | |||||||
|                                                   write SetActiveEditor; |                                                   write SetActiveEditor; | ||||||
|     function Count: integer; virtual; abstract; |     function Count: integer; virtual; abstract; | ||||||
|     property Items[Index: integer]: TSourceEditorInterface read GetItems; default; |     property Items[Index: integer]: TSourceEditorInterface read GetItems; default; | ||||||
|  |      | ||||||
|  |     function GetEditorControlSettings(EditControl: TControl): boolean; virtual; abstract; | ||||||
|  |     function GetHighlighterSettings(Highlighter: TObject): boolean; virtual; abstract; | ||||||
|   end; |   end; | ||||||
|    |    | ||||||
|    |    | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 mattias
						mattias