IDE: Identifier completion window: implement customizable colors, issue #29282

git-svn-id: trunk@57117 -
This commit is contained in:
ondrej 2018-01-19 07:09:42 +00:00
parent 3e12ed3bdc
commit 86baae8769
8 changed files with 376 additions and 109 deletions

View File

@ -120,7 +120,8 @@ const
'', // ahaSpecialVisibleChars
'', // ahaTopInfoHint
'', '', '', // ahaIfDefBlockInactive, ahaIfDefBlockActive, ahaIfDefBlockTmpActive
'', '', '' // ahaIfDefNodeInactive, ahaIfDefNodeActive, ahaIfDefNodeTmpActive
'', '', '', // ahaIfDefNodeInactive, ahaIfDefNodeActive, ahaIfDefNodeTmpActive
'', '', '', '' // ahaIdentComplWindow, ahaIdentComplWindowBorder, ahaIdentComplWindowSelection, ahaIdentComplWindowHighlight
);
ahaGroupMap: array[TAdditionalHilightAttribute] of TAhaGroupName = (
@ -162,7 +163,12 @@ const
{ ahaIfDefBlockTmpActive } agnIfDef,
{ ahaIfDefNodeInactive } agnIfDef,
{ ahaIfDefNodeActive } agnIfDef,
{ ahaIfDefNodeTmpActive } agnIfDef
{ ahaIfDefNodeTmpActive } agnIfDef,
{ ahaIdentComplWindow } agnIdentComplWindow,
{ ahaIdentComplWindowBorder } agnIdentComplWindow,
{ ahaIdentComplWindowSelection } agnIdentComplWindow,
{ ahaIdentComplWindowHighlight } agnIdentComplWindow
);
ahaSupportedFeatures: array[TAdditionalHilightAttribute] of TColorSchemeAttributeFeatures =
(
@ -204,7 +210,11 @@ const
{ ahaIfDefBlockTmpActive }[hafBackColor, hafForeColor, hafFrameColor, hafAlpha, hafPrior, hafFrameStyle, hafFrameEdges, hafStyle, hafStyleMask],
{ ahaIfDefNodeInactive } [hafBackColor, hafForeColor, hafFrameColor, hafAlpha, hafPrior, hafFrameStyle, hafFrameEdges, hafStyle, hafStyleMask],
{ ahaIfDefNodeActive } [hafBackColor, hafForeColor, hafFrameColor, hafAlpha, hafPrior, hafFrameStyle, hafFrameEdges, hafStyle, hafStyleMask],
{ ahaIfDefNodeTmpActive } [hafBackColor, hafForeColor, hafFrameColor, hafAlpha, hafPrior, hafFrameStyle, hafFrameEdges, hafStyle, hafStyleMask]
{ ahaIfDefNodeTmpActive } [hafBackColor, hafForeColor, hafFrameColor, hafAlpha, hafPrior, hafFrameStyle, hafFrameEdges, hafStyle, hafStyleMask],
{ ahaIdentComplWindow } [hafBackColor, hafForeColor],
{ ahaIdentComplWindowBorder } [hafForeColor],
{ ahaIdentComplWindowSelection } [hafBackColor, hafForeColor],
{ ahaIdentComplWindowHighlight } [hafForeColor]
);
@ -2462,6 +2472,12 @@ begin
AdditionalHighlightAttributes[ahaIfDefNodeTmpActive] := dlgIfDefNodeTmpActive;
AdditionalHighlightGroupNames[agnIfDef] := dlgAddHiAttrGroupIfDef;
AdditionalHighlightAttributes[ahaIdentComplWindow] := dlgAddHiAttrDefaultWindow;
AdditionalHighlightAttributes[ahaIdentComplWindowBorder] := dlgAddHiAttrWindowBorder;
AdditionalHighlightAttributes[ahaIdentComplWindowSelection] := dlgBlockGroupOptions;
AdditionalHighlightAttributes[ahaIdentComplWindowHighlight] := dlgAddHiAttrHighlightPrefix;
AdditionalHighlightGroupNames[agnIdentComplWindow] := dlgIdentifierCompletion;
AdditionalHighlightGroupNames[agnDefault] := dlgAddHiAttrGroupDefault;
AdditionalHighlightGroupNames[agnText] := dlgAddHiAttrGroupText;
AdditionalHighlightGroupNames[agnLine] := dlgAddHiAttrGroupLine;
@ -6392,9 +6408,16 @@ procedure TColorSchemeLanguage.ApplyTo(ASynEdit: TSynEdit);
if assigned(ASynEdit.Gutter.Parts.ByClass[aClass, 0]) then
SetMarkupColor(aha, ASynEdit.Gutter.Parts.ByClass[aClass, 0].MarkupInfo);
end;
function GetUsedAttr(aha: TAdditionalHilightAttribute): TColorSchemeAttribute;
begin
Result := AttributeByEnum[aha];
if Assigned(Result) and Result.IsUsingSchemeGlobals then
Result := Result.GetSchemeGlobal;
end;
var
Attri: TColorSchemeAttribute;
i: Integer;
IDESynEdit: TIDESynEditor;
begin
ASynEdit.BeginUpdate;
try
@ -6413,19 +6436,13 @@ begin
aSynEdit.Font.Color := clBlack;
end;
Attri := Attribute[AhaToStoredName(ahaGutter)];
if Attri <> nil then begin
if Attri.IsUsingSchemeGlobals then
Attri := Attri.GetSchemeGlobal;
Attri := GetUsedAttr(ahaGutter);
if Attri <> nil then
aSynEdit.Gutter.Color := Attri.Background;
end;
Attri := Attribute[AhaToStoredName(ahaRightMargin)];
if Attri <> nil then begin
if Attri.IsUsingSchemeGlobals then
Attri := Attri.GetSchemeGlobal;
Attri := GetUsedAttr(ahaRightMargin);
if Attri <> nil then
aSynEdit.RightEdgeColor := Attri.Foreground;
end;
SetMarkupColor(ahaTextBlock, aSynEdit.SelectedColor);
SetMarkupColor(ahaIncrementalSearch, aSynEdit.IncrementColor);
@ -6468,6 +6485,44 @@ begin
SetGutterColorByClass(ahaCodeFoldingTree, TSynGutterCodeFolding);
SetGutterColorByClass(ahaGutterSeparator, TSynGutterSeparator);
if ASynEdit is TIDESynEditor then
begin
IDESynEdit := TIDESynEditor(ASynEdit);
Attri := GetUsedAttr(ahaIdentComplWindow);
if Attri<>nil then
begin
IDESynEdit.MarkupIdentComplWindow.TextColor := Attri.Foreground;
IDESynEdit.MarkupIdentComplWindow.WindowColor:= Attri.Background;
end else
begin
IDESynEdit.MarkupIdentComplWindow.TextColor := clNone;
IDESynEdit.MarkupIdentComplWindow.WindowColor:= clNone;
end;
Attri := GetUsedAttr(ahaIdentComplWindowBorder);
if Attri<>nil then
IDESynEdit.MarkupIdentComplWindow.BorderColor:= Attri.Foreground
else
IDESynEdit.MarkupIdentComplWindow.BorderColor:= clNone;
Attri := GetUsedAttr(ahaIdentComplWindowHighlight);
if Attri<>nil then
IDESynEdit.MarkupIdentComplWindow.HighlightColor:= Attri.Foreground
else
IDESynEdit.MarkupIdentComplWindow.HighlightColor:= clNone;
Attri := GetUsedAttr(ahaIdentComplWindowSelection);
if Attri<>nil then
begin
IDESynEdit.MarkupIdentComplWindow.TextSelectedColor:= Attri.Foreground;
IDESynEdit.MarkupIdentComplWindow.BackgroundSelectedColor:= Attri.Background;
end else
begin
IDESynEdit.MarkupIdentComplWindow.TextSelectedColor := clNone;
IDESynEdit.MarkupIdentComplWindow.BackgroundSelectedColor:= clNone;
end;
end;
i := aSynEdit.PluginCount - 1;
while (i >= 0) and not(aSynEdit.Plugin[i] is TSynPluginTemplateEdit) do

View File

@ -30,7 +30,7 @@ object EditorColorOptionsFrame: TEditorColorOptionsFrame
TabOrder = 1
object bvlAttributeSection: TDividerBevel
Left = 0
Height = 17
Height = 15
Top = 0
Width = 640
Caption = 'bvlAttributeSection'
@ -41,7 +41,7 @@ object EditorColorOptionsFrame: TEditorColorOptionsFrame
object ToolBar1: TToolBar
Left = 3
Height = 24
Top = 17
Top = 15
Width = 634
AutoSize = True
BorderSpacing.Left = 3
@ -74,27 +74,27 @@ object EditorColorOptionsFrame: TEditorColorOptionsFrame
Style = tbsCheck
end
object SetAttributeToDefaultButton: TToolButton
Left = 249
Left = 245
Top = 0
OnClick = SetAttributeToDefaultButtonClick
ShowCaption = False
end
object ToolButton3: TToolButton
Left = 239
Left = 237
Height = 22
Top = 0
Width = 10
Caption = 'ToolButton3'
Style = tbsSeparator
end
object ToolButton1: TToolButton
Left = 123
Height = 22
Top = 0
Width = 10
Caption = 'ToolButton1'
Style = tbsSeparator
end
object tbnColor: TToolButton
Left = 133
Left = 131
Top = 0
AutoSize = True
Caption = 'tbnColor'
@ -104,7 +104,7 @@ object EditorColorOptionsFrame: TEditorColorOptionsFrame
Style = tbsCheck
end
object tbnPrior: TToolButton
Left = 188
Left = 186
Top = 0
AutoSize = True
Caption = 'tbnPrior'
@ -121,73 +121,231 @@ object EditorColorOptionsFrame: TEditorColorOptionsFrame
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = pnlElementAttributes
AnchorSideBottom.Side = asrBottom
Height = 151
Top = 41
Height = 153
Top = 39
Width = 640
Anchors = [akTop, akLeft, akRight, akBottom]
ClientHeight = 151
ClientHeight = 153
ClientWidth = 640
TabOrder = 1
inherited ForeGroundLabel: TLabel
Top = 7
Width = 91
end
inherited BackGroundLabel: TLabel
Top = 32
Width = 93
end
inherited ForeGroundUseDefaultCheckBox: TCheckBox
AnchorSideLeft.Control = SynColorAttrEditor1
Height = 19
Width = 192
end
inherited ForegroundColorBox: TColorBox
AnchorSideTop.Control = SynColorAttrEditor1
AnchorSideRight.Control = SynColorAttrEditor1
Left = 204
Height = 22
Width = 200
end
inherited BackGroundColorBox: TColorBox
AnchorSideRight.Control = SynColorAttrEditor1
Left = 204
Height = 22
Top = 28
Width = 200
end
inherited BackGroundUseDefaultCheckBox: TCheckBox
AnchorSideLeft.Control = SynColorAttrEditor1
Height = 19
Top = 30
Width = 194
end
inherited FrameColorBox: TColorBox
AnchorSideRight.Control = SynColorAttrEditor1
Left = 204
Height = 22
Top = 53
Width = 200
end
inherited FrameColorUseDefaultCheckBox: TCheckBox
AnchorSideLeft.Control = SynColorAttrEditor1
Height = 19
Top = 55
Width = 191
end
inherited pnlUnderline: TPanel
AnchorSideLeft.Control = SynColorAttrEditor1
Height = 40
Top = 102
Width = 145
ClientHeight = 40
ClientWidth = 145
inherited TextUnderlineRadioPanel: TPanel
Height = 21
Top = 19
Width = 134
ClientHeight = 21
ClientWidth = 134
inherited TextUnderlineRadioOn: TRadioButton
Height = 19
Width = 36
end
inherited TextUnderlineRadioOff: TRadioButton
Left = 43
Height = 19
Width = 37
end
inherited TextUnderlineRadioInvert: TRadioButton
Left = 83
Height = 19
Width = 50
end
end
inherited TextUnderlineCheckBox: TCheckBox
Height = 19
Width = 145
end
end
inherited pnlBold: TPanel
Left = 157
Height = 40
Top = 102
Width = 134
ClientHeight = 40
ClientWidth = 134
inherited TextBoldRadioPanel: TPanel
Height = 21
Top = 19
Width = 134
ClientHeight = 21
ClientWidth = 134
inherited TextBoldRadioInvert: TRadioButton
Left = 83
Height = 19
Width = 50
end
inherited TextBoldRadioOn: TRadioButton
Height = 19
Width = 36
end
inherited TextBoldRadioOff: TRadioButton
Left = 43
Height = 19
Width = 37
end
end
inherited TextBoldCheckBox: TCheckBox
Height = 19
Width = 118
end
end
inherited pnlItalic: TPanel
Left = 297
Height = 40
Top = 102
Width = 134
ClientHeight = 40
ClientWidth = 134
inherited TextItalicRadioPanel: TPanel
Height = 21
Top = 19
Width = 134
ClientHeight = 21
ClientWidth = 134
inherited TextItalicRadioInvert: TRadioButton
Left = 83
Height = 19
Width = 50
end
inherited TextItalicRadioOn: TRadioButton
Height = 19
Width = 36
end
inherited TextItalicRadioOff: TRadioButton
Left = 43
Height = 19
Width = 37
end
end
inherited TextItalicCheckBox: TCheckBox
Height = 19
Width = 119
end
end
inherited FrameStyleBox: TComboBox
Left = 307
Height = 21
Top = 78
end
inherited FrameEdgesBox: TComboBox
Left = 204
Height = 21
Top = 78
end
inherited ColumnPosBevel: TPanel
Left = 204
Top = 145
end
inherited ForeAlphaLabel: TLabel
Left = 414
Top = 7
Width = 82
end
inherited BackAlphaLabel: TLabel
Left = 414
Top = 32
Width = 84
end
inherited FrameAlphaLabel: TLabel
Left = 414
Top = 57
Width = 92
end
inherited ForeAlphaSpin: TSpinEdit
Left = 502
Height = 23
Top = 3
end
inherited BackAlphaSpin: TSpinEdit
Left = 504
Height = 23
Top = 28
end
inherited FrameAlphaSpin: TSpinEdit
Left = 512
Height = 23
Top = 53
end
inherited ForePriorLabel: TLabel
Left = 567
Top = 7
Width = 76
end
inherited BackPriorLabel: TLabel
Left = 569
Top = 32
Width = 78
end
inherited FramePriorLabel: TLabel
Left = 577
Top = 57
Width = 86
end
inherited ForePriorSpin: TSpinEdit
Left = 649
Height = 23
Top = 3
end
inherited BackPriorSpin: TSpinEdit
Left = 653
Height = 23
Top = 28
end
inherited FramePriorSpin: TSpinEdit
Left = 669
Height = 23
Top = 53
end
end
object PriorityEditor: TPanel
@ -199,21 +357,21 @@ object EditorColorOptionsFrame: TEditorColorOptionsFrame
AnchorSideBottom.Control = pnlElementAttributes
AnchorSideBottom.Side = asrBottom
Left = 0
Height = 151
Top = 41
Height = 153
Top = 39
Width = 640
Anchors = [akTop, akLeft, akRight, akBottom]
ClientHeight = 151
ClientHeight = 153
ClientWidth = 640
Constraints.MinHeight = 140
TabOrder = 2
object ForePriorPanel: TPanel
Left = 1
Height = 149
Height = 151
Top = 1
Width = 170
Align = alLeft
ClientHeight = 149
ClientHeight = 151
ClientWidth = 170
TabOrder = 0
object ForePriorLabel: TLabel
@ -227,12 +385,11 @@ object EditorColorOptionsFrame: TEditorColorOptionsFrame
end
object ForePriorList: TTreeView
Left = 1
Height = 108
Height = 102
Top = 16
Width = 168
Align = alClient
AutoExpand = True
DefaultItemHeight = 18
ReadOnly = True
ScrollBars = ssAutoVertical
ShowButtons = False
@ -248,21 +405,21 @@ object EditorColorOptionsFrame: TEditorColorOptionsFrame
end
object ForePriorValPanel: TPanel
Left = 1
Height = 23
Top = 125
Height = 31
Top = 119
Width = 168
Align = alBottom
AutoSize = True
BorderSpacing.Top = 1
BevelOuter = bvNone
ClientHeight = 23
ClientHeight = 31
ClientWidth = 168
TabOrder = 1
object ForePriorEdit: TEdit
AnchorSideRight.Control = ForePriorUpDown
Left = 1
Height = 23
Top = 1
Top = 0
Width = 147
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Right = 3
@ -278,26 +435,26 @@ object EditorColorOptionsFrame: TEditorColorOptionsFrame
AnchorSideBottom.Control = ForePriorValPanel
AnchorSideBottom.Side = asrBottom
Left = 151
Height = 23
Height = 31
Top = 0
Width = 17
Anchors = [akTop, akRight, akBottom]
Min = 0
OnClick = ForePriorUpDownClick
Position = 0
TabOrder = 1
Wrap = False
OnClick = ForePriorUpDownClick
end
end
end
object BackPriorPanel: TPanel
Left = 177
Height = 149
Height = 151
Top = 1
Width = 170
Align = alLeft
BorderSpacing.Left = 6
ClientHeight = 149
ClientHeight = 151
ClientWidth = 170
TabOrder = 1
object BackPriorLabel: TLabel
@ -311,12 +468,11 @@ object EditorColorOptionsFrame: TEditorColorOptionsFrame
end
object BackPriorList: TTreeView
Left = 1
Height = 108
Height = 102
Top = 16
Width = 168
Align = alClient
AutoExpand = True
DefaultItemHeight = 18
ReadOnly = True
ScrollBars = ssAutoVertical
ShowButtons = False
@ -332,14 +488,14 @@ object EditorColorOptionsFrame: TEditorColorOptionsFrame
end
object BackPriorValPanel: TPanel
Left = 1
Height = 23
Top = 125
Height = 31
Top = 119
Width = 168
Align = alBottom
AutoSize = True
BorderSpacing.Top = 1
BevelOuter = bvNone
ClientHeight = 23
ClientHeight = 31
ClientWidth = 168
TabOrder = 1
object BackPriorEdit: TEdit
@ -362,26 +518,26 @@ object EditorColorOptionsFrame: TEditorColorOptionsFrame
AnchorSideBottom.Control = BackPriorValPanel
AnchorSideBottom.Side = asrBottom
Left = 151
Height = 23
Height = 31
Top = 0
Width = 17
Anchors = [akTop, akRight, akBottom]
Min = 0
OnClick = ForePriorUpDownClick
Position = 0
TabOrder = 1
Wrap = False
OnClick = ForePriorUpDownClick
end
end
end
object FramePriorPanel: TPanel
Left = 353
Height = 149
Height = 151
Top = 1
Width = 170
Align = alLeft
BorderSpacing.Left = 6
ClientHeight = 149
ClientHeight = 151
ClientWidth = 170
TabOrder = 2
object FramePriorLabel: TLabel
@ -395,12 +551,11 @@ object EditorColorOptionsFrame: TEditorColorOptionsFrame
end
object FramePriorList: TTreeView
Left = 1
Height = 108
Height = 102
Top = 16
Width = 168
Align = alClient
AutoExpand = True
DefaultItemHeight = 18
ReadOnly = True
ScrollBars = ssAutoVertical
ShowButtons = False
@ -416,14 +571,14 @@ object EditorColorOptionsFrame: TEditorColorOptionsFrame
end
object FramePriorValPanel: TPanel
Left = 1
Height = 23
Top = 125
Height = 31
Top = 119
Width = 168
Align = alBottom
AutoSize = True
BorderSpacing.Top = 1
BevelOuter = bvNone
ClientHeight = 23
ClientHeight = 31
ClientWidth = 168
TabOrder = 1
object FramePriorEdit: TEdit
@ -446,15 +601,15 @@ object EditorColorOptionsFrame: TEditorColorOptionsFrame
AnchorSideBottom.Control = FramePriorValPanel
AnchorSideBottom.Side = asrBottom
Left = 151
Height = 23
Height = 31
Top = 0
Width = 17
Anchors = [akTop, akRight, akBottom]
Min = 0
OnClick = ForePriorUpDownClick
Position = 0
TabOrder = 1
Wrap = False
OnClick = ForePriorUpDownClick
end
end
end
@ -504,7 +659,6 @@ object EditorColorOptionsFrame: TEditorColorOptionsFrame
BorderSpacing.Top = 6
BorderSpacing.Right = 1
Constraints.MinWidth = 150
DefaultItemHeight = 18
ReadOnly = True
ScrollBars = ssAutoBoth
ShowButtons = False
@ -947,6 +1101,7 @@ object EditorColorOptionsFrame: TEditorColorOptionsFrame
ShiftMask = [ssShift, ssAlt, ssCtrl]
Command = emcMouseLink
end>
MouseTextActions = <>
MouseSelActions = <
item
ClickDir = cdDown
@ -956,7 +1111,6 @@ object EditorColorOptionsFrame: TEditorColorOptionsFrame
'ColorPreview'
)
VisibleSpecialChars = [vscSpace, vscTabAtLast]
SelectedColor.FrameEdges = sfeAround
SelectedColor.BackPriority = 50
SelectedColor.ForePriority = 50
SelectedColor.FramePriority = 50
@ -964,23 +1118,17 @@ object EditorColorOptionsFrame: TEditorColorOptionsFrame
SelectedColor.ItalicPriority = 50
SelectedColor.UnderlinePriority = 50
SelectedColor.StrikeOutPriority = 50
IncrementColor.FrameEdges = sfeAround
HighlightAllColor.FrameEdges = sfeAround
BracketHighlightStyle = sbhsBoth
BracketMatchColor.Background = clNone
BracketMatchColor.Foreground = clNone
BracketMatchColor.FrameEdges = sfeAround
BracketMatchColor.Style = [fsBold]
FoldedCodeColor.Background = clNone
FoldedCodeColor.Foreground = clGray
FoldedCodeColor.FrameColor = clGray
FoldedCodeColor.FrameEdges = sfeAround
MouseLinkColor.Background = clNone
MouseLinkColor.Foreground = clBlue
MouseLinkColor.FrameEdges = sfeAround
LineHighlightColor.Background = clNone
LineHighlightColor.Foreground = clNone
LineHighlightColor.FrameEdges = sfeAround
inline TSynGutterPartList
object TSynGutterMarks
Width = 24
@ -991,7 +1139,6 @@ object EditorColorOptionsFrame: TEditorColorOptionsFrame
MouseActions = <>
MarkupInfo.Background = clBtnFace
MarkupInfo.Foreground = clNone
MarkupInfo.FrameEdges = sfeAround
DigitCount = 2
ShowOnlyLineNumbersMultiplesOf = 1
ZeroStart = False
@ -1008,7 +1155,6 @@ object EditorColorOptionsFrame: TEditorColorOptionsFrame
MouseActions = <>
MarkupInfo.Background = clWhite
MarkupInfo.Foreground = clGray
MarkupInfo.FrameEdges = sfeAround
end
object TSynGutterCodeFolding
MouseActions = <
@ -1039,7 +1185,6 @@ object EditorColorOptionsFrame: TEditorColorOptionsFrame
end>
MarkupInfo.Background = clNone
MarkupInfo.Foreground = clGray
MarkupInfo.FrameEdges = sfeAround
MouseActionsExpanded = <
item
ClickCount = ccAny
@ -1092,8 +1237,8 @@ object EditorColorOptionsFrame: TEditorColorOptionsFrame
end
object ToolButton2: TToolButton
Left = 24
Height = 22
Top = 0
Width = 5
Caption = 'ToolButton2'
Style = tbsDivider
end
@ -1105,7 +1250,7 @@ object EditorColorOptionsFrame: TEditorColorOptionsFrame
Style = tbsButtonDrop
end
object ColorSchemeButton: TToolButton
Left = 64
Left = 62
Top = 0
DropdownMenu = ColorSchemeMenu
OnClick = ColorSchemeButtonClick
@ -1113,7 +1258,7 @@ object EditorColorOptionsFrame: TEditorColorOptionsFrame
end
object FileExtensionsComboBox: TComboBox
AnchorSideTop.Side = asrBottom
Left = 99
Left = 95
Height = 23
Top = 0
Width = 139
@ -1130,20 +1275,20 @@ object EditorColorOptionsFrame: TEditorColorOptionsFrame
TabOrder = 0
end
object ToolButton5: TToolButton
Left = 238
Left = 234
Height = 22
Top = 0
Width = 5
Caption = 'ToolButton5'
Style = tbsDivider
end
object btnExport: TToolButton
Left = 243
Left = 239
Top = 0
OnClick = btnExportClick
ShowCaption = False
end
object SetAllAttributesToDefaultButton: TToolButton
Left = 266
Left = 262
Top = 0
OnClick = SetAllAttributesToDefaultButtonClick
ShowCaption = False

View File

@ -620,6 +620,7 @@
<Unit87>
<Filename Value="sourcesyneditor.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="SourceSynEditor"/>
</Unit87>
<Unit88>
<Filename Value="editoroptions.pp"/>
@ -776,6 +777,7 @@
<Unit115>
<Filename Value="sourcemarks.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="SourceMarks"/>
</Unit115>
<Unit116>
<Filename Value="checklfmdlg.pas"/>
@ -786,11 +788,15 @@
<Filename Value="sortselectiondlg.pas"/>
<IsPartOfProject Value="True"/>
<HasResources Value="True"/>
<UnitName Value="SortSelectionDlg"/>
</Unit117>
<Unit118>
<Filename Value="syncolorattribeditor.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="SynColorAttrEditor"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Frame"/>
<UnitName Value="SynColorAttribEditor"/>
</Unit118>
<Unit119>
<Filename Value="inputhistory.pas"/>
@ -1418,13 +1424,6 @@
<OtherUnitFiles Value="frames;../converter;../debugger;../debugger/frames;../packager;../designer;../packager/frames;../ide"/>
<UnitOutputDirectory Value="$(LazarusDir)/units/$(TargetCPU)-$(TargetOS)/$(LCLWidgetType)"/>
</SearchPaths>
<Linking>
<Options>
<Win32>
<GraphicApplication Value="True"/>
</Win32>
</Options>
</Linking>
<CompileReasons Compile="False" Build="False" Run="False"/>
</CompilerOptions>
<Debugging>

View File

@ -2102,6 +2102,9 @@ resourcestring
dlgAddHiAttrSyncroEditOther = 'Other Cells';
dlgAddHiAttrSyncroEditArea = 'Selected Area';
dlgAddHiAttrGutterSeparator = 'Gutter Separator';
dlgAddHiAttrDefaultWindow = 'Default Text / Window';
dlgAddHiAttrWindowBorder = 'Window border';
dlgAddHiAttrHighlightPrefix = 'Highlight prefix';
dlgAddHiSpecialVisibleChars = 'Visualized Special Chars';
dlgTopInfoHint = 'Current Class/Proc Hint';
dlgIfDefBlockInactive = 'Inactive $IFDEF code';

View File

@ -110,6 +110,13 @@ type
hcmSoftKeepEOL // Soft Center (distance to screen edge) Caret, but keep EOL at right border
);
TSourceEditCompletionForm = class(TSynCompletionForm)
private
FTextHighLightColor: TColor;
public
property TextHighLightColor: TColor read FTextHighLightColor write FTextHighLightColor;
end;
{ TSourceEditCompletion }
TSourceEditCompletion=class(TSynCompletion)
@ -117,10 +124,13 @@ type
FIdentCompletionJumpToError: boolean;
ccSelection: String;
// colors for the completion form (popup form, e.g. word completion)
FActiveEditDefaultFGColor: TColor;
FActiveEditDefaultBGColor: TColor;
FActiveEditSelectedFGColor: TColor;
FActiveEditSelectedBGColor: TColor;
FActiveEditBackgroundColor: TColor;
FActiveEditBackgroundSelectedColor: TColor;
FActiveEditBorderColor: TColor;
FActiveEditTextColor: TColor;
FActiveEditTextSelectedColor: TColor;
FActiveEditTextHighLightColor: TColor;
procedure ccExecute(Sender: TObject);
procedure ccCancel(Sender: TObject);
@ -145,6 +155,7 @@ type
protected
CurrentCompletionType: TCompletionType;
function Manager: TSourceEditorManager;
function GetCompletionFormClass: TSynBaseCompletionFormClass; override;
public
constructor Create(AOwner: TComponent); override;
property IdentCompletionJumpToError: Boolean
@ -2098,6 +2109,11 @@ begin
EnvironmentOptions.Desktop.CompletionWindowHeight := TheForm.NbLinesInWindow;
end;
function TSourceEditCompletion.GetCompletionFormClass: TSynBaseCompletionFormClass;
begin
Result := TSourceEditCompletionForm;
end;
procedure TSourceEditCompletion.ccExecute(Sender: TObject);
// init completion form
// called by OnExecute just before showing
@ -2106,15 +2122,19 @@ var
Prefix: String;
I: Integer;
NewStr: String;
SynEditor: TIDESynEditor;
Begin
{$IFDEF VerboseIDECompletionBox}
debugln(['TSourceEditCompletion.ccExecute START']);
{$ENDIF}
TheForm.Font := Editor.Font;
FActiveEditDefaultFGColor := Editor.Font.Color;
FActiveEditDefaultBGColor := Editor.Color;
FActiveEditSelectedFGColor := TSynEdit(Editor).SelectedColor.Foreground;
FActiveEditSelectedBGColor := TSynEdit(Editor).SelectedColor.Background;
FActiveEditTextColor := Editor.Font.Color;
FActiveEditBorderColor := RGBToColor(100, 100, 100);
FActiveEditBackgroundColor := Editor.Color;
FActiveEditTextSelectedColor := TSynEdit(Editor).SelectedColor.Foreground;
FActiveEditBackgroundSelectedColor := TSynEdit(Editor).SelectedColor.Background;
FActiveEditTextHighLightColor := RGBToColor(200, 13, 13);
if Editor.Highlighter<>nil
then begin
@ -2122,13 +2142,30 @@ Begin
if IdentifierAttribute<>nil
then begin
if IdentifierAttribute.ForeGround<>clNone then
FActiveEditDefaultFGColor:=IdentifierAttribute.ForeGround;
FActiveEditTextColor:=IdentifierAttribute.ForeGround;
if IdentifierAttribute.BackGround<>clNone then
FActiveEditDefaultBGColor:=IdentifierAttribute.BackGround;
FActiveEditBackgroundColor:=IdentifierAttribute.BackGround;
end;
end;
end;
if Editor is TIDESynEditor then
begin
SynEditor := TIDESynEditor(Editor);
if SynEditor.MarkupIdentComplWindow.TextColor<>clNone then
FActiveEditTextColor := SynEditor.MarkupIdentComplWindow.TextColor;
if SynEditor.MarkupIdentComplWindow.BorderColor<>clNone then
FActiveEditBorderColor := SynEditor.MarkupIdentComplWindow.BorderColor;
if SynEditor.MarkupIdentComplWindow.WindowColor<>clNone then
FActiveEditBackgroundColor := SynEditor.MarkupIdentComplWindow.WindowColor;
if SynEditor.MarkupIdentComplWindow.WindowColor<>clNone then
FActiveEditTextSelectedColor := SynEditor.MarkupIdentComplWindow.TextSelectedColor;
if SynEditor.MarkupIdentComplWindow.WindowColor<>clNone then
FActiveEditBackgroundSelectedColor := SynEditor.MarkupIdentComplWindow.BackgroundSelectedColor;
if SynEditor.MarkupIdentComplWindow.HighlightColor<>clNone then
FActiveEditTextHighLightColor := SynEditor.MarkupIdentComplWindow.HighlightColor;
end;
S := TStringList.Create;
try
Prefix := CurrentString;
@ -2170,11 +2207,13 @@ Begin
CurrentString:=Prefix;
// set colors
if (Editor<>nil) and (TheForm<>nil) then begin
with TheForm do begin
BackgroundColor := FActiveEditDefaultBGColor;
clSelect := FActiveEditSelectedBGColor;
TextColor := FActiveEditDefaultFGColor;
TextSelectedColor := FActiveEditSelectedFGColor;
with TheForm as TSourceEditCompletionForm do begin
DrawBorderColor := FActiveEditBorderColor;
BackgroundColor := FActiveEditBackgroundColor;
clSelect := FActiveEditBackgroundSelectedColor;
TextColor := FActiveEditTextColor;
TextSelectedColor := FActiveEditTextSelectedColor;
TextHighLightColor:= FActiveEditTextHighLightColor;
//debugln('TSourceEditCompletion.ccExecute A Color=',DbgS(Color),
// ' clSelect=',DbgS(clSelect),
// ' TextColor=',DbgS(TextColor),
@ -2366,8 +2405,11 @@ begin
end;
Font.Style:=[];
end;
Colors.FontColor := FActiveEditDefaultFGColor;
Colors.SelectedFontColor := FActiveEditSelectedFGColor;
Colors.BackgroundColor := FActiveEditBackgroundColor;
Colors.BackgroundSelectedColor := FActiveEditBackgroundSelectedColor;
Colors.TextColor := FActiveEditTextColor;
Colors.TextSelectedColor := FActiveEditTextSelectedColor;
Colors.TextHighLightColor := FActiveEditTextHighLightColor;
MaxX:=TheForm.ClientWidth;
t:=CurrentCompletionType;
if Manager.ActiveCompletionPlugin<>nil then
@ -2400,10 +2442,6 @@ begin
Font.Name:=EditorOpts.EditorFont;
end;
Font.Style:=[];
if not ItemSelected then
Font.Color := FActiveEditDefaultFGColor
else
Font.Color := FActiveEditSelectedFGColor;
end;
MaxX := Screen.Width-20;
t:=CurrentCompletionType;

View File

@ -98,8 +98,11 @@ type
);
TPaintCompletionItemColors = record
FontColor: TColor;
SelectedFontColor: TColor;
BackgroundColor: TColor;
BackgroundSelectedColor: TColor;
TextColor: TColor;
TextSelectedColor: TColor;
TextHighLightColor: TColor;
end;
PPaintCompletionItemColors = ^TPaintCompletionItemColors;
@ -273,13 +276,13 @@ begin
begin
if ItemSelected then
begin
ForegroundColor := Colors^.SelectedFontColor;
ForegroundColor := Colors^.TextSelectedColor;
AllowFontColor := ForegroundColor=clNone;
if ForegroundColor=clNone then
ForegroundColor := Colors^.FontColor;
ForegroundColor := Colors^.TextColor;
end else
begin
ForegroundColor := Colors^.FontColor;
ForegroundColor := Colors^.TextColor;
AllowFontColor := True;
end;
end else
@ -519,7 +522,8 @@ begin
Prefix := Copy(s, PrefixPosition, Length(aCompletion.CurrentString));
if PrefixPosition > 0 then
PrefixPosition := ACanvas.TextWidth(Copy(s, 1, PrefixPosition-1));
SetFontColor(RGBToColor(200, 13, 13));
if Colors<>nil then
SetFontColor(ColorToRGB(Colors^.TextHighLightColor));
ACanvas.TextOut(x+PrefixPosition+1,y,Prefix);
end;
inc(x,ACanvas.TextWidth(s)+1);

View File

@ -63,12 +63,13 @@ type
ahaGutter, ahaRightMargin, ahaSpecialVisibleChars,
ahaTopInfoHint,
ahaIfDefBlockInactive, ahaIfDefBlockActive, ahaIfDefBlockTmpActive,
ahaIfDefNodeInactive, ahaIfDefNodeActive, ahaIfDefNodeTmpActive
ahaIfDefNodeInactive, ahaIfDefNodeActive, ahaIfDefNodeTmpActive,
ahaIdentComplWindow, ahaIdentComplWindowBorder, ahaIdentComplWindowSelection, ahaIdentComplWindowHighlight
);
TAhaGroupName = (
agnDefault, agnLanguage, agnText, agnLine, agnGutter, agnTemplateMode, agnSyncronMode,
agnIfDef
agnIfDef, agnIdentComplWindow
);
TSourceEditorBase = class;

View File

@ -212,11 +212,29 @@ type
property IfDefTree;
end;
TSynMarkupIdentComplWindow = class // don't inherit from TSynEditMarkup, no regular markup
private
FBackgroundSelectedColor: TColor;
FBorderColor: TColor;
FHighlightColor: TColor;
FTextColor: TColor;
FTextSelectedColor: TColor;
FWindowColor: TColor;
public
property WindowColor: TColor read FWindowColor write FWindowColor;
property TextColor: TColor read FTextColor write FTextColor;
property BorderColor: TColor read FBorderColor write FBorderColor;
property HighlightColor: TColor read FHighlightColor write FHighlightColor;
property TextSelectedColor: TColor read FTextSelectedColor write FTextSelectedColor;
property BackgroundSelectedColor: TColor read FBackgroundSelectedColor write FBackgroundSelectedColor;
end;
{ TIDESynEditor }
TIDESynEditor = class(TSynEdit)
private
FCaretStamp: Int64;
FMarkupIdentComplWindow: TSynMarkupIdentComplWindow;
FShowTopInfo: boolean;
FTopInfoNestList: TLazSynEditNestedFoldsList;
FSyncroEdit: TSynPluginSyncroEdit;
@ -281,6 +299,7 @@ type
procedure SetIfdefNodeState(ALinePos, AstartPos: Integer; AState: TSynMarkupIfdefNodeState);
property OnIfdefNodeStateRequest: TSynMarkupIfdefStateRequest read FOnIfdefNodeStateRequest write FOnIfdefNodeStateRequest;
property MarkupIfDef: TSourceSynEditMarkupIfDef read FMarkupIfDef;
property MarkupIdentComplWindow: TSynMarkupIdentComplWindow read FMarkupIdentComplWindow;
property IsInMultiCaretMainExecution: Boolean read GetIsInMultiCaretMainExecution;
property IsInMultiCaretRepeatExecution: Boolean read GetIsInMultiCaretRepeatExecution;
property OnMultiCaretBeforeCommand: TSynMultiCaretBeforeCommand read GetOnMultiCaretBeforeCommand write SetOnMultiCaretBeforeCommand;
@ -1683,6 +1702,8 @@ begin
//FMarkupIfDef.OnNodeStateRequest := @DoIfDefNodeStateRequest;
TSynEditMarkupManager(MarkupMgr).AddMarkUp(FMarkupIfDef);
FMarkupIdentComplWindow := TSynMarkupIdentComplWindow.Create;
FPaintArea := TSourceLazSynSurfaceManager.Create(Self, FPaintArea);
GetCaretObj.AddChangeHandler(@SrcSynCaretChanged);
@ -1729,6 +1750,7 @@ begin
FreeAndNil(FExtraMarkupMgr);
FreeAndNil(FTopInfoMarkup);
FreeAndNil(FTopInfoNestList);
FreeAndNil(FMarkupIdentComplWindow);
inherited Destroy;
end;