IDE: further migration external tools

git-svn-id: trunk@42292 -
This commit is contained in:
mattias 2013-08-03 18:39:14 +00:00
parent 4fd97d59ae
commit a3c0c0d439
16 changed files with 207 additions and 31 deletions

2
.gitattributes vendored
View File

@ -4958,6 +4958,8 @@ ide/etfpcmsgparser.pas svneol=native#text/plain
ide/etmakemsgparser.pas svneol=native#text/plain
ide/etmessageframe.lfm svneol=native#text/plain
ide/etmessageframe.pas svneol=native#text/plain
ide/etmessageswnd.lfm svneol=native#text/plain
ide/etmessageswnd.pas svneol=native#text/plain
ide/etquickfixes.pas svneol=native#text/plain
ide/etsrceditmarks.pas svneol=native#text/plain
ide/examplemanager.lfm svneol=native#text/plain

View File

@ -11,7 +11,8 @@ unit SynEditMarks;
interface
uses
Classes, Controls, SysUtils, math, SynEditMiscClasses, LazSynEditText, LCLProc;
Classes, Controls, SysUtils, math, SynEditMiscClasses, LazSynEditText,
LCLProc, ImgList;
type
@ -49,7 +50,7 @@ type
TSynEditMark = class
private
FImageList: TImageList;
FImageList: TCustomImageList;
FMarkLine: TSynEditMarkLine;
FMarkList: TSynEditMarkList;
FLine: Integer; // Only valid, if not part of a TSynEditMarkLine
@ -103,7 +104,7 @@ type
property ImageIndex: integer read FImage write SetImage;
// ImageList: If assigned, then use instead of "BookMarkOpt.BookmarkImages"
// Must have same width as "BookMarkOpt.BookmarkImages"
property ImageList: TImageList read FImageList write FImageList;
property ImageList: TCustomImageList read FImageList write FImageList;
end;
{ TSynEditMarkLine }

View File

@ -5,8 +5,8 @@ unit SynGutterMarks;
interface
uses
Classes, SysUtils, Graphics, LCLType, LCLIntf, LCLProc, Controls, math,
SynGutterBase, SynEditMiscClasses, SynEditMarks;
Classes, SysUtils, Graphics, LCLType, LCLIntf, LCLProc, Controls, ImgList,
math, SynGutterBase, SynEditMiscClasses, SynEditMarks;
type
@ -77,7 +77,7 @@ var
procedure DoPaintMark(CurMark: TSynEditMark; aRect: TRect);
var
img: TImageList;
img: TCustomImageList;
begin
if CurMark.InternalImage or
( (not assigned(FBookMarkOpt.BookmarkImages)) and

View File

@ -1410,8 +1410,12 @@ begin
if ADocFile.DocErrorMsg<>'' then begin
if not (chofQuiet in Flags) then begin
// for example: Filename(y,x) Error: description
{$IFDEF EnableNewExtTools}
IDEMessagesWindow.addcu
{$ELSE}
IDEMessagesWindow.AddMsg(ADocFile.DocErrorMsg,
ExtractFilePath(ADocFile.CodeBuffer.Filename),-1);
{$ENDIF}
end;
// no update needed
exit(chprFailed);

View File

@ -2475,7 +2475,7 @@ function TMessagesCtrl.GetHeaderText(View: TLMsgWndView): string;
//debugln(['GetStats cat=',dbgs(c),' count=',Lines.UrgencyCounts[c]]);
if c>=mluError then
inc(ErrCnt,Lines.UrgencyCounts[c])
else if c=mluWarn then
else if c=mluWarning then
inc(WarnCnt,Lines.UrgencyCounts[c])
else if c in [mluHint,mluNote] then
inc(HintCnt,Lines.UrgencyCounts[c]);
@ -2971,7 +2971,7 @@ begin
MinUrgency:=MessagesCtrl.ActiveFilter.MinUrgency;
HideWarningsMenuItem.Checked:=MinUrgency in [mluError..mluPanic];
HideNotesMenuItem.Checked:=MinUrgency in [mluWarn,mluImportant];
HideNotesMenuItem.Checked:=MinUrgency in [mluWarning,mluImportant];
HideHintsMenuItem.Checked:=MinUrgency=mluNote;
HideVerboseMenuItem.Checked:=MinUrgency=mluHint;
HideDebugMenuItem.Checked:=MinUrgency in [mluProgress..mluVerbose];
@ -3147,7 +3147,7 @@ begin
if Sender=HideWarningsMenuItem then
MinUrgency:=mluError
else if Sender=HideNotesMenuItem then
MinUrgency:=mluWarn
MinUrgency:=mluWarning
else if Sender=HideHintsMenuItem then
MinUrgency:=mluNote
else if Sender=HideVerboseMenuItem then
@ -3391,7 +3391,7 @@ begin
UrgencyStyles[mluVerbose].SetValues('Ausfuerhlich',5,clDefault);
UrgencyStyles[mluHint].SetValues('Hinweis',4,clDefault);
UrgencyStyles[mluNote].SetValues('Note',3,clDefault);
UrgencyStyles[mluWarn].SetValues('Warnung',2,clDefault);
UrgencyStyles[mluWarning].SetValues('Warnung',2,clDefault);
UrgencyStyles[mluImportant].SetValues('Sonstiges',4,clDefault);
UrgencyStyles[mluError].SetValues('Fehler',1,clDefault);
UrgencyStyles[mluFatal].SetValues('Fatal',0,clDefault);

24
ide/etmessageswnd.lfm Normal file
View File

@ -0,0 +1,24 @@
object MessagesView: TMessagesView
Left = 213
Height = 128
Top = 586
Width = 639
Caption = 'MessagesView'
ClientHeight = 128
ClientWidth = 639
OnCreate = FormCreate
OnDestroy = FormDestroy
LCLVersion = '1.1'
inline MessagesFrame1: TMessagesFrame
Height = 128
Width = 639
Align = alClient
ClientHeight = 128
ClientWidth = 639
inherited SearchPanel: TPanel
Top = 101
Width = 639
ClientWidth = 639
end
end
end

116
ide/etmessageswnd.pas Normal file
View File

@ -0,0 +1,116 @@
{
***************************************************************************
* *
* This source is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This code is distributed in the hope that it will be useful, but *
* WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* General Public License for more details. *
* *
* A copy of the GNU General Public License is available on the World *
* Wide Web at <http://www.gnu.org/copyleft/gpl.html>. You can also *
* obtain it by writing to the Free Software Foundation, *
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
* *
***************************************************************************
Author: Mattias Gaertner
Abstract:
Window for (compiler) messages.
}
unit etMessagesWnd;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, FileUtil, IDEMsgIntf, IDEImagesIntf, IDEExternToolIntf,
Forms, Controls, Graphics, Dialogs, etMessageFrame, etSrcEditMarks;
type
{ TMessagesView }
TMessagesView = class(TIDEMessagesWindowInterface)
MessagesFrame1: TMessagesFrame;
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
function OnOpenMessage(Sender: TObject; Msg: TMessageLine): boolean;
private
ImgIDNone: integer;
ImgIDInformation: integer;
ImgIDHint: integer;
ImgIDNote: integer;
ImgIDWarning: integer;
ImgIDError: integer;
ImgIDFatal: integer;
public
SourceMarks: TETMarks;
end;
var
MessagesView: TMessagesView;
const
MessagesMenuRootName = 'Messages';
procedure RegisterStandardMessagesViewMenuItems;
implementation
procedure RegisterStandardMessagesViewMenuItems;
begin
end;
{$R *.lfm}
{ TMessagesView }
procedure TMessagesView.FormCreate(Sender: TObject);
begin
IDEMessagesWindow:=Self;
SourceMarks:=TETMarks.Create(Self);
with SourceMarks do begin
ImageList:=IDEImages.Images_12;
//OnGetSynEditOfFile:=@SourceMarksGetSynEditOfFile;
MarkStyles[mluNone].ImageIndex:=-1;
MarkStyles[mluProgress].ImageIndex:=-1;
MarkStyles[mluDebug].ImageIndex:=IDEImages.LoadImage(12, 'state12x12_information');
MarkStyles[mluVerbose3].ImageIndex:=IDEImages.LoadImage(12, 'state12x12_information');
MarkStyles[mluVerbose2].ImageIndex:=IDEImages.LoadImage(12, 'state12x12_information');
MarkStyles[mluVerbose].ImageIndex:=IDEImages.LoadImage(12, 'state12x12_information');
MarkStyles[mluHint].ImageIndex:=IDEImages.LoadImage(12, 'state12x12_hint');
MarkStyles[mluNote].ImageIndex:=IDEImages.LoadImage(12, 'state12x12_note');
MarkStyles[mluWarning].ImageIndex:=IDEImages.LoadImage(12, 'state12x12_warning');
MarkStyles[mluImportant].ImageIndex:=-1;
MarkStyles[mluError].ImageIndex:=IDEImages.LoadImage(12, 'state12x12_error');
MarkStyles[mluFatal].ImageIndex:=IDEImages.LoadImage(12, 'state12x12_fatal');
MarkStyles[mluPanic].ImageIndex:=IDEImages.LoadImage(12, 'state12x12_fatal');
end;
MessagesFrame1.MessagesCtrl.SourceMarks:=SourceMarks;
MessagesFrame1.MessagesCtrl.OnOpenMessage:=@OnOpenMessage;
ActiveControl:=MessagesFrame1.MessagesCtrl;
end;
procedure TMessagesView.FormDestroy(Sender: TObject);
begin
IDEMessagesWindow:=nil;
end;
function TMessagesView.OnOpenMessage(Sender: TObject; Msg: TMessageLine
): boolean;
begin
end;
end.

View File

@ -30,8 +30,8 @@ unit etQuickFixes;
interface
uses
Classes, SysUtils, IDEExternToolIntf, Menus, CodeToolManager, CodeCache,
LazLogger, AvgLvlTree, LazFileUtils;
Classes, SysUtils, IDEExternToolIntf, IDEMsgIntf, Menus, CodeToolManager,
CodeCache, LazLogger, AvgLvlTree, LazFileUtils;
type

View File

@ -32,7 +32,7 @@ interface
uses
Classes, SysUtils, math, SynGutterLineOverview, SynEditMarkupGutterMark,
SynEditMarks, SynEditMiscClasses, SynEditTypes, SynEdit, LazSynEditText,
LazLogger, LazFileUtils, AvgLvlTree, Graphics, Controls, Forms,
LazLogger, LazFileUtils, AvgLvlTree, Graphics, Controls, Forms, ImgList,
IDEExternToolIntf;
type
@ -86,7 +86,7 @@ type
TETMarks = class(TComponent)
private
FImageList: TImageList;
FImageList: TCustomImageList;
fMarkStyles: array[TMessageLineUrgency] of TETMarkStyle;
FOnGetSynEditOfFile: TOnGetSynEditOfFile;
FPriority: integer;
@ -96,7 +96,7 @@ type
destructor Destroy; override;
function CreateMark(MsgLine: TMessageLine; aSynEdit: TSynEdit = nil): TETMark;
procedure RemoveMarks(aSynEdit: TSynEdit);
property ImageList: TImageList read FImageList write FImageList; // must have same Width/Height as the TSynEdits bookmarkimages
property ImageList: TCustomImageList read FImageList write FImageList; // must have same Width/Height as the TSynEdits bookmarkimages
property OnGetSynEditOfFile: TOnGetSynEditOfFile read FOnGetSynEditOfFile write FOnGetSynEditOfFile;
property MarkStyles[Urgency: TMessageLineUrgency]: TETMarkStyle read GetMarkStyles;
property Priority: integer read FPriority write FPriority;
@ -128,7 +128,7 @@ type
function AsString: string;
end;
{ TETSrcChanges }
{ TETSrcChanges - edits of single file}
TETSrcChanges = class
private
@ -155,7 +155,7 @@ type
procedure WriteDebugReport(Title: string);
end;
{ TETMultiSrcChanges }
{ TETMultiSrcChanges - edits of all files }
TETMultiSrcChanges = class
private
@ -727,7 +727,7 @@ end;
function TETSrcChanges.Add(Action: TETSrcChangeAction; FromPosY, FromPosX,
ToPosY, ToPosX: integer): TETSrcChange;
procedure RaiseFromBehindFrom;
procedure RaiseFromBehindToPos;
begin
raise Exception.CreateFmt('TETSrcChanges.Add FromPos=%s,%s behind ToPos=%s,%s',[FromPosY,FromPosX,ToPosY,ToPosX]);
end;
@ -783,7 +783,7 @@ begin
// consistency check
if IsCaretInFront(ToPosY,ToPosX,FromPosY,FromPosX) then
RaiseFromBehindFrom;
RaiseFromBehindToPos;
Result:=TETSrcChange.Create(Action, FromPosY, FromPosX, ToPosY, ToPosX);
@ -922,7 +922,8 @@ begin
end else if aLineBrkCnt<0 then begin
// delete line breaks / empty lines
FChanges.Add(etscaDelete,aLinePos,aBytePos,aLinePos-aLineBrkCnt,1);
end;
end else
exit;
SyncQueued:=true;
end;
@ -967,7 +968,7 @@ begin
fMarkStyles[u]:=TETMarkStyle.Create(u,clNone);
fMarkStyles[mluHint].Color:=clGreen;
fMarkStyles[mluNote].Color:=clGreen;
fMarkStyles[mluWarn].Color:=clYellow;
fMarkStyles[mluWarning].Color:=clYellow;
fMarkStyles[mluError].Color:=clRed;
fMarkStyles[mluFatal].Color:=clRed;
fMarkStyles[mluPanic].Color:=clRed;

View File

@ -45,10 +45,11 @@ uses
IDEMsgIntf, PackageIntf, LazIDEIntf, HelpIntfs, IDEHelpIntf,
// IDE
LazarusIDEStrConsts, TransferMacros, DialogProcs, IDEOptionDefs,
ObjInspExt, EnvironmentOpts, AboutFrm, MsgView, Project, MainBar,
ObjInspExt, EnvironmentOpts, AboutFrm, Project, MainBar,
{$IFDEF EnableNewExtTools}
etMessagesWnd,
{$ELSE}
OutputFilter,
OutputFilter, MsgView,
{$ENDIF}
IDEFPDocFileSearch, PackageDefs, PackageSystem,
HelpOptions, MainIntf, LazConf, HelpFPCMessages, CodeHelp,

View File

@ -66,7 +66,7 @@
<PackageName Value="SynEdit"/>
</Item7>
</RequiredPackages>
<Units Count="108">
<Units Count="109">
<Unit0>
<Filename Value="lazarus.pp"/>
<IsPartOfProject Value="True"/>
@ -797,7 +797,9 @@
<Unit105>
<Filename Value="etmessageframe.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="MessagesFrame"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Frame"/>
<UnitName Value="etMessageFrame"/>
</Unit105>
<Unit106>
@ -810,6 +812,14 @@
<IsPartOfProject Value="True"/>
<UnitName Value="etSrcEditMarks"/>
</Unit107>
<Unit108>
<Filename Value="etmessageswnd.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="MessagesView"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
<UnitName Value="etMessagesWnd"/>
</Unit108>
</Units>
</ProjectOptions>
<CompilerOptions>

View File

@ -107,9 +107,9 @@ uses
CodeToolsDefines, DiffDialog, DiskDiffsDialog, UnitInfoDlg, EditorOptions,
SourceEditProcs, ViewUnit_dlg, FPDocEditWindow,
{$IFDEF EnableNewExtTools}
etQuickFixes,
etQuickFixes, etMessagesWnd,
{$ELSE}
OutputFilter, MsgQuickFixes,
OutputFilter, MsgQuickFixes, MsgView,
{$ENDIF}
// converter
ChgEncodingDlg, ConvertDelphi, ConvCodeTool, MissingPropertiesDlg, LazXMLForms,
@ -143,7 +143,7 @@ uses
package_usage_options, package_description_options, package_integration_options,
package_provides_options, package_i18n_options,
// rest of the ide
Splash, IDEDefs, LazarusIDEStrConsts, LazConf, MsgView, SearchResultView,
Splash, IDEDefs, LazarusIDEStrConsts, LazConf, SearchResultView,
CodeTemplatesDlg, CodeBrowser, FindUnitDlg, InspectChksumChangedDlg,
IdeOptionsDlg, EditDefineTree, PublishModule, EnvironmentOpts, TransferMacros,
KeyMapping, IDETranslations, IDEProcs, ExtToolDialog, ExtToolEditDlg,

View File

@ -65,10 +65,11 @@ uses
LazConf, LazarusIDEStrConsts, ProjectDefs, Project, PublishModule,
BuildLazDialog, Compiler, ComponentReg,
{$IFDEF EnableNewExtTools}
etMessagesWnd,
{$ELSE}
OutputFilter,
OutputFilter, MsgView,
{$ENDIF}
TransferMacros, ObjectInspector, PropEdits, IDEDefs, MsgView,
TransferMacros, ObjectInspector, PropEdits, IDEDefs,
EnvironmentOpts, EditorOptions, CompilerOptions, KeyMapping, IDEProcs,
Debugger, IDEOptionDefs, CodeToolsDefines, Splash, Designer,
SourceEditor, BuildManager, FindInFilesDlg,

View File

@ -32,6 +32,10 @@
}
unit MsgView;
{$IFDEF EnableNewExtTools}
{$Error obsolete}
{$ENDIF}
{$mode objfpc}{$H+}
interface

View File

@ -63,7 +63,13 @@ uses
IDEDialogs, LazarusIDEStrConsts, IDECommands, EditorOptions,
EnvironmentOpts, WordCompletion, FindReplaceDialog, IDEProcs, IDEOptionDefs,
IDEHelpManager, MacroPromptDlg, TransferMacros, CodeContextForm,
SrcEditHintFrm, MsgView, InputHistory,
SrcEditHintFrm,
{$IFDEF EnableNewExtTools}
etMessagesWnd,
{$ELSE}
MsgView,
{$ENDIF}
InputHistory,
CodeMacroPrompt, CodeTemplatesDlg, CodeToolsOptions,
SortSelectionDlg, EncloseSelectionDlg, ConDef, InvertAssignTool,
SourceEditProcs, SourceMarks, CharacterMapDlg, SearchFrm,

View File

@ -41,7 +41,13 @@ uses
SourceEditor, EditorOptions, CustomFormEditor, FormEditor, EmptyMethodsDlg,
BaseDebugManager, ControlSelection, TransferMacros, EnvironmentOpts,
BuildManager, Designer, EditorMacroListViewer, KeywordFuncLists,
FindRenameIdentifier, MsgView, InputHistory, CheckLFMDlg, LCLMemManager,
FindRenameIdentifier,
{$IFDEF EnableNewExtTools}
etMessagesWnd,
{$ELSE}
MsgView,
{$ENDIF}
InputHistory, CheckLFMDlg, LCLMemManager,
CodeToolManager, CodeToolsStructs, ConvCodeTool, CodeCache, CodeTree,
FindDeclarationTool, BasicCodeTools, SynEdit, UnitResources;