* Renamed IDESpotter to IDE scout

git-svn-id: trunk@59264 -
This commit is contained in:
michael 2018-10-07 09:40:03 +00:00
parent e720b191ee
commit 127ad759f1
9 changed files with 162 additions and 156 deletions

16
.gitattributes vendored
View File

@ -2093,14 +2093,14 @@ components/ideintf/toolbarintf.pas svneol=native#text/pascal
components/ideintf/treeviewpropedit.lfm svneol=native#text/plain components/ideintf/treeviewpropedit.lfm svneol=native#text/plain
components/ideintf/treeviewpropedit.pas svneol=native#text/plain components/ideintf/treeviewpropedit.pas svneol=native#text/plain
components/ideintf/unitresources.pas svneol=native#text/plain components/ideintf/unitresources.pas svneol=native#text/plain
components/idespotter/ReadMe.txt svneol=native#text/plain components/idescout/ReadMe.txt svneol=native#text/plain
components/idespotter/frmspotter.lfm svneol=native#text/plain components/idescout/frmscout.lfm svneol=native#text/plain
components/idespotter/frmspotter.pas svneol=native#text/plain components/idescout/frmscout.pas svneol=native#text/plain
components/idespotter/idespotter.lpk svneol=native#text/plain components/idescout/idescout.lpk svneol=native#text/plain
components/idespotter/idespotter.pas svneol=native#text/plain components/idescout/idescout.pas svneol=native#text/plain
components/idespotter/idespotteroptions.lfm svneol=native#text/plain components/idescout/idescoutoptions.lfm svneol=native#text/plain
components/idespotter/idespotteroptions.pas svneol=native#text/plain components/idescout/idescoutoptions.pas svneol=native#text/plain
components/idespotter/regidespotter.pas svneol=native#text/plain components/idescout/regidescout.pas svneol=native#text/plain
components/images/examples/README.txt svneol=native#text/plain components/images/examples/README.txt svneol=native#text/plain
components/images/examples/imagesexample.lpi svneol=native#text/plain components/images/examples/imagesexample.lpi svneol=native#text/plain
components/images/examples/imagesexample.lpr svneol=native#text/pascal components/images/examples/imagesexample.lpr svneol=native#text/pascal

View File

@ -8,13 +8,19 @@ Shift-Alt-P on all other platforms.
Start typing, and the available commands will be filtered. Start typing, and the available commands will be filtered.
If you type multiple words, all words must match. If you type multiple words, all words must match.
The list of recent files/packages/projects is also searchable. Using the
enter key will open the selected file.
The list of installed components is also searchable. Using the enter key
will drop the selected component on the currently designed form (if any is
active) or will select it on the component palette. This is configurable.
The key combination can be configured in the key options, search for The key combination can be configured in the key options, search for
spotter. scout.
You can set You can set
* the color of the matches, * the color of the matches,
* color of shortcut key (and whether it should be shown at all) * color of shortcut key (and whether it should be shown at all)
in the IDE options. in the IDE options.
* What to search (commands/recent items/components)
Todo: Search recent files/packages

View File

@ -1,10 +1,10 @@
object SpotterForm: TSpotterForm object IDEScoutForm: TIDEScoutForm
Left = 404 Left = 404
Height = 232 Height = 232
Top = 195 Top = 195
Width = 497 Width = 497
BorderStyle = bsSizeToolWin BorderStyle = bsSizeToolWin
Caption = 'Spotter' Caption = 'IDE Scout'
ClientHeight = 232 ClientHeight = 232
ClientWidth = 497 ClientWidth = 497
FormStyle = fsStayOnTop FormStyle = fsStayOnTop

View File

@ -1,4 +1,4 @@
{ Form for the spotter window { Form for the scout window
Copyright (C) 2018 Michael van Canneyt michael@freepascal.org Copyright (C) 2018 Michael van Canneyt michael@freepascal.org
@ -27,7 +27,7 @@
along with this library; if not, write to the Free Software Foundation, along with this library; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1335, USA. Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1335, USA.
} }
unit frmspotter; unit frmscout;
{$mode objfpc}{$H+} {$mode objfpc}{$H+}
@ -38,8 +38,8 @@ uses
StdCtrls, EditBtn, IDECommands, LazIDEIntf, Types, LCLType, IDEOptionsIntf, IDEOptEditorIntf; StdCtrls, EditBtn, IDECommands, LazIDEIntf, Types, LCLType, IDEOptionsIntf, IDEOptEditorIntf;
Type Type
TSpotHighlight = (shCommands,shRecentProjects,shRecentFiles,shRecentPackages,shComponents); TScoutTerrain = (stCommands,stRecentProjects,stRecentFiles,stRecentPackages,stComponents);
TSpotHighlights = set of TSpotHighlight; TScoutTerrains = set of TScoutTerrain;
{ TSearchItem } { TSearchItem }
TMatchPos = Array of Integer; TMatchPos = Array of Integer;
@ -98,9 +98,9 @@ Type
end; end;
{ TSpotterForm } { TIDEScoutForm }
TSpotterForm = class(TForm) TIDEScoutForm = class(TForm)
ESearch: TEditButton; ESearch: TEditButton;
LBMatches: TListBox; LBMatches: TListBox;
procedure ECommandChange(Sender: TObject); procedure ECommandChange(Sender: TObject);
@ -118,7 +118,7 @@ Type
); );
private private
FRefresh, FRefresh,
FHighlights: TSpotHighlights; FHighlights: TScoutTerrains;
FKeyStrokeColor: TColor; FKeyStrokeColor: TColor;
FMatchColor: TColor; FMatchColor: TColor;
FShowCategory: Boolean; FShowCategory: Boolean;
@ -144,26 +144,26 @@ Type
Property ShowShortCutKey : Boolean Read FShowShortCutKey Write FShowShortCutKey; Property ShowShortCutKey : Boolean Read FShowShortCutKey Write FShowShortCutKey;
property KeyStrokeColor : TColor Read FKeyStrokeColor Write FKeyStrokeColor; property KeyStrokeColor : TColor Read FKeyStrokeColor Write FKeyStrokeColor;
property MatchColor : TColor Read FMatchColor Write FMatchColor; property MatchColor : TColor Read FMatchColor Write FMatchColor;
Property Highlights : TSpotHighlights Read FHighlights Write FHighlights; Property Highlights : TScoutTerrains Read FHighlights Write FHighlights;
end; end;
Const Const
AllSpots = [shCommands,shRecentProjects,shRecentFiles,shRecentPackages]; AllTerrains = [stCommands,stRecentProjects,stRecentFiles,stRecentPackages];
Var Var
SpotHighlights : TSpotHighlights = AllSpots; ScoutTerrains : TScoutTerrains = AllTerrains;
ShowCmdCategory : Boolean = True; ShowCmdCategory : Boolean = True;
ShowShortCutKey : Boolean = True; ShowShortCutKey : Boolean = True;
MatchColor : TColor = clMaroon; MatchColor : TColor = clMaroon;
KeyStrokeColor : TColor = clNavy; KeyStrokeColor : TColor = clNavy;
SettingsClass : TAbstractIDEOptionsEditorClass = Nil; SettingsClass : TAbstractIDEOptionsEditorClass = Nil;
Procedure ShowSpotterForm; Procedure ShowScoutForm;
Procedure ApplySpotterOptions; Procedure ApplyScoutOptions;
Procedure SaveSpotterOptions; Procedure SaveScoutOptions;
procedure LoadSpotterOptions; procedure LoadScoutOptions;
procedure CreateSpotterWindow(Sender: TObject; aFormName: string; var AForm: TCustomForm; DoDisableAutoSizing: boolean); procedure CreateScoutWindow(Sender: TObject; aFormName: string; var AForm: TCustomForm; DoDisableAutoSizing: boolean);
implementation implementation
@ -173,11 +173,11 @@ Uses
{$R *.lfm} {$R *.lfm}
var var
SpotterForm: TSpotterForm; ScoutForm: TIDEScoutForm;
Const Const
IDESpotterOptsFile = 'idespotter.xml'; IDEScoutOptsFile = 'idescout.xml';
KeyHighLight = 'highlight/'; KeyHighLight = 'highlight/';
KeyShowCategory = 'showcategory/value'; KeyShowCategory = 'showcategory/value';
@ -189,23 +189,23 @@ Const
KeyDropComponent = 'Components/Drop'; KeyDropComponent = 'Components/Drop';
HighlightNames : Array[TSpotHighlight] of string = HighlightNames : Array[TScoutTerrain] of string =
('Commands','Projects','Files','Packages','Components'); ('Commands','Projects','Files','Packages','Components');
procedure LoadSpotterOptions; procedure LoadScoutOptions;
var var
Cfg: TConfigStorage; Cfg: TConfigStorage;
SH : TSpotHighlight; SH : TScoutTerrain;
SHS : TSpotHighlights; SHS : TScoutTerrains;
begin begin
Cfg:=GetIDEConfigStorage(IDESpotterOptsFile,true); Cfg:=GetIDEConfigStorage(IDEScoutOptsFile,true);
try try
SHS:=[]; SHS:=[];
for SH in TSpotHighlight do for SH in TScoutTerrain do
if Cfg.GetValue(KeyHighLight+HighlightNames[SH],SH In SpotHighlights) then if Cfg.GetValue(KeyHighLight+HighlightNames[SH],SH In ScoutTerrains) then
Include(SHS,SH); Include(SHS,SH);
SpotHighlights:=SHS; ScoutTerrains:=SHS;
TComponentItem.DefaultWidth:=Cfg.GetValue(KeyDefaultComponentWidth,TComponentItem.DefaultWidth); TComponentItem.DefaultWidth:=Cfg.GetValue(KeyDefaultComponentWidth,TComponentItem.DefaultWidth);
TComponentItem.DefaultHeight:=Cfg.GetValue(KeyDefaultComponentHeight,TComponentItem.DefaultHeight); TComponentItem.DefaultHeight:=Cfg.GetValue(KeyDefaultComponentHeight,TComponentItem.DefaultHeight);
TComponentItem.Drop:=Cfg.GetValue(KeyDropComponent,TComponentItem.Drop); TComponentItem.Drop:=Cfg.GetValue(KeyDropComponent,TComponentItem.Drop);
@ -213,23 +213,23 @@ begin
ShowShortCutKey:=Cfg.GetValue(KeyShowShortCut,ShowShortCutKey); ShowShortCutKey:=Cfg.GetValue(KeyShowShortCut,ShowShortCutKey);
KeyStrokeColor:=TColor(Cfg.GetValue(KeyShortCutColor,Ord(KeyStrokeColor))); KeyStrokeColor:=TColor(Cfg.GetValue(KeyShortCutColor,Ord(KeyStrokeColor)));
MatchColor:=TColor(Cfg.GetValue(KeyMatchColor,Ord(MatchColor))); MatchColor:=TColor(Cfg.GetValue(KeyMatchColor,Ord(MatchColor)));
ApplySpotterOptions; ApplyScoutOptions;
finally finally
Cfg.Free; Cfg.Free;
end; end;
end; end;
procedure SaveSpotterOptions; procedure SaveScoutOptions;
var var
Cfg: TConfigStorage; Cfg: TConfigStorage;
SH : TSpotHighlight; SH : TScoutTerrain;
begin begin
Cfg:=GetIDEConfigStorage(IDESpotterOptsFile,false); Cfg:=GetIDEConfigStorage(IDEScoutOptsFile,false);
try try
for SH in TSpotHighlight do for SH in TScoutTerrain do
Cfg.SetValue(KeyHighLight+HighlightNames[SH],SH In SpotHighlights); Cfg.SetValue(KeyHighLight+HighlightNames[SH],SH In ScoutTerrains);
Cfg.SetValue(KeyDefaultComponentWidth,TComponentItem.DefaultWidth); Cfg.SetValue(KeyDefaultComponentWidth,TComponentItem.DefaultWidth);
Cfg.SetValue(KeyDefaultComponentHeight,TComponentItem.DefaultHeight); Cfg.SetValue(KeyDefaultComponentHeight,TComponentItem.DefaultHeight);
Cfg.SetValue(KeyDropComponent,TComponentItem.Drop); Cfg.SetValue(KeyDropComponent,TComponentItem.Drop);
@ -242,43 +242,43 @@ begin
end; end;
end; end;
Procedure ApplySpotterOptions; Procedure ApplyScoutOptions;
begin begin
if Assigned(SpotterForm) then if Assigned(ScoutForm) then
begin begin
SpotterForm.ShowCategory:=ShowCmdCategory; ScoutForm.ShowCategory:=ShowCmdCategory;
SpotterForm.MatchColor:=MatchColor; ScoutForm.MatchColor:=MatchColor;
SpotterForm.KeyStrokeColor:=KeyStrokeColor; ScoutForm.KeyStrokeColor:=KeyStrokeColor;
SpotterForm.ShowShortCutKey:=ShowShortCutKey; ScoutForm.ShowShortCutKey:=ShowShortCutKey;
SpotterForm.Highlights:=SpotHighlights; ScoutForm.Highlights:=ScoutTerrains;
SpotterForm.Initialize; ScoutForm.Initialize;
end; end;
end; end;
Procedure MaybeCreateSpotterForm; Procedure MaybeCreateScoutForm;
begin begin
if SpotterForm=Nil then if ScoutForm=Nil then
begin begin
SpotterForm:=TSpotterForm.Create(Application); ScoutForm:=TIDEScoutForm.Create(Application);
ApplySpotterOptions; ApplyScoutOptions;
end; end;
end; end;
Procedure ShowSpotterForm; Procedure ShowScoutForm;
begin begin
MaybeCreateSpotterForm; MaybeCreateScoutForm;
IDEWindowCreators.ShowForm(SpotterForm,True,vmAlwaysMoveToVisible); IDEWindowCreators.ShowForm(ScoutForm,True,vmAlwaysMoveToVisible);
end; end;
procedure CreateSpotterWindow(Sender: TObject; aFormName: string; procedure CreateScoutWindow(Sender: TObject; aFormName: string;
var AForm: TCustomForm; DoDisableAutoSizing: boolean); var AForm: TCustomForm; DoDisableAutoSizing: boolean);
begin begin
MaybeCreateSpotterForm; MaybeCreateScoutForm;
aForm:=SpotterForm; aForm:=ScoutForm;
end; end;
{ TComponentItem } { TComponentItem }
@ -378,14 +378,14 @@ begin
Inherited; Inherited;
end; end;
{ TSpotterForm } { TIDEScoutForm }
procedure TSpotterForm.ECommandChange(Sender: TObject); procedure TIDEScoutForm.ECommandChange(Sender: TObject);
begin begin
FilterList(ESearch.Text); FilterList(ESearch.Text);
end; end;
procedure TSpotterForm.ECommandKeyDown(Sender: TObject; var Key: Word; procedure TIDEScoutForm.ECommandKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState); Shift: TShiftState);
begin begin
Case Key of Case Key of
@ -410,25 +410,25 @@ begin
end; end;
end; end;
procedure TSpotterForm.ESearchButtonClick(Sender: TObject); procedure TIDEScoutForm.ESearchButtonClick(Sender: TObject);
begin begin
LazarusIDE.DoOpenIDEOptions(SettingsClass,'IDE Spotter'); LazarusIDE.DoOpenIDEOptions(SettingsClass,'IDE Scout');
Close; Close;
end; end;
procedure TSpotterForm.FormActivate(Sender: TObject); procedure TIDEScoutForm.FormActivate(Sender: TObject);
begin begin
ESearch.SetFocus; ESearch.SetFocus;
end; end;
procedure TSpotterForm.FormClose(Sender: TObject; procedure TIDEScoutForm.FormClose(Sender: TObject;
var CloseAction: TCloseAction); var CloseAction: TCloseAction);
begin begin
CloseAction:=caHide; CloseAction:=caHide;
end; end;
procedure TSpotterForm.RefreshCaption(aCount : Integer); procedure TIDEScoutForm.RefreshCaption(aCount : Integer);
begin begin
if ACount=-1 then if ACount=-1 then
@ -437,7 +437,7 @@ begin
Caption:=FOrgCaption+Format(' (%d/%d)',[aCount,FSearchItems.Count]); Caption:=FOrgCaption+Format(' (%d/%d)',[aCount,FSearchItems.Count]);
end; end;
procedure TSpotterForm.FilterList(aSearchTerm: String); procedure TIDEScoutForm.FilterList(aSearchTerm: String);
Var Var
i : Integer; i : Integer;
@ -497,7 +497,7 @@ begin
end; end;
end; end;
procedure TSpotterForm.AddFileToList(aFileName: String; aType: TIDERecentHandler; CheckDuplicate : Boolean = False); procedure TIDEScoutForm.AddFileToList(aFileName: String; aType: TIDERecentHandler; CheckDuplicate : Boolean = False);
Var Var
F : TOpenFileItem; F : TOpenFileItem;
@ -522,14 +522,14 @@ begin
end; end;
procedure TSpotterForm.FormCreate(Sender: TObject); procedure TIDEScoutForm.FormCreate(Sender: TObject);
begin begin
FSearchItems:=TStringList.Create; FSearchItems:=TStringList.Create;
FSearchItems.OwnsObjects:=True; FSearchItems.OwnsObjects:=True;
FOrgCaption:=Caption; FOrgCaption:=Caption;
end; end;
procedure TSpotterForm.FormDestroy(Sender: TObject); procedure TIDEScoutForm.FormDestroy(Sender: TObject);
begin begin
With IDEEnvironmentOptions do With IDEEnvironmentOptions do
begin begin
@ -538,10 +538,10 @@ begin
RemoveHandlerAddToRecentPackageFiles(@ProjectOpened); RemoveHandlerAddToRecentPackageFiles(@ProjectOpened);
end; end;
FreeAndNil(FSearchItems); FreeAndNil(FSearchItems);
SpotterForm:=Nil; ScoutForm:=Nil;
end; end;
procedure TSpotterForm.FormShow(Sender: TObject); procedure TIDEScoutForm.FormShow(Sender: TObject);
begin begin
ESearch.Clear; ESearch.Clear;
@ -551,13 +551,13 @@ begin
RefreshList; RefreshList;
end; end;
procedure TSpotterForm.LBMatchesClick(Sender: TObject); procedure TIDEScoutForm.LBMatchesClick(Sender: TObject);
begin begin
ExecuteSelected; ExecuteSelected;
end; end;
procedure TSpotterForm.LBMatchesDrawItem(Control: TWinControl; Index: Integer; procedure TIDEScoutForm.LBMatchesDrawItem(Control: TWinControl; Index: Integer;
ARect: TRect; State: TOwnerDrawState); ARect: TRect; State: TOwnerDrawState);
Const Const
@ -616,7 +616,7 @@ begin
end; end;
end; end;
procedure TSpotterForm.ExecuteSelected; procedure TIDEScoutForm.ExecuteSelected;
Var Var
idx: Integer; idx: Integer;
@ -638,14 +638,14 @@ begin
end; end;
procedure TSpotterForm.LBMatchesKeyUp(Sender: TObject; var Key: Word; procedure TIDEScoutForm.LBMatchesKeyUp(Sender: TObject; var Key: Word;
Shift: TShiftState); Shift: TShiftState);
begin begin
if Key=VK_ESCAPE then if Key=VK_ESCAPE then
Hide; Hide;
end; end;
procedure TSpotterForm.FillRecent(aType : TIDERecentHandler); procedure TIDEScoutForm.FillRecent(aType : TIDERecentHandler);
Var Var
L : TStringList; L : TStringList;
@ -662,7 +662,7 @@ begin
end; end;
end; end;
procedure TSpotterForm.FillComponents; procedure TIDEScoutForm.FillComponents;
Var Var
I : integer; I : integer;
@ -685,7 +685,7 @@ begin
end; end;
end; end;
procedure TSpotterForm.ClearRefreshableItems; procedure TIDEScoutForm.ClearRefreshableItems;
Var Var
I : Integer; I : Integer;
@ -694,11 +694,11 @@ Var
begin begin
SH:=[]; SH:=[];
if shRecentFiles in FRefresh then if stRecentFiles in FRefresh then
Include(SH,irhOpenFiles); Include(SH,irhOpenFiles);
if shRecentProjects in FRefresh then if stRecentProjects in FRefresh then
Include(SH,irhProjectFiles); Include(SH,irhProjectFiles);
if shRecentPackages in FRefresh then if stRecentPackages in FRefresh then
Include(SH,irhPackageFiles); Include(SH,irhPackageFiles);
I:=FSearchItems.Count-1; I:=FSearchItems.Count-1;
While I>=0 do While I>=0 do
@ -711,18 +711,18 @@ begin
end; end;
end; end;
procedure TSpotterForm.RefreshList; procedure TIDEScoutForm.RefreshList;
begin begin
FSearchItems.Sorted:=False; FSearchItems.Sorted:=False;
FSearchItems.BeginUpdate; FSearchItems.BeginUpdate;
try try
ClearRefreshableItems; ClearRefreshableItems;
if shRecentFiles in FRefresh then if stRecentFiles in FRefresh then
FillRecent(irhOpenFiles); FillRecent(irhOpenFiles);
if shRecentProjects in FRefresh then if stRecentProjects in FRefresh then
FillRecent(irhProjectFiles); FillRecent(irhProjectFiles);
if shRecentPackages in FRefresh then if stRecentPackages in FRefresh then
FillRecent(irhPackageFiles); FillRecent(irhPackageFiles);
FRefresh:=[]; FRefresh:=[];
finally finally
@ -731,27 +731,27 @@ begin
end; end;
end; end;
procedure TSpotterForm.Initialize; procedure TIDEScoutForm.Initialize;
begin begin
FSearchItems.Sorted:=False; FSearchItems.Sorted:=False;
FSearchItems.BeginUpdate; FSearchItems.BeginUpdate;
try try
FSearchItems.Clear; FSearchItems.Clear;
if shCommands in Highlights then if stCommands in Highlights then
FillCommands; FillCommands;
if shComponents in Highlights then if stComponents in Highlights then
FillComponents; FillComponents;
if shRecentFiles in Highlights then if stRecentFiles in Highlights then
begin begin
IDEEnvironmentOptions.AddHandlerAddToRecentOpenFiles(@FileOpened,False); IDEEnvironmentOptions.AddHandlerAddToRecentOpenFiles(@FileOpened,False);
FillRecent(irhOpenFiles); FillRecent(irhOpenFiles);
end; end;
if shRecentProjects in Highlights then if stRecentProjects in Highlights then
begin begin
IDEEnvironmentOptions.AddHandlerAddToRecentProjectFiles(@ProjectOpened,False); IDEEnvironmentOptions.AddHandlerAddToRecentProjectFiles(@ProjectOpened,False);
FillRecent(irhProjectFiles); FillRecent(irhProjectFiles);
end; end;
if shRecentPackages in Highlights then if stRecentPackages in Highlights then
begin begin
IDEEnvironmentOptions.AddHandlerAddToRecentPackageFiles(@PackageOpened,False); IDEEnvironmentOptions.AddHandlerAddToRecentPackageFiles(@PackageOpened,False);
FillRecent(irhPackageFiles); FillRecent(irhPackageFiles);
@ -762,7 +762,7 @@ begin
end; end;
end; end;
function TSpotterForm.GetCommandCategoryString(Cmd: TIDECommand): String; function TIDEScoutForm.GetCommandCategoryString(Cmd: TIDECommand): String;
Const Const
Cmds = ' commands'; Cmds = ' commands';
@ -789,25 +789,25 @@ begin
end; end;
end; end;
procedure TSpotterForm.PackageOpened(Sender: TObject; AFileName: string; procedure TIDEScoutForm.PackageOpened(Sender: TObject; AFileName: string;
var AAllow: Boolean); var AAllow: Boolean);
begin begin
Include(FRefresh,shRecentPackages); Include(FRefresh,stRecentPackages);
end; end;
procedure TSpotterForm.FileOpened(Sender: TObject; AFileName: string; procedure TIDEScoutForm.FileOpened(Sender: TObject; AFileName: string;
var AAllow: Boolean); var AAllow: Boolean);
begin begin
Include(FRefresh,shRecentFiles); Include(FRefresh,stRecentFiles);
end; end;
procedure TSpotterForm.ProjectOpened(Sender: TObject; AFileName: string; procedure TIDEScoutForm.ProjectOpened(Sender: TObject; AFileName: string;
var AAllow: Boolean); var AAllow: Boolean);
begin begin
Include(FRefresh,shRecentProjects); Include(FRefresh,stRecentProjects);
end; end;
procedure TSpotterForm.FillCommands; procedure TIDEScoutForm.FillCommands;
var var
I, J: Integer; I, J: Integer;
Itm : TSearchItem; Itm : TSearchItem;

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<CONFIG> <CONFIG>
<Package Version="4"> <Package Version="4">
<Name Value="idespotter"/> <Name Value="idescout"/>
<Type Value="DesignTime"/> <Type Value="DesignTime"/>
<Author Value="Michael Van Canneyt"/> <Author Value="Michael Van Canneyt"/>
<CompilerOptions> <CompilerOptions>
@ -10,27 +10,27 @@
<UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/> <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/>
</SearchPaths> </SearchPaths>
</CompilerOptions> </CompilerOptions>
<Description Value="IDE addon showing the &quot;IDE Spotter&quot; - a quick search window for IDE commands. <Description Value="IDE addon showing the &quot;IDE Scout&quot; - a quick search window for IDE commands.
See the ReadMe.txt included in the package for a more detailed explanation."/> See the ReadMe.txt included in the package for a more detailed explanation."/>
<License Value="Modified LGPL-2"/> <License Value="Modified LGPL-2"/>
<Version Release="1"/> <Version Release="1"/>
<Files Count="4"> <Files Count="4">
<Item1> <Item1>
<Filename Value="regidespotter.pas"/> <Filename Value="regidescout.pas"/>
<HasRegisterProc Value="True"/> <HasRegisterProc Value="True"/>
<UnitName Value="RegIDESpotter"/> <UnitName Value="RegIDEScout"/>
</Item1> </Item1>
<Item2> <Item2>
<Filename Value="frmspotter.pas"/> <Filename Value="frmscout.pas"/>
<UnitName Value="frmspotter"/> <UnitName Value="frmscout"/>
</Item2> </Item2>
<Item3> <Item3>
<Filename Value="ReadMe.txt"/> <Filename Value="ReadMe.txt"/>
<Type Value="Binary"/> <Type Value="Binary"/>
</Item3> </Item3>
<Item4> <Item4>
<Filename Value="idespotteroptions.pas"/> <Filename Value="idescoutoptions.pas"/>
<UnitName Value="IDESPotterOptions"/> <UnitName Value="IDEScoutOptions"/>
</Item4> </Item4>
</Files> </Files>
<i18n> <i18n>

View File

@ -2,21 +2,21 @@
This source is only used to compile and install the package. This source is only used to compile and install the package.
} }
unit idespotter; unit idescout;
{$warn 5023 off : no warning about unused units} {$warn 5023 off : no warning about unused units}
interface interface
uses uses
RegIDESpotter, frmspotter, IDESPotterOptions, LazarusPackageIntf; RegIDEScout, frmscout, IDEScoutOptions, LazarusPackageIntf;
implementation implementation
procedure Register; procedure Register;
begin begin
RegisterUnit('RegIDESpotter', @RegIDESpotter.Register); RegisterUnit('RegIDEScout', @RegIDEScout.Register);
end; end;
initialization initialization
RegisterPackage('idespotter', @Register); RegisterPackage('idescout', @Register);
end. end.

View File

@ -1,4 +1,4 @@
object IDESpotterOptionsFrame: TIDESpotterOptionsFrame object IDEScoutOptionsFrame: TIDEScoutOptionsFrame
Left = 0 Left = 0
Height = 504 Height = 504
Top = 0 Top = 0

View File

@ -1,4 +1,4 @@
{ IDE options frame for IDE Spotter options { IDE options frame for IDE Scout options
Copyright (C) 2018 Michael van Canneyt michael@freepascal.org Copyright (C) 2018 Michael van Canneyt michael@freepascal.org
@ -27,7 +27,7 @@
along with this library; if not, write to the Free Software Foundation, along with this library; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1335, USA. Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1335, USA.
} }
unit IDESPotterOptions; unit IDEScoutOptions;
{$mode objfpc}{$H+} {$mode objfpc}{$H+}
{$Inline on} {$Inline on}
@ -39,13 +39,13 @@ uses
// LCL // LCL
Forms, StdCtrls, Dialogs, Spin, ExtCtrls, ColorBox, Forms, StdCtrls, Dialogs, Spin, ExtCtrls, ColorBox,
// IdeIntf // IdeIntf
IDEOptionsIntf, IDEOptEditorIntf, IDEUtils, frmSpotter; IDEOptionsIntf, IDEOptEditorIntf, IDEUtils, frmScout;
Type Type
{ TIDESpotterOptionsFrame } { TIDEScoutOptionsFrame }
TIDESpotterOptionsFrame = class(TAbstractIDEOptionsEditor) TIDEScoutOptionsFrame = class(TAbstractIDEOptionsEditor)
CGSearch: TCheckGroup; CGSearch: TCheckGroup;
CBShowShortCut: TCheckBox; CBShowShortCut: TCheckBox;
CBMatchColor: TColorBox; CBMatchColor: TColorBox;
@ -76,40 +76,40 @@ implementation
{$R *.lfm} {$R *.lfm}
{ TIDESpotterOptionsFrame } { TIDEScoutOptionsFrame }
procedure TIDESpotterOptionsFrame.CGSearchClick(Sender: TObject); procedure TIDEScoutOptionsFrame.CGSearchClick(Sender: TObject);
begin begin
end; end;
procedure TIDESpotterOptionsFrame.CGSearchItemClick(Sender: TObject; procedure TIDEScoutOptionsFrame.CGSearchItemClick(Sender: TObject;
Index: integer); Index: integer);
begin begin
if Index=Ord(shComponents) then if Index=Ord(stComponents) then
GBComponents.Enabled:=CGsearch.Checked[Index]; GBComponents.Enabled:=CGsearch.Checked[Index];
end; end;
function TIDESpotterOptionsFrame.GetTitle: String; function TIDEScoutOptionsFrame.GetTitle: String;
begin begin
Result:='IDE Spotter'; Result:='IDE Scout';
end; end;
procedure TIDESpotterOptionsFrame.Setup(ADialog: TAbstractOptionsEditorDialog); procedure TIDEScoutOptionsFrame.Setup(ADialog: TAbstractOptionsEditorDialog);
begin begin
// Do nothing, maybe localize ? // Do nothing, maybe localize ?
end; end;
procedure TIDESpotterOptionsFrame.ReadSettings(AOptions: TAbstractIDEOptions); procedure TIDEScoutOptionsFrame.ReadSettings(AOptions: TAbstractIDEOptions);
Var Var
sh : TSpotHighlight; st : TScoutTerrain;
begin begin
for SH in TSpotHighlight do for St in TScoutTerrain do
CGSearch.Checked[Ord(SH)]:=SH in SpotHighlights; CGSearch.Checked[Ord(St)]:=St in ScoutTerrains;
CBSelectComponent.Checked:=Not TComponentItem.Drop; CBSelectComponent.Checked:=Not TComponentItem.Drop;
SEComponentDefaultHeight.Value:=TComponentItem.DefaultHeight; SEComponentDefaultHeight.Value:=TComponentItem.DefaultHeight;
SEComponentDefaultWidth.Value:=TComponentItem.DefaultWidth; SEComponentDefaultWidth.Value:=TComponentItem.DefaultWidth;
@ -119,18 +119,18 @@ begin
CBShortCutColor.Selected := KeyStrokeColor; CBShortCutColor.Selected := KeyStrokeColor;
end; end;
procedure TIDESpotterOptionsFrame.WriteSettings(AOptions: TAbstractIDEOptions); procedure TIDEScoutOptionsFrame.WriteSettings(AOptions: TAbstractIDEOptions);
Var Var
sh : TSpotHighlight; st : TScoutTerrain;
SHS : TSpotHighlights; STS : TScoutTerrains;
begin begin
SHS:=[]; STS:=[];
for SH in TSpotHighlight do for ST in TScoutTerrain do
if CGSearch.Checked[Ord(SH)] then if CGSearch.Checked[Ord(ST)] then
Include(SHS,SH); Include(STS,ST);
SpotHighlights:=SHS; ScoutTerrains:=STS;
TComponentItem.Drop:=not CBSelectComponent.Checked; TComponentItem.Drop:=not CBSelectComponent.Checked;
TComponentItem.DefaultHeight:=SEComponentDefaultHeight.Value; TComponentItem.DefaultHeight:=SEComponentDefaultHeight.Value;
TComponentItem.DefaultWidth:=SEComponentDefaultWidth.Value; TComponentItem.DefaultWidth:=SEComponentDefaultWidth.Value;
@ -138,11 +138,11 @@ begin
ShowShortCutKey:=CBShowShortCut.Checked; ShowShortCutKey:=CBShowShortCut.Checked;
MatchColor:=CBMatchColor.Selected; MatchColor:=CBMatchColor.Selected;
KeyStrokeColor:=CBShortCutColor.Selected; KeyStrokeColor:=CBShortCutColor.Selected;
SaveSpotterOptions; SaveScoutOptions;
ApplySpotterOptions; ApplyScoutOptions;
end; end;
class function TIDESpotterOptionsFrame.SupportedOptionsClass: TAbstractIDEOptionsClass; class function TIDEScoutOptionsFrame.SupportedOptionsClass: TAbstractIDEOptionsClass;
begin begin
Result:=IDEEditorGroups.GetByIndex(GroupEnvironment)^.GroupClass; Result:=IDEEditorGroups.GetByIndex(GroupEnvironment)^.GroupClass;
end; end;

View File

@ -1,4 +1,4 @@
{ Register IDE Spotter unit { Register IDE Scout unit
Copyright (C) 2018 Michael van Canneyt michael@freepascal.org Copyright (C) 2018 Michael van Canneyt michael@freepascal.org
@ -27,7 +27,7 @@
along with this library; if not, write to the Free Software Foundation, along with this library; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1335, USA. Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1335, USA.
} }
unit RegIDESpotter; unit RegIDEScout;
{$mode objfpc}{$H+} {$mode objfpc}{$H+}
@ -41,12 +41,12 @@ Procedure Register;
implementation implementation
uses IDESpotterOptions,forms, graphics,lcltype,idecommands,toolbarintf, idewindowintf, menuintf, frmspotter; uses IDEScoutOptions,forms, graphics,lcltype,idecommands,toolbarintf, idewindowintf, menuintf, frmscout;
Procedure IdeMenuClicked(Sender : TObject); Procedure IdeMenuClicked(Sender : TObject);
begin begin
ShowSpotterForm; ShowScoutForm;
end; end;
@ -64,27 +64,27 @@ var
IDEShortCutX: TIDEShortCut; IDEShortCutX: TIDEShortCut;
IDECommandCategory: TIDECommandCategory; IDECommandCategory: TIDECommandCategory;
IDECommand: TIDECommand; IDECommand: TIDECommand;
IDESpotteroptionsFrameID: Integer = 2000; IDEScoutOptionsFrameID: Integer = 2000;
begin begin
LoadSpotterOptions; LoadScoutOptions;
IDEShortCutX := IDEShortCut(VK_P, ShiftKeys, VK_UNKNOWN, []); IDEShortCutX := IDEShortCut(VK_P, ShiftKeys, VK_UNKNOWN, []);
IDECommandCategory := IDECommandList.FindCategoryByName(CommandCategoryViewName); IDECommandCategory := IDECommandList.FindCategoryByName(CommandCategoryViewName);
if IDECommandCategory <> nil then if IDECommandCategory <> nil then
begin begin
IDECommand := RegisterIDECommand(IDECommandCategory, 'Spotter', 'Open Spotter', IDECommand := RegisterIDECommand(IDECommandCategory, 'IDEScout', 'Open IDE Scout',
IDEShortCutX, nil, @IDEMenuClicked); IDEShortCutX, nil, @IDEMenuClicked);
if IDECommand <> nil then if IDECommand <> nil then
RegisterIDEButtonCommand(IDECommand); RegisterIDEButtonCommand(IDECommand);
end; end;
IDESpotteroptionsFrameID:=RegisterIDEOptionsEditor(GroupEnvironment,TIDESpotterOptionsFrame, IDEScoutOptionsFrameID:=RegisterIDEOptionsEditor(GroupEnvironment,TIDEScoutOptionsFrame,
IDESpotteroptionsFrameID)^.Index; IDEScoutOptionsFrameID)^.Index;
RegisterIDEMenuCommand(itmViewIDEInternalsWindows, 'Spotter', 'Spotter', nil, RegisterIDEMenuCommand(itmViewIDEInternalsWindows, 'IDEScout', 'Open IDE Scout', nil,
@IDEMenuClicked,IDECommand); @IDEMenuClicked,IDECommand);
IDEWindowCreators.Add('IDESpotter',@CreateSpotterWindow,nil,'40%','10%','+500','+240'); IDEWindowCreators.Add('IDEScout',@CreateScoutWindow,nil,'40%','10%','+500','+240');
end; end;
Initialization Initialization
SettingsClass:=TIDESpotterOptionsFrame; SettingsClass:=TIDEScoutOptionsFrame;
end. end.