diff --git a/.gitattributes b/.gitattributes index 846c6e1f93..079f4119bf 100644 --- a/.gitattributes +++ b/.gitattributes @@ -2098,6 +2098,8 @@ 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/images/examples/README.txt svneol=native#text/plain components/images/examples/imagesexample.lpi svneol=native#text/plain diff --git a/components/idespotter/idespotteroptions.lfm b/components/idespotter/idespotteroptions.lfm new file mode 100644 index 0000000000..83b137a0bf --- /dev/null +++ b/components/idespotter/idespotteroptions.lfm @@ -0,0 +1,112 @@ +object IDESpotterOptionsFrame: TIDESpotterOptionsFrame + Left = 0 + Height = 504 + Top = 0 + Width = 427 + BorderSpacing.Left = 6 + ClientHeight = 504 + ClientWidth = 427 + TabOrder = 0 + DesignLeft = 580 + DesignTop = 164 + object CGSearch: TCheckGroup + Left = 0 + Height = 56 + Top = 0 + Width = 427 + Align = alTop + AutoFill = True + Caption = 'Search in' + ChildSizing.LeftRightSpacing = 6 + ChildSizing.TopBottomSpacing = 6 + ChildSizing.EnlargeHorizontal = crsHomogenousChildResize + ChildSizing.EnlargeVertical = crsHomogenousChildResize + ChildSizing.ShrinkHorizontal = crsScaleChilds + ChildSizing.ShrinkVertical = crsScaleChilds + ChildSizing.Layout = cclLeftToRightThenTopToBottom + ChildSizing.ControlsPerLine = 1 + ClientHeight = 38 + ClientWidth = 425 + Items.Strings = ( + 'Commands' + ) + TabOrder = 0 + Data = { + 0100000002 + } + end + object Options: TGroupBox + Left = 0 + Height = 105 + Top = 56 + Width = 427 + Align = alTop + Caption = 'Options' + ClientHeight = 87 + ClientWidth = 425 + TabOrder = 1 + object CBShowShortCut: TCheckBox + Left = 8 + Height = 22 + Top = 39 + Width = 190 + Caption = 'Show Sh&ortcut when available' + TabOrder = 0 + end + object CBShowCategory: TCheckBox + Left = 8 + Height = 22 + Top = 8 + Width = 194 + Caption = 'Show &Category when available' + TabOrder = 1 + end + end + object Colors: TGroupBox + Left = 0 + Height = 271 + Top = 161 + Width = 427 + Align = alTop + Caption = 'Colors' + ClientHeight = 253 + ClientWidth = 425 + TabOrder = 2 + object CBMatchColor: TColorBox + Left = 96 + Height = 31 + Top = 16 + Width = 100 + Style = [cbStandardColors, cbExtendedColors, cbSystemColors, cbCustomColor, cbCustomColors] + ItemHeight = 0 + TabOrder = 0 + end + object CBShortCutColor: TColorBox + Left = 96 + Height = 31 + Top = 48 + Width = 100 + Style = [cbStandardColors, cbExtendedColors, cbSystemColors, cbCustomColor, cbCustomColors] + ItemHeight = 0 + TabOrder = 1 + end + object LCBMatchColor: TLabel + Left = 8 + Height = 17 + Top = 16 + Width = 48 + Caption = '&Matches' + FocusControl = CBMatchColor + ParentColor = False + end + object LCBShortCut: TLabel + Left = 8 + Height = 17 + Top = 48 + Width = 69 + Caption = '&Shortcut key' + FocusControl = CBShortCutColor + ParentColor = False + end + end +end diff --git a/components/idespotter/idespotteroptions.pas b/components/idespotter/idespotteroptions.pas new file mode 100644 index 0000000000..e2b7ea15a4 --- /dev/null +++ b/components/idespotter/idespotteroptions.pas @@ -0,0 +1,111 @@ +{ IDE options frame for IDE Spotter options + + Copyright (C) 2018 Michael van Canneyt michael@freepascal.org + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU Library General Public License as published by + the Free Software Foundation; either version 2 of the License, or (at your + option) any later version with the following modification: + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent modules,and + to copy and distribute the resulting executable under terms of your choice, + provided that you also meet, for each linked independent module, the terms + and conditions of the license of that module. An independent module is a + module which is not derived from or based on this library. If you modify + this library, you may extend this exception to your version of the library, + but you are not obligated to do so. If you do not wish to do so, delete this + exception statement from your version. + + This program 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 Library General Public License + for more details. + + You should have received a copy of the GNU Library General Public License + 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; + +{$mode objfpc}{$H+} +{$Inline on} + +interface + +uses + Classes, SysUtils, + // LCL + Forms, StdCtrls, Dialogs, Spin, ExtCtrls, ColorBox, + // IdeIntf + IDEOptionsIntf, IDEOptEditorIntf, IDEUtils, frmSpotter; + + +Type + { TIDESpotterOptionsFrame } + + TIDESpotterOptionsFrame = class(TAbstractIDEOptionsEditor) + CGSearch: TCheckGroup; + CBShowShortCut: TCheckBox; + CBMatchColor: TColorBox; + CBShortCutColor: TColorBox; + CBShowCategory: TCheckBox; + Colors: TGroupBox; + LCBShortCut: TLabel; + LCBMatchColor: TLabel; + Options: TGroupBox; + private + public + function GetTitle: String; override; + procedure Setup({%H-}ADialog: TAbstractOptionsEditorDialog); override; + procedure ReadSettings({%H-}AOptions: TAbstractIDEOptions); override; + procedure WriteSettings({%H-}AOptions: TAbstractIDEOptions); override; + class function SupportedOptionsClass: TAbstractIDEOptionsClass; override; + end; + +implementation + +{$R *.lfm} + +{ TIDESpotterOptionsFrame } + + +function TIDESpotterOptionsFrame.GetTitle: String; +begin + Result:='IDE Spotter'; +end; + +procedure TIDESpotterOptionsFrame.Setup(ADialog: TAbstractOptionsEditorDialog); + + +begin + // Do nothing, maybe localize ? +end; + +procedure TIDESpotterOptionsFrame.ReadSettings(AOptions: TAbstractIDEOptions); +begin + CGSearch.Checked[0]:=true; + CBShowCategory.Checked := ShowCmdCategory; + CBShowShortCut.Checked := ShowShortCutKey; + CBMatchColor.Selected := MatchColor; + CBShortCutColor.Selected := KeyStrokeColor; +end; + +procedure TIDESpotterOptionsFrame.WriteSettings(AOptions: TAbstractIDEOptions); +begin + ShowCmdCategory:=CBShowCategory.Checked; + ShowShortCutKey:=CBShowShortCut.Checked; + MatchColor:=CBMatchColor.Selected; + KeyStrokeColor:=CBShortCutColor.Selected; + SaveSpotterOptions; + ApplySpotterOptions; +end; + +class function TIDESpotterOptionsFrame.SupportedOptionsClass: TAbstractIDEOptionsClass; +begin + Result:=IDEEditorGroups.GetByIndex(GroupEnvironment)^.GroupClass; +end; + +end. +