diff --git a/.gitattributes b/.gitattributes index 04dd046922..40914c592b 100644 --- a/.gitattributes +++ b/.gitattributes @@ -2093,14 +2093,14 @@ components/ideintf/toolbarintf.pas svneol=native#text/pascal components/ideintf/treeviewpropedit.lfm svneol=native#text/plain components/ideintf/treeviewpropedit.pas svneol=native#text/plain components/ideintf/unitresources.pas svneol=native#text/plain -components/idespotter/ReadMe.txt svneol=native#text/plain -components/idespotter/frmspotter.lfm svneol=native#text/plain -components/idespotter/frmspotter.pas svneol=native#text/plain -components/idespotter/idespotter.lpk svneol=native#text/plain -components/idespotter/idespotter.pas svneol=native#text/plain -components/idespotter/idespotteroptions.lfm svneol=native#text/plain -components/idespotter/idespotteroptions.pas svneol=native#text/plain -components/idespotter/regidespotter.pas svneol=native#text/plain +components/idescout/ReadMe.txt svneol=native#text/plain +components/idescout/frmscout.lfm svneol=native#text/plain +components/idescout/frmscout.pas svneol=native#text/plain +components/idescout/idescout.lpk svneol=native#text/plain +components/idescout/idescout.pas svneol=native#text/plain +components/idescout/idescoutoptions.lfm svneol=native#text/plain +components/idescout/idescoutoptions.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/imagesexample.lpi svneol=native#text/plain components/images/examples/imagesexample.lpr svneol=native#text/pascal diff --git a/components/idespotter/ReadMe.txt b/components/idescout/ReadMe.txt similarity index 57% rename from components/idespotter/ReadMe.txt rename to components/idescout/ReadMe.txt index e204f6304c..457e0216d8 100644 --- a/components/idespotter/ReadMe.txt +++ b/components/idescout/ReadMe.txt @@ -8,13 +8,19 @@ Shift-Alt-P on all other platforms. Start typing, and the available commands will be filtered. 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 -spotter. +scout. You can set * the color of the matches, * color of shortcut key (and whether it should be shown at all) in the IDE options. +* What to search (commands/recent items/components) - -Todo: Search recent files/packages diff --git a/components/idespotter/frmspotter.lfm b/components/idescout/frmscout.lfm similarity index 98% rename from components/idespotter/frmspotter.lfm rename to components/idescout/frmscout.lfm index 3b03df24e2..09337dca53 100644 --- a/components/idespotter/frmspotter.lfm +++ b/components/idescout/frmscout.lfm @@ -1,10 +1,10 @@ -object SpotterForm: TSpotterForm +object IDEScoutForm: TIDEScoutForm Left = 404 Height = 232 Top = 195 Width = 497 BorderStyle = bsSizeToolWin - Caption = 'Spotter' + Caption = 'IDE Scout' ClientHeight = 232 ClientWidth = 497 FormStyle = fsStayOnTop diff --git a/components/idespotter/frmspotter.pas b/components/idescout/frmscout.pas similarity index 81% rename from components/idespotter/frmspotter.pas rename to components/idescout/frmscout.pas index a77775a48a..6e531f3683 100644 --- a/components/idespotter/frmspotter.pas +++ b/components/idescout/frmscout.pas @@ -1,4 +1,4 @@ -{ Form for the spotter window +{ Form for the scout window 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, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1335, USA. } -unit frmspotter; +unit frmscout; {$mode objfpc}{$H+} @@ -38,8 +38,8 @@ uses StdCtrls, EditBtn, IDECommands, LazIDEIntf, Types, LCLType, IDEOptionsIntf, IDEOptEditorIntf; Type - TSpotHighlight = (shCommands,shRecentProjects,shRecentFiles,shRecentPackages,shComponents); - TSpotHighlights = set of TSpotHighlight; + TScoutTerrain = (stCommands,stRecentProjects,stRecentFiles,stRecentPackages,stComponents); + TScoutTerrains = set of TScoutTerrain; { TSearchItem } TMatchPos = Array of Integer; @@ -98,9 +98,9 @@ Type end; - { TSpotterForm } + { TIDEScoutForm } - TSpotterForm = class(TForm) + TIDEScoutForm = class(TForm) ESearch: TEditButton; LBMatches: TListBox; procedure ECommandChange(Sender: TObject); @@ -118,7 +118,7 @@ Type ); private FRefresh, - FHighlights: TSpotHighlights; + FHighlights: TScoutTerrains; FKeyStrokeColor: TColor; FMatchColor: TColor; FShowCategory: Boolean; @@ -144,26 +144,26 @@ Type Property ShowShortCutKey : Boolean Read FShowShortCutKey Write FShowShortCutKey; property KeyStrokeColor : TColor Read FKeyStrokeColor Write FKeyStrokeColor; property MatchColor : TColor Read FMatchColor Write FMatchColor; - Property Highlights : TSpotHighlights Read FHighlights Write FHighlights; + Property Highlights : TScoutTerrains Read FHighlights Write FHighlights; end; Const - AllSpots = [shCommands,shRecentProjects,shRecentFiles,shRecentPackages]; + AllTerrains = [stCommands,stRecentProjects,stRecentFiles,stRecentPackages]; Var - SpotHighlights : TSpotHighlights = AllSpots; + ScoutTerrains : TScoutTerrains = AllTerrains; ShowCmdCategory : Boolean = True; ShowShortCutKey : Boolean = True; MatchColor : TColor = clMaroon; KeyStrokeColor : TColor = clNavy; SettingsClass : TAbstractIDEOptionsEditorClass = Nil; -Procedure ShowSpotterForm; -Procedure ApplySpotterOptions; -Procedure SaveSpotterOptions; -procedure LoadSpotterOptions; -procedure CreateSpotterWindow(Sender: TObject; aFormName: string; var AForm: TCustomForm; DoDisableAutoSizing: boolean); +Procedure ShowScoutForm; +Procedure ApplyScoutOptions; +Procedure SaveScoutOptions; +procedure LoadScoutOptions; +procedure CreateScoutWindow(Sender: TObject; aFormName: string; var AForm: TCustomForm; DoDisableAutoSizing: boolean); implementation @@ -173,11 +173,11 @@ Uses {$R *.lfm} var - SpotterForm: TSpotterForm; + ScoutForm: TIDEScoutForm; Const - IDESpotterOptsFile = 'idespotter.xml'; + IDEScoutOptsFile = 'idescout.xml'; KeyHighLight = 'highlight/'; KeyShowCategory = 'showcategory/value'; @@ -189,23 +189,23 @@ Const KeyDropComponent = 'Components/Drop'; - HighlightNames : Array[TSpotHighlight] of string = + HighlightNames : Array[TScoutTerrain] of string = ('Commands','Projects','Files','Packages','Components'); -procedure LoadSpotterOptions; +procedure LoadScoutOptions; var Cfg: TConfigStorage; - SH : TSpotHighlight; - SHS : TSpotHighlights; + SH : TScoutTerrain; + SHS : TScoutTerrains; begin - Cfg:=GetIDEConfigStorage(IDESpotterOptsFile,true); + Cfg:=GetIDEConfigStorage(IDEScoutOptsFile,true); try SHS:=[]; - for SH in TSpotHighlight do - if Cfg.GetValue(KeyHighLight+HighlightNames[SH],SH In SpotHighlights) then + for SH in TScoutTerrain do + if Cfg.GetValue(KeyHighLight+HighlightNames[SH],SH In ScoutTerrains) then Include(SHS,SH); - SpotHighlights:=SHS; + ScoutTerrains:=SHS; TComponentItem.DefaultWidth:=Cfg.GetValue(KeyDefaultComponentWidth,TComponentItem.DefaultWidth); TComponentItem.DefaultHeight:=Cfg.GetValue(KeyDefaultComponentHeight,TComponentItem.DefaultHeight); TComponentItem.Drop:=Cfg.GetValue(KeyDropComponent,TComponentItem.Drop); @@ -213,23 +213,23 @@ begin ShowShortCutKey:=Cfg.GetValue(KeyShowShortCut,ShowShortCutKey); KeyStrokeColor:=TColor(Cfg.GetValue(KeyShortCutColor,Ord(KeyStrokeColor))); MatchColor:=TColor(Cfg.GetValue(KeyMatchColor,Ord(MatchColor))); - ApplySpotterOptions; + ApplyScoutOptions; finally Cfg.Free; end; end; -procedure SaveSpotterOptions; +procedure SaveScoutOptions; var Cfg: TConfigStorage; - SH : TSpotHighlight; + SH : TScoutTerrain; begin - Cfg:=GetIDEConfigStorage(IDESpotterOptsFile,false); + Cfg:=GetIDEConfigStorage(IDEScoutOptsFile,false); try - for SH in TSpotHighlight do - Cfg.SetValue(KeyHighLight+HighlightNames[SH],SH In SpotHighlights); + for SH in TScoutTerrain do + Cfg.SetValue(KeyHighLight+HighlightNames[SH],SH In ScoutTerrains); Cfg.SetValue(KeyDefaultComponentWidth,TComponentItem.DefaultWidth); Cfg.SetValue(KeyDefaultComponentHeight,TComponentItem.DefaultHeight); Cfg.SetValue(KeyDropComponent,TComponentItem.Drop); @@ -242,43 +242,43 @@ begin end; end; -Procedure ApplySpotterOptions; +Procedure ApplyScoutOptions; begin - if Assigned(SpotterForm) then + if Assigned(ScoutForm) then begin - SpotterForm.ShowCategory:=ShowCmdCategory; - SpotterForm.MatchColor:=MatchColor; - SpotterForm.KeyStrokeColor:=KeyStrokeColor; - SpotterForm.ShowShortCutKey:=ShowShortCutKey; - SpotterForm.Highlights:=SpotHighlights; - SpotterForm.Initialize; + ScoutForm.ShowCategory:=ShowCmdCategory; + ScoutForm.MatchColor:=MatchColor; + ScoutForm.KeyStrokeColor:=KeyStrokeColor; + ScoutForm.ShowShortCutKey:=ShowShortCutKey; + ScoutForm.Highlights:=ScoutTerrains; + ScoutForm.Initialize; end; end; -Procedure MaybeCreateSpotterForm; +Procedure MaybeCreateScoutForm; begin - if SpotterForm=Nil then + if ScoutForm=Nil then begin - SpotterForm:=TSpotterForm.Create(Application); - ApplySpotterOptions; + ScoutForm:=TIDEScoutForm.Create(Application); + ApplyScoutOptions; end; end; -Procedure ShowSpotterForm; +Procedure ShowScoutForm; begin - MaybeCreateSpotterForm; - IDEWindowCreators.ShowForm(SpotterForm,True,vmAlwaysMoveToVisible); + MaybeCreateScoutForm; + IDEWindowCreators.ShowForm(ScoutForm,True,vmAlwaysMoveToVisible); end; -procedure CreateSpotterWindow(Sender: TObject; aFormName: string; +procedure CreateScoutWindow(Sender: TObject; aFormName: string; var AForm: TCustomForm; DoDisableAutoSizing: boolean); begin - MaybeCreateSpotterForm; - aForm:=SpotterForm; + MaybeCreateScoutForm; + aForm:=ScoutForm; end; { TComponentItem } @@ -378,14 +378,14 @@ begin Inherited; end; -{ TSpotterForm } +{ TIDEScoutForm } -procedure TSpotterForm.ECommandChange(Sender: TObject); +procedure TIDEScoutForm.ECommandChange(Sender: TObject); begin FilterList(ESearch.Text); end; -procedure TSpotterForm.ECommandKeyDown(Sender: TObject; var Key: Word; +procedure TIDEScoutForm.ECommandKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); begin Case Key of @@ -410,25 +410,25 @@ begin end; end; -procedure TSpotterForm.ESearchButtonClick(Sender: TObject); +procedure TIDEScoutForm.ESearchButtonClick(Sender: TObject); begin - LazarusIDE.DoOpenIDEOptions(SettingsClass,'IDE Spotter'); + LazarusIDE.DoOpenIDEOptions(SettingsClass,'IDE Scout'); Close; end; -procedure TSpotterForm.FormActivate(Sender: TObject); +procedure TIDEScoutForm.FormActivate(Sender: TObject); begin ESearch.SetFocus; end; -procedure TSpotterForm.FormClose(Sender: TObject; +procedure TIDEScoutForm.FormClose(Sender: TObject; var CloseAction: TCloseAction); begin CloseAction:=caHide; end; -procedure TSpotterForm.RefreshCaption(aCount : Integer); +procedure TIDEScoutForm.RefreshCaption(aCount : Integer); begin if ACount=-1 then @@ -437,7 +437,7 @@ begin Caption:=FOrgCaption+Format(' (%d/%d)',[aCount,FSearchItems.Count]); end; -procedure TSpotterForm.FilterList(aSearchTerm: String); +procedure TIDEScoutForm.FilterList(aSearchTerm: String); Var i : Integer; @@ -497,7 +497,7 @@ begin end; end; -procedure TSpotterForm.AddFileToList(aFileName: String; aType: TIDERecentHandler; CheckDuplicate : Boolean = False); +procedure TIDEScoutForm.AddFileToList(aFileName: String; aType: TIDERecentHandler; CheckDuplicate : Boolean = False); Var F : TOpenFileItem; @@ -522,14 +522,14 @@ begin end; -procedure TSpotterForm.FormCreate(Sender: TObject); +procedure TIDEScoutForm.FormCreate(Sender: TObject); begin FSearchItems:=TStringList.Create; FSearchItems.OwnsObjects:=True; FOrgCaption:=Caption; end; -procedure TSpotterForm.FormDestroy(Sender: TObject); +procedure TIDEScoutForm.FormDestroy(Sender: TObject); begin With IDEEnvironmentOptions do begin @@ -538,10 +538,10 @@ begin RemoveHandlerAddToRecentPackageFiles(@ProjectOpened); end; FreeAndNil(FSearchItems); - SpotterForm:=Nil; + ScoutForm:=Nil; end; -procedure TSpotterForm.FormShow(Sender: TObject); +procedure TIDEScoutForm.FormShow(Sender: TObject); begin ESearch.Clear; @@ -551,13 +551,13 @@ begin RefreshList; end; -procedure TSpotterForm.LBMatchesClick(Sender: TObject); +procedure TIDEScoutForm.LBMatchesClick(Sender: TObject); begin ExecuteSelected; end; -procedure TSpotterForm.LBMatchesDrawItem(Control: TWinControl; Index: Integer; +procedure TIDEScoutForm.LBMatchesDrawItem(Control: TWinControl; Index: Integer; ARect: TRect; State: TOwnerDrawState); Const @@ -616,7 +616,7 @@ begin end; end; -procedure TSpotterForm.ExecuteSelected; +procedure TIDEScoutForm.ExecuteSelected; Var idx: Integer; @@ -638,14 +638,14 @@ begin end; -procedure TSpotterForm.LBMatchesKeyUp(Sender: TObject; var Key: Word; +procedure TIDEScoutForm.LBMatchesKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState); begin if Key=VK_ESCAPE then Hide; end; -procedure TSpotterForm.FillRecent(aType : TIDERecentHandler); +procedure TIDEScoutForm.FillRecent(aType : TIDERecentHandler); Var L : TStringList; @@ -662,7 +662,7 @@ begin end; end; -procedure TSpotterForm.FillComponents; +procedure TIDEScoutForm.FillComponents; Var I : integer; @@ -685,7 +685,7 @@ begin end; end; -procedure TSpotterForm.ClearRefreshableItems; +procedure TIDEScoutForm.ClearRefreshableItems; Var I : Integer; @@ -694,11 +694,11 @@ Var begin SH:=[]; - if shRecentFiles in FRefresh then + if stRecentFiles in FRefresh then Include(SH,irhOpenFiles); - if shRecentProjects in FRefresh then + if stRecentProjects in FRefresh then Include(SH,irhProjectFiles); - if shRecentPackages in FRefresh then + if stRecentPackages in FRefresh then Include(SH,irhPackageFiles); I:=FSearchItems.Count-1; While I>=0 do @@ -711,18 +711,18 @@ begin end; end; -procedure TSpotterForm.RefreshList; +procedure TIDEScoutForm.RefreshList; begin FSearchItems.Sorted:=False; FSearchItems.BeginUpdate; try ClearRefreshableItems; - if shRecentFiles in FRefresh then + if stRecentFiles in FRefresh then FillRecent(irhOpenFiles); - if shRecentProjects in FRefresh then + if stRecentProjects in FRefresh then FillRecent(irhProjectFiles); - if shRecentPackages in FRefresh then + if stRecentPackages in FRefresh then FillRecent(irhPackageFiles); FRefresh:=[]; finally @@ -731,27 +731,27 @@ begin end; end; -procedure TSpotterForm.Initialize; +procedure TIDEScoutForm.Initialize; begin FSearchItems.Sorted:=False; FSearchItems.BeginUpdate; try FSearchItems.Clear; - if shCommands in Highlights then + if stCommands in Highlights then FillCommands; - if shComponents in Highlights then + if stComponents in Highlights then FillComponents; - if shRecentFiles in Highlights then + if stRecentFiles in Highlights then begin IDEEnvironmentOptions.AddHandlerAddToRecentOpenFiles(@FileOpened,False); FillRecent(irhOpenFiles); end; - if shRecentProjects in Highlights then + if stRecentProjects in Highlights then begin IDEEnvironmentOptions.AddHandlerAddToRecentProjectFiles(@ProjectOpened,False); FillRecent(irhProjectFiles); end; - if shRecentPackages in Highlights then + if stRecentPackages in Highlights then begin IDEEnvironmentOptions.AddHandlerAddToRecentPackageFiles(@PackageOpened,False); FillRecent(irhPackageFiles); @@ -762,7 +762,7 @@ begin end; end; -function TSpotterForm.GetCommandCategoryString(Cmd: TIDECommand): String; +function TIDEScoutForm.GetCommandCategoryString(Cmd: TIDECommand): String; Const Cmds = ' commands'; @@ -789,25 +789,25 @@ begin end; end; -procedure TSpotterForm.PackageOpened(Sender: TObject; AFileName: string; +procedure TIDEScoutForm.PackageOpened(Sender: TObject; AFileName: string; var AAllow: Boolean); begin - Include(FRefresh,shRecentPackages); + Include(FRefresh,stRecentPackages); end; -procedure TSpotterForm.FileOpened(Sender: TObject; AFileName: string; +procedure TIDEScoutForm.FileOpened(Sender: TObject; AFileName: string; var AAllow: Boolean); begin - Include(FRefresh,shRecentFiles); + Include(FRefresh,stRecentFiles); end; -procedure TSpotterForm.ProjectOpened(Sender: TObject; AFileName: string; +procedure TIDEScoutForm.ProjectOpened(Sender: TObject; AFileName: string; var AAllow: Boolean); begin - Include(FRefresh,shRecentProjects); + Include(FRefresh,stRecentProjects); end; -procedure TSpotterForm.FillCommands; +procedure TIDEScoutForm.FillCommands; var I, J: Integer; Itm : TSearchItem; diff --git a/components/idespotter/idespotter.lpk b/components/idescout/idescout.lpk similarity index 73% rename from components/idespotter/idespotter.lpk rename to components/idescout/idescout.lpk index f465e63407..ef0cc755e0 100644 --- a/components/idespotter/idespotter.lpk +++ b/components/idescout/idescout.lpk @@ -1,7 +1,7 @@ - + @@ -10,27 +10,27 @@ - - + - + - - + + - - + + diff --git a/components/idespotter/idespotter.pas b/components/idescout/idescout.pas similarity index 58% rename from components/idespotter/idespotter.pas rename to components/idescout/idescout.pas index 48722221ef..fe2083382d 100644 --- a/components/idespotter/idespotter.pas +++ b/components/idescout/idescout.pas @@ -2,21 +2,21 @@ This source is only used to compile and install the package. } -unit idespotter; +unit idescout; {$warn 5023 off : no warning about unused units} interface uses - RegIDESpotter, frmspotter, IDESPotterOptions, LazarusPackageIntf; + RegIDEScout, frmscout, IDEScoutOptions, LazarusPackageIntf; implementation procedure Register; begin - RegisterUnit('RegIDESpotter', @RegIDESpotter.Register); + RegisterUnit('RegIDEScout', @RegIDEScout.Register); end; initialization - RegisterPackage('idespotter', @Register); + RegisterPackage('idescout', @Register); end. diff --git a/components/idespotter/idespotteroptions.lfm b/components/idescout/idescoutoptions.lfm similarity index 98% rename from components/idespotter/idespotteroptions.lfm rename to components/idescout/idescoutoptions.lfm index e340f82d90..9a8fdbaee0 100644 --- a/components/idespotter/idespotteroptions.lfm +++ b/components/idescout/idescoutoptions.lfm @@ -1,4 +1,4 @@ -object IDESpotterOptionsFrame: TIDESpotterOptionsFrame +object IDEScoutOptionsFrame: TIDEScoutOptionsFrame Left = 0 Height = 504 Top = 0 diff --git a/components/idespotter/idespotteroptions.pas b/components/idescout/idescoutoptions.pas similarity index 76% rename from components/idespotter/idespotteroptions.pas rename to components/idescout/idescoutoptions.pas index ee94ddd70e..668267ca00 100644 --- a/components/idespotter/idespotteroptions.pas +++ b/components/idescout/idescoutoptions.pas @@ -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 @@ -27,7 +27,7 @@ along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1335, USA. } -unit IDESPotterOptions; +unit IDEScoutOptions; {$mode objfpc}{$H+} {$Inline on} @@ -39,13 +39,13 @@ uses // LCL Forms, StdCtrls, Dialogs, Spin, ExtCtrls, ColorBox, // IdeIntf - IDEOptionsIntf, IDEOptEditorIntf, IDEUtils, frmSpotter; + IDEOptionsIntf, IDEOptEditorIntf, IDEUtils, frmScout; Type - { TIDESpotterOptionsFrame } + { TIDEScoutOptionsFrame } - TIDESpotterOptionsFrame = class(TAbstractIDEOptionsEditor) + TIDEScoutOptionsFrame = class(TAbstractIDEOptionsEditor) CGSearch: TCheckGroup; CBShowShortCut: TCheckBox; CBMatchColor: TColorBox; @@ -76,40 +76,40 @@ implementation {$R *.lfm} -{ TIDESpotterOptionsFrame } +{ TIDEScoutOptionsFrame } -procedure TIDESpotterOptionsFrame.CGSearchClick(Sender: TObject); +procedure TIDEScoutOptionsFrame.CGSearchClick(Sender: TObject); begin end; -procedure TIDESpotterOptionsFrame.CGSearchItemClick(Sender: TObject; +procedure TIDEScoutOptionsFrame.CGSearchItemClick(Sender: TObject; Index: integer); begin - if Index=Ord(shComponents) then + if Index=Ord(stComponents) then GBComponents.Enabled:=CGsearch.Checked[Index]; end; -function TIDESpotterOptionsFrame.GetTitle: String; +function TIDEScoutOptionsFrame.GetTitle: String; begin - Result:='IDE Spotter'; + Result:='IDE Scout'; end; -procedure TIDESpotterOptionsFrame.Setup(ADialog: TAbstractOptionsEditorDialog); +procedure TIDEScoutOptionsFrame.Setup(ADialog: TAbstractOptionsEditorDialog); begin // Do nothing, maybe localize ? end; -procedure TIDESpotterOptionsFrame.ReadSettings(AOptions: TAbstractIDEOptions); +procedure TIDEScoutOptionsFrame.ReadSettings(AOptions: TAbstractIDEOptions); Var - sh : TSpotHighlight; + st : TScoutTerrain; begin - for SH in TSpotHighlight do - CGSearch.Checked[Ord(SH)]:=SH in SpotHighlights; + for St in TScoutTerrain do + CGSearch.Checked[Ord(St)]:=St in ScoutTerrains; CBSelectComponent.Checked:=Not TComponentItem.Drop; SEComponentDefaultHeight.Value:=TComponentItem.DefaultHeight; SEComponentDefaultWidth.Value:=TComponentItem.DefaultWidth; @@ -119,18 +119,18 @@ begin CBShortCutColor.Selected := KeyStrokeColor; end; -procedure TIDESpotterOptionsFrame.WriteSettings(AOptions: TAbstractIDEOptions); +procedure TIDEScoutOptionsFrame.WriteSettings(AOptions: TAbstractIDEOptions); Var - sh : TSpotHighlight; - SHS : TSpotHighlights; + st : TScoutTerrain; + STS : TScoutTerrains; begin - SHS:=[]; - for SH in TSpotHighlight do - if CGSearch.Checked[Ord(SH)] then - Include(SHS,SH); - SpotHighlights:=SHS; + STS:=[]; + for ST in TScoutTerrain do + if CGSearch.Checked[Ord(ST)] then + Include(STS,ST); + ScoutTerrains:=STS; TComponentItem.Drop:=not CBSelectComponent.Checked; TComponentItem.DefaultHeight:=SEComponentDefaultHeight.Value; TComponentItem.DefaultWidth:=SEComponentDefaultWidth.Value; @@ -138,11 +138,11 @@ begin ShowShortCutKey:=CBShowShortCut.Checked; MatchColor:=CBMatchColor.Selected; KeyStrokeColor:=CBShortCutColor.Selected; - SaveSpotterOptions; - ApplySpotterOptions; + SaveScoutOptions; + ApplyScoutOptions; end; -class function TIDESpotterOptionsFrame.SupportedOptionsClass: TAbstractIDEOptionsClass; +class function TIDEScoutOptionsFrame.SupportedOptionsClass: TAbstractIDEOptionsClass; begin Result:=IDEEditorGroups.GetByIndex(GroupEnvironment)^.GroupClass; end; diff --git a/components/idespotter/regidespotter.pas b/components/idescout/regidescout.pas similarity index 76% rename from components/idespotter/regidespotter.pas rename to components/idescout/regidescout.pas index 527f208ba7..b896aceb8e 100644 --- a/components/idespotter/regidespotter.pas +++ b/components/idescout/regidescout.pas @@ -1,4 +1,4 @@ -{ Register IDE Spotter unit +{ Register IDE Scout unit 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, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1335, USA. } -unit RegIDESpotter; +unit RegIDEScout; {$mode objfpc}{$H+} @@ -41,12 +41,12 @@ Procedure Register; 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); begin - ShowSpotterForm; + ShowScoutForm; end; @@ -64,27 +64,27 @@ var IDEShortCutX: TIDEShortCut; IDECommandCategory: TIDECommandCategory; IDECommand: TIDECommand; - IDESpotteroptionsFrameID: Integer = 2000; + IDEScoutOptionsFrameID: Integer = 2000; begin - LoadSpotterOptions; + LoadScoutOptions; IDEShortCutX := IDEShortCut(VK_P, ShiftKeys, VK_UNKNOWN, []); IDECommandCategory := IDECommandList.FindCategoryByName(CommandCategoryViewName); if IDECommandCategory <> nil then begin - IDECommand := RegisterIDECommand(IDECommandCategory, 'Spotter', 'Open Spotter', + IDECommand := RegisterIDECommand(IDECommandCategory, 'IDEScout', 'Open IDE Scout', IDEShortCutX, nil, @IDEMenuClicked); if IDECommand <> nil then RegisterIDEButtonCommand(IDECommand); end; - IDESpotteroptionsFrameID:=RegisterIDEOptionsEditor(GroupEnvironment,TIDESpotterOptionsFrame, - IDESpotteroptionsFrameID)^.Index; - RegisterIDEMenuCommand(itmViewIDEInternalsWindows, 'Spotter', 'Spotter', nil, + IDEScoutOptionsFrameID:=RegisterIDEOptionsEditor(GroupEnvironment,TIDEScoutOptionsFrame, + IDEScoutOptionsFrameID)^.Index; + RegisterIDEMenuCommand(itmViewIDEInternalsWindows, 'IDEScout', 'Open IDE Scout', nil, @IDEMenuClicked,IDECommand); - IDEWindowCreators.Add('IDESpotter',@CreateSpotterWindow,nil,'40%','10%','+500','+240'); + IDEWindowCreators.Add('IDEScout',@CreateScoutWindow,nil,'40%','10%','+500','+240'); end; Initialization - SettingsClass:=TIDESpotterOptionsFrame; + SettingsClass:=TIDEScoutOptionsFrame; end.