mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-18 02:39:37 +02:00
IDE: use preview syntax highlighter for conditionals
git-svn-id: trunk@27459 -
This commit is contained in:
parent
200f270cbb
commit
69a72989a9
@ -75,9 +75,9 @@
|
||||
- prefix with package name
|
||||
- with macros from other packages/projects
|
||||
- show build macros in inherited compiler options
|
||||
- use syntax highlighter settings like the editor previews
|
||||
|
||||
ToDo:
|
||||
- use syntax highlighter settings like the editor previews
|
||||
- show syntax errors of conditionals
|
||||
- code completion
|
||||
- when package is renamed, rename macros too
|
||||
|
@ -1,7 +1,5 @@
|
||||
object CompOptBuildMacrosFrame: TCompOptBuildMacrosFrame
|
||||
Left = 0
|
||||
inherited CompOptBuildMacrosFrame: TCompOptBuildMacrosFrame
|
||||
Height = 430
|
||||
Top = 0
|
||||
Width = 496
|
||||
ClientHeight = 430
|
||||
ClientWidth = 496
|
||||
@ -9,19 +7,19 @@ object CompOptBuildMacrosFrame: TCompOptBuildMacrosFrame
|
||||
Visible = False
|
||||
DesignLeft = 308
|
||||
DesignTop = 268
|
||||
object MacrosGroupBox: TGroupBox
|
||||
object MacrosGroupBox: TGroupBox[0]
|
||||
Left = 0
|
||||
Height = 243
|
||||
Top = 0
|
||||
Width = 496
|
||||
Align = alTop
|
||||
Caption = 'MacrosGroupBox'
|
||||
ClientHeight = 224
|
||||
ClientWidth = 492
|
||||
ClientHeight = 222
|
||||
ClientWidth = 488
|
||||
TabOrder = 0
|
||||
object BuildMacrosTreeView: TTreeView
|
||||
Left = 0
|
||||
Height = 224
|
||||
Height = 222
|
||||
Top = 0
|
||||
Width = 227
|
||||
Align = alLeft
|
||||
@ -37,26 +35,26 @@ object CompOptBuildMacrosFrame: TCompOptBuildMacrosFrame
|
||||
end
|
||||
object Splitter1: TSplitter
|
||||
Left = 233
|
||||
Height = 224
|
||||
Height = 222
|
||||
Top = 0
|
||||
Width = 5
|
||||
end
|
||||
object BuildMacroSelectedGroupBox: TGroupBox
|
||||
Left = 244
|
||||
Height = 224
|
||||
Height = 222
|
||||
Top = 0
|
||||
Width = 248
|
||||
Width = 244
|
||||
Align = alClient
|
||||
BorderSpacing.Left = 6
|
||||
Caption = 'BuildMacroSelectedGroupBox'
|
||||
ClientHeight = 205
|
||||
ClientWidth = 244
|
||||
ClientHeight = 201
|
||||
ClientWidth = 236
|
||||
TabOrder = 2
|
||||
object BuildMacroDefaultLabel: TLabel
|
||||
Left = 6
|
||||
Height = 18
|
||||
Top = 72
|
||||
Width = 232
|
||||
Width = 224
|
||||
Align = alTop
|
||||
BorderSpacing.Top = 15
|
||||
BorderSpacing.Around = 6
|
||||
@ -67,7 +65,7 @@ object CompOptBuildMacrosFrame: TCompOptBuildMacrosFrame
|
||||
Left = 6
|
||||
Height = 18
|
||||
Top = 6
|
||||
Width = 232
|
||||
Width = 224
|
||||
Align = alTop
|
||||
BorderSpacing.Left = 6
|
||||
BorderSpacing.Top = 6
|
||||
@ -79,7 +77,7 @@ object CompOptBuildMacrosFrame: TCompOptBuildMacrosFrame
|
||||
Left = 6
|
||||
Height = 27
|
||||
Top = 24
|
||||
Width = 232
|
||||
Width = 224
|
||||
Align = alTop
|
||||
BorderSpacing.Left = 6
|
||||
BorderSpacing.Right = 6
|
||||
@ -88,7 +86,7 @@ object CompOptBuildMacrosFrame: TCompOptBuildMacrosFrame
|
||||
end
|
||||
end
|
||||
end
|
||||
object MacrosSplitter: TSplitter
|
||||
object MacrosSplitter: TSplitter[1]
|
||||
Cursor = crVSplit
|
||||
Left = 0
|
||||
Height = 5
|
||||
@ -97,21 +95,21 @@ object CompOptBuildMacrosFrame: TCompOptBuildMacrosFrame
|
||||
Align = alTop
|
||||
ResizeAnchor = akTop
|
||||
end
|
||||
object ConditionalsGroupBox: TGroupBox
|
||||
object ConditionalsGroupBox: TGroupBox[2]
|
||||
Left = 0
|
||||
Height = 182
|
||||
Top = 248
|
||||
Width = 496
|
||||
Align = alClient
|
||||
Caption = 'ConditionalsGroupBox'
|
||||
ClientHeight = 163
|
||||
ClientWidth = 492
|
||||
ClientHeight = 161
|
||||
ClientWidth = 488
|
||||
TabOrder = 2
|
||||
inline CondSynEdit: TSynEdit
|
||||
Left = 0
|
||||
Height = 163
|
||||
Height = 161
|
||||
Top = 0
|
||||
Width = 492
|
||||
Width = 488
|
||||
Align = alClient
|
||||
Font.Height = 9
|
||||
Font.Name = '-misc-dejavu sans mono-*-*-*-*-*-*-*-*-*-*-iso10646-1'
|
||||
@ -120,7 +118,7 @@ object CompOptBuildMacrosFrame: TCompOptBuildMacrosFrame
|
||||
ParentColor = False
|
||||
ParentFont = False
|
||||
TabOrder = 0
|
||||
Gutter.Width = 55
|
||||
Gutter.Width = 51
|
||||
Gutter.MouseActions = <
|
||||
item
|
||||
Shift = []
|
||||
@ -168,7 +166,6 @@ object CompOptBuildMacrosFrame: TCompOptBuildMacrosFrame
|
||||
Option = 0
|
||||
Priority = 0
|
||||
end>
|
||||
Highlighter = ConditionalsSynPasSyn
|
||||
Keystrokes = <
|
||||
item
|
||||
Command = ecUp
|
||||
@ -722,7 +719,7 @@ object CompOptBuildMacrosFrame: TCompOptBuildMacrosFrame
|
||||
Width = 24
|
||||
end
|
||||
object SynGutterLineNumber1: TSynGutterLineNumber
|
||||
Width = 15
|
||||
Width = 11
|
||||
MouseActions = <>
|
||||
MarkupInfo.Background = clBtnFace
|
||||
MarkupInfo.Foreground = clNone
|
||||
@ -828,16 +825,9 @@ object CompOptBuildMacrosFrame: TCompOptBuildMacrosFrame
|
||||
end
|
||||
end
|
||||
end
|
||||
object BuildMacrosTVPopupMenu: TPopupMenu
|
||||
object BuildMacrosTVPopupMenu: TPopupMenu[3]
|
||||
OnPopup = BuildMacrosTVPopupMenuPopup
|
||||
left = 99
|
||||
top = 77
|
||||
end
|
||||
object ConditionalsSynPasSyn: TSynPasSyn
|
||||
Enabled = False
|
||||
CompilerMode = pcmDelphi
|
||||
NestedComments = False
|
||||
left = 182
|
||||
top = 313
|
||||
end
|
||||
end
|
||||
|
@ -31,9 +31,9 @@ interface
|
||||
uses
|
||||
Classes, SysUtils, LCLProc, FileUtil, Controls, Forms, StdCtrls, Grids,
|
||||
Buttons, ExtCtrls, Dialogs, ComCtrls, Menus, AvgLvlTree, IDEImagesIntf,
|
||||
KeywordFuncLists, CodeToolsCfgScript,
|
||||
ProjectIntf, PackageIntf, CompilerOptions, IDEOptionsIntf,
|
||||
LazarusIDEStrConsts, CompOptsModes, PackageDefs, SynEdit, SynHighlighterPas;
|
||||
KeywordFuncLists, CodeToolsCfgScript, SynEdit, SynHighlighterPas, ProjectIntf,
|
||||
PackageIntf, CompilerOptions, IDEOptionsIntf, EditorOptions,
|
||||
LazarusIDEStrConsts, CompOptsModes, SourceSynEditor, PackageDefs;
|
||||
|
||||
type
|
||||
TCBMNodeType = (
|
||||
@ -57,7 +57,6 @@ type
|
||||
BuildMacroDefaultLabel: TLabel;
|
||||
BuildMacroDescriptionLabel: TLabel;
|
||||
ConditionalsGroupBox: TGroupBox;
|
||||
ConditionalsSynPasSyn: TSynPasSyn;
|
||||
CondSynEdit: TSynEdit;
|
||||
MacrosGroupBox: TGroupBox;
|
||||
MacrosSplitter: TSplitter;
|
||||
@ -73,6 +72,7 @@ type
|
||||
procedure NewValueClick(Sender: TObject);
|
||||
procedure DeleteValueClick(Sender: TObject);
|
||||
private
|
||||
FHighlighter: TIDESynFreePasSyn;
|
||||
FBuildMacros: TIDEBuildMacros;
|
||||
fVarImgID: LongInt;
|
||||
fValueImgID: LongInt;
|
||||
@ -555,6 +555,14 @@ procedure TCompOptBuildMacrosFrame.LoadFromOptions(Options: TBaseCompilerOptions
|
||||
begin
|
||||
BuildMacros:=Options.BuildMacros as TIDEBuildMacros;
|
||||
CondSynEdit.Lines.Text:=Options.Conditionals;
|
||||
EditorOpts.GetSynEditPreviewSettings(CondSynEdit);
|
||||
CondSynEdit.ReadOnly:=false;
|
||||
if FHighlighter=nil then
|
||||
begin
|
||||
FHighlighter := TPreviewPasSyn.Create(Self);
|
||||
CondSynEdit.Highlighter:=FHighlighter;
|
||||
end;
|
||||
EditorOpts.ReadHighlighterSettings(FHighlighter, '');
|
||||
end;
|
||||
|
||||
procedure TCompOptBuildMacrosFrame.SaveToOptions(Options: TBaseCompilerOptions
|
||||
|
Loading…
Reference in New Issue
Block a user