mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-07 11:09:41 +01:00
implemented IDE code macro selection
git-svn-id: trunk@8102 -
This commit is contained in:
parent
afe0734734
commit
4595d9066c
@ -652,9 +652,9 @@ begin
|
|||||||
// find variable name
|
// find variable name
|
||||||
GetIdentStartEndAtPosition(Src,CleanCursorPos,
|
GetIdentStartEndAtPosition(Src,CleanCursorPos,
|
||||||
VarNameAtom.StartPos,VarNameAtom.EndPos);
|
VarNameAtom.StartPos,VarNameAtom.EndPos);
|
||||||
|
//debugln('TCodeCompletionCodeTool.CheckLocalVarAssignmentSyntax A ',GetAtom(VarNameAtom),' "',copy(Src,CleanCursorPos,10),'"');
|
||||||
if VarNameAtom.StartPos=VarNameAtom.EndPos then exit;
|
if VarNameAtom.StartPos=VarNameAtom.EndPos then exit;
|
||||||
MoveCursorToCleanPos(VarNameAtom.StartPos);
|
MoveCursorToAtomPos(VarNameAtom);
|
||||||
ReadNextAtom;
|
|
||||||
if AtomIsKeyWord then exit;
|
if AtomIsKeyWord then exit;
|
||||||
|
|
||||||
// find assignment operator
|
// find assignment operator
|
||||||
@ -2473,6 +2473,10 @@ var CleanCursorPos, Indent, insertPos: integer;
|
|||||||
BuildSubTreeForBeginBlock(CursorNode);
|
BuildSubTreeForBeginBlock(CursorNode);
|
||||||
CursorNode:=FindDeepestNodeAtPos(CleanCursorPos,true);
|
CursorNode:=FindDeepestNodeAtPos(CleanCursorPos,true);
|
||||||
// read event name (optional)
|
// read event name (optional)
|
||||||
|
|
||||||
|
while (CleanCursorPos<SrcLen)
|
||||||
|
and (Src[CleanCursorPos] in [':','=',' ',#9]) do
|
||||||
|
inc(CleanCursorPos);
|
||||||
GetIdentStartEndAtPosition(Src,CleanCursorPos,
|
GetIdentStartEndAtPosition(Src,CleanCursorPos,
|
||||||
UserEventAtom.StartPos,UserEventAtom.EndPos);
|
UserEventAtom.StartPos,UserEventAtom.EndPos);
|
||||||
MoveCursorToAtomPos(UserEventAtom);
|
MoveCursorToAtomPos(UserEventAtom);
|
||||||
@ -2765,7 +2769,7 @@ begin
|
|||||||
while (CleanCursorPos>1) and (Src[CleanCursorPos] in [#10,#13]) do
|
while (CleanCursorPos>1) and (Src[CleanCursorPos] in [#10,#13]) do
|
||||||
dec(CleanCursorPos);
|
dec(CleanCursorPos);
|
||||||
// skip space (first try left)
|
// skip space (first try left)
|
||||||
while (CleanCursorPos>1) and (Src[CleanCursorPos-1] in [' ',#9,';']) do
|
while (CleanCursorPos>1) and (Src[CleanCursorPos] in [' ',#9,';']) do
|
||||||
dec(CleanCursorPos);
|
dec(CleanCursorPos);
|
||||||
if (CleanCursorPos>0) and (CleanCursorPos<SrcLen)
|
if (CleanCursorPos>0) and (CleanCursorPos<SrcLen)
|
||||||
and (Src[CleanCursorPos] in [#10,#13]) then begin
|
and (Src[CleanCursorPos] in [#10,#13]) then begin
|
||||||
|
|||||||
@ -32,7 +32,7 @@ interface
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
Classes, SysUtils, LCLProc, LResources, Forms, Controls, Graphics, Dialogs,
|
Classes, SysUtils, LCLProc, LResources, Forms, Controls, Graphics, Dialogs,
|
||||||
SynEdit, MacroIntf, SrcEditorIntf;
|
SynEdit, MacroIntf, LazIDEIntf, SrcEditorIntf;
|
||||||
|
|
||||||
type
|
type
|
||||||
TCodeMacroPromptDlg = class(TForm)
|
TCodeMacroPromptDlg = class(TForm)
|
||||||
@ -75,6 +75,7 @@ begin
|
|||||||
if copy(Pattern,1,length(CodeTemplateMakroMagic))=CodeTemplateMakroMagic
|
if copy(Pattern,1,length(CodeTemplateMakroMagic))=CodeTemplateMakroMagic
|
||||||
then begin
|
then begin
|
||||||
// macros enabled
|
// macros enabled
|
||||||
|
LazarusIDE.SaveSourceEditorChangesToCodeCache(-1);
|
||||||
|
|
||||||
// remove first line (i.e. macro enabled flag)
|
// remove first line (i.e. macro enabled flag)
|
||||||
Pattern:=TemplateValue;
|
Pattern:=TemplateValue;
|
||||||
|
|||||||
@ -1,46 +1,56 @@
|
|||||||
object CodeMacroSelectDlg: TCodeMacroSelectDlg
|
object CodeMacroSelectDlg: TCodeMacroSelectDlg
|
||||||
ActiveControl = MacrosListBox
|
ActiveControl = MacrosListBox
|
||||||
Caption = 'CodeMacroSelectDlg'
|
Caption = 'CodeMacroSelectDlg'
|
||||||
ClientHeight = 261
|
ClientHeight = 275
|
||||||
ClientWidth = 400
|
ClientWidth = 560
|
||||||
|
OnClose = FormClose
|
||||||
OnCreate = FormCreate
|
OnCreate = FormCreate
|
||||||
PixelsPerInch = 112
|
PixelsPerInch = 75
|
||||||
HorzScrollBar.Page = 399
|
HorzScrollBar.Page = 559
|
||||||
VertScrollBar.Page = 260
|
VertScrollBar.Page = 274
|
||||||
Left = 318
|
Left = 318
|
||||||
Height = 261
|
Height = 275
|
||||||
Top = 200
|
Top = 200
|
||||||
Width = 400
|
Width = 560
|
||||||
object MacrosGroupBox: TGroupBox
|
object MacrosGroupBox: TGroupBox
|
||||||
Anchors = [akTop, akLeft, akBottom]
|
Anchors = [akTop, akLeft, akBottom]
|
||||||
Caption = 'MacrosGroupBox'
|
Caption = 'MacrosGroupBox'
|
||||||
ClientHeight = 184
|
ClientHeight = 198
|
||||||
ClientWidth = 166
|
ClientWidth = 166
|
||||||
ParentColor = True
|
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
Left = 10
|
Left = 10
|
||||||
Height = 201
|
Height = 215
|
||||||
Top = 10
|
Top = 10
|
||||||
Width = 170
|
Width = 170
|
||||||
object MacrosListBox: TListBox
|
object MacrosListBox: TListBox
|
||||||
Align = alClient
|
Align = alClient
|
||||||
|
OnSelectionChange = MacrosListBoxSelectionChange
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
TopIndex = -1
|
TopIndex = -1
|
||||||
Height = 184
|
Height = 198
|
||||||
Width = 166
|
Width = 166
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
object DescriptionGroupBox: TGroupBox
|
object DescriptionGroupBox: TGroupBox
|
||||||
Anchors = [akTop, akLeft, akRight, akBottom]
|
Anchors = [akTop, akLeft, akRight, akBottom]
|
||||||
Caption = 'DescriptionGroupBox'
|
Caption = 'DescriptionGroupBox'
|
||||||
ClientHeight = 184
|
ClientHeight = 198
|
||||||
ClientWidth = 196
|
ClientWidth = 356
|
||||||
ParentColor = True
|
|
||||||
TabOrder = 1
|
TabOrder = 1
|
||||||
Left = 190
|
Left = 190
|
||||||
Height = 201
|
Height = 215
|
||||||
Top = 10
|
Top = 10
|
||||||
Width = 200
|
Width = 360
|
||||||
|
object DescriptionLabel: TLabel
|
||||||
|
Align = alClient
|
||||||
|
AutoSize = False
|
||||||
|
Caption = 'DescriptionLabel'
|
||||||
|
Color = clNone
|
||||||
|
ParentColor = False
|
||||||
|
WordWrap = True
|
||||||
|
Height = 198
|
||||||
|
Width = 356
|
||||||
|
end
|
||||||
end
|
end
|
||||||
object OkButton: TButton
|
object OkButton: TButton
|
||||||
Anchors = [akTop, akRight]
|
Anchors = [akTop, akRight]
|
||||||
@ -53,9 +63,9 @@ object CodeMacroSelectDlg: TCodeMacroSelectDlg
|
|||||||
AnchorSideTop.Control = CancelButton
|
AnchorSideTop.Control = CancelButton
|
||||||
AnchorSideTop.Side = asrCenter
|
AnchorSideTop.Side = asrCenter
|
||||||
AnchorSideRight.Control = CancelButton
|
AnchorSideRight.Control = CancelButton
|
||||||
Left = 234
|
Left = 394
|
||||||
Height = 26
|
Height = 26
|
||||||
Top = 221
|
Top = 235
|
||||||
Width = 61
|
Width = 61
|
||||||
end
|
end
|
||||||
object CancelButton: TButton
|
object CancelButton: TButton
|
||||||
@ -65,9 +75,9 @@ object CodeMacroSelectDlg: TCodeMacroSelectDlg
|
|||||||
Caption = 'CancelButton'
|
Caption = 'CancelButton'
|
||||||
ModalResult = 2
|
ModalResult = 2
|
||||||
TabOrder = 3
|
TabOrder = 3
|
||||||
Left = 305
|
Left = 465
|
||||||
Height = 26
|
Height = 26
|
||||||
Top = 221
|
Top = 235
|
||||||
Width = 85
|
Width = 85
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -2,25 +2,28 @@
|
|||||||
|
|
||||||
LazarusResources.Add('TCodeMacroSelectDlg','FORMDATA',[
|
LazarusResources.Add('TCodeMacroSelectDlg','FORMDATA',[
|
||||||
'TPF0'#19'TCodeMacroSelectDlg'#18'CodeMacroSelectDlg'#13'ActiveControl'#7#13
|
'TPF0'#19'TCodeMacroSelectDlg'#18'CodeMacroSelectDlg'#13'ActiveControl'#7#13
|
||||||
+'MacrosListBox'#7'Caption'#6#18'CodeMacroSelectDlg'#12'ClientHeight'#3#5#1#11
|
+'MacrosListBox'#7'Caption'#6#18'CodeMacroSelectDlg'#12'ClientHeight'#3#19#1
|
||||||
+'ClientWidth'#3#144#1#8'OnCreate'#7#10'FormCreate'#13'PixelsPerInch'#2'p'#18
|
+#11'ClientWidth'#3'0'#2#7'OnClose'#7#9'FormClose'#8'OnCreate'#7#10'FormCreat'
|
||||||
+'HorzScrollBar.Page'#3#143#1#18'VertScrollBar.Page'#3#4#1#4'Left'#3'>'#1#6'H'
|
+'e'#13'PixelsPerInch'#2'K'#18'HorzScrollBar.Page'#3'/'#2#18'VertScrollBar.Pa'
|
||||||
+'eight'#3#5#1#3'Top'#3#200#0#5'Width'#3#144#1#0#9'TGroupBox'#14'MacrosGroupB'
|
+'ge'#3#18#1#4'Left'#3'>'#1#6'Height'#3#19#1#3'Top'#3#200#0#5'Width'#3'0'#2#0
|
||||||
+'ox'#7'Anchors'#11#5'akTop'#6'akLeft'#8'akBottom'#0#7'Caption'#6#14'MacrosGr'
|
+#9'TGroupBox'#14'MacrosGroupBox'#7'Anchors'#11#5'akTop'#6'akLeft'#8'akBottom'
|
||||||
+'oupBox'#12'ClientHeight'#3#184#0#11'ClientWidth'#3#166#0#11'ParentColor'#9#8
|
+#0#7'Caption'#6#14'MacrosGroupBox'#12'ClientHeight'#3#198#0#11'ClientWidth'#3
|
||||||
+'TabOrder'#2#0#4'Left'#2#10#6'Height'#3#201#0#3'Top'#2#10#5'Width'#3#170#0#0
|
+#166#0#8'TabOrder'#2#0#4'Left'#2#10#6'Height'#3#215#0#3'Top'#2#10#5'Width'#3
|
||||||
+#8'TListBox'#13'MacrosListBox'#5'Align'#7#8'alClient'#8'TabOrder'#2#0#8'TopI'
|
+#170#0#0#8'TListBox'#13'MacrosListBox'#5'Align'#7#8'alClient'#17'OnSelection'
|
||||||
+'ndex'#2#255#6'Height'#3#184#0#5'Width'#3#166#0#0#0#0#9'TGroupBox'#19'Descri'
|
+'Change'#7#28'MacrosListBoxSelectionChange'#8'TabOrder'#2#0#8'TopIndex'#2#255
|
||||||
+'ptionGroupBox'#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#8'akBottom'#0#7
|
+#6'Height'#3#198#0#5'Width'#3#166#0#0#0#0#9'TGroupBox'#19'DescriptionGroupBo'
|
||||||
+'Caption'#6#19'DescriptionGroupBox'#12'ClientHeight'#3#184#0#11'ClientWidth'
|
+'x'#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#8'akBottom'#0#7'Caption'#6#19
|
||||||
+#3#196#0#11'ParentColor'#9#8'TabOrder'#2#1#4'Left'#3#190#0#6'Height'#3#201#0
|
+'DescriptionGroupBox'#12'ClientHeight'#3#198#0#11'ClientWidth'#3'd'#1#8'TabO'
|
||||||
+#3'Top'#2#10#5'Width'#3#200#0#0#0#7'TButton'#8'OkButton'#7'Anchors'#11#5'akT'
|
+'rder'#2#1#4'Left'#3#190#0#6'Height'#3#215#0#3'Top'#2#10#5'Width'#3'h'#1#0#6
|
||||||
+'op'#7'akRight'#0#8'AutoSize'#9#19'BorderSpacing.Right'#2#10#25'BorderSpacin'
|
+'TLabel'#16'DescriptionLabel'#5'Align'#7#8'alClient'#8'AutoSize'#8#7'Caption'
|
||||||
+'g.InnerBorder'#2#2#7'Caption'#6#8'OkButton'#11'ModalResult'#2#1#8'TabOrder'
|
+#6#16'DescriptionLabel'#5'Color'#7#6'clNone'#11'ParentColor'#8#8'WordWrap'#9
|
||||||
+#2#2#21'AnchorSideTop.Control'#7#12'CancelButton'#18'AnchorSideTop.Side'#7#9
|
+#6'Height'#3#198#0#5'Width'#3'd'#1#0#0#0#7'TButton'#8'OkButton'#7'Anchors'#11
|
||||||
+'asrCenter'#23'AnchorSideRight.Control'#7#12'CancelButton'#4'Left'#3#234#0#6
|
+#5'akTop'#7'akRight'#0#8'AutoSize'#9#19'BorderSpacing.Right'#2#10#25'BorderS'
|
||||||
+'Height'#2#26#3'Top'#3#221#0#5'Width'#2'='#0#0#7'TButton'#12'CancelButton'#7
|
+'pacing.InnerBorder'#2#2#7'Caption'#6#8'OkButton'#11'ModalResult'#2#1#8'TabO'
|
||||||
+'Anchors'#11#7'akRight'#8'akBottom'#0#8'AutoSize'#9#25'BorderSpacing.InnerBo'
|
+'rder'#2#2#21'AnchorSideTop.Control'#7#12'CancelButton'#18'AnchorSideTop.Sid'
|
||||||
+'rder'#2#2#7'Caption'#6#12'CancelButton'#11'ModalResult'#2#2#8'TabOrder'#2#3
|
+'e'#7#9'asrCenter'#23'AnchorSideRight.Control'#7#12'CancelButton'#4'Left'#3
|
||||||
+#4'Left'#3'1'#1#6'Height'#2#26#3'Top'#3#221#0#5'Width'#2'U'#0#0#0
|
+#138#1#6'Height'#2#26#3'Top'#3#235#0#5'Width'#2'='#0#0#7'TButton'#12'CancelB'
|
||||||
|
+'utton'#7'Anchors'#11#7'akRight'#8'akBottom'#0#8'AutoSize'#9#25'BorderSpacin'
|
||||||
|
+'g.InnerBorder'#2#2#7'Caption'#6#12'CancelButton'#11'ModalResult'#2#2#8'TabO'
|
||||||
|
+'rder'#2#3#4'Left'#3#209#1#6'Height'#2#26#3'Top'#3#235#0#5'Width'#2'U'#0#0#0
|
||||||
]);
|
]);
|
||||||
|
|||||||
@ -31,39 +31,100 @@ interface
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, StdCtrls,
|
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, StdCtrls,
|
||||||
Buttons, SrcEditorIntf;
|
Buttons, SrcEditorIntf, IDEWindowIntf,
|
||||||
|
InputHistory , LazarusIDEStrConsts;
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
{ TCodeMacroSelectDlg }
|
{ TCodeMacroSelectDlg }
|
||||||
|
|
||||||
TCodeMacroSelectDlg = class(TForm)
|
TCodeMacroSelectDlg = class(TForm)
|
||||||
|
DescriptionLabel: TLabel;
|
||||||
MacrosListBox: TListBox;
|
MacrosListBox: TListBox;
|
||||||
OkButton: TButton;
|
OkButton: TButton;
|
||||||
CancelButton: TButton;
|
CancelButton: TButton;
|
||||||
MacrosGroupBox: TGroupBox;
|
MacrosGroupBox: TGroupBox;
|
||||||
DescriptionGroupBox: TGroupBox;
|
DescriptionGroupBox: TGroupBox;
|
||||||
|
procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
|
||||||
procedure FormCreate(Sender: TObject);
|
procedure FormCreate(Sender: TObject);
|
||||||
|
procedure MacrosListBoxSelectionChange(Sender: TObject; User: boolean);
|
||||||
private
|
private
|
||||||
{ private declarations }
|
FSelected: TIDECodeMacro;
|
||||||
|
procedure FillMacrosListbox;
|
||||||
public
|
public
|
||||||
{ public declarations }
|
property Selected: TIDECodeMacro read FSelected;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
var
|
|
||||||
CodeMacroSelectDlg: TCodeMacroSelectDlg;
|
function ShowCodeMacroSelectDialog: TIDECodeMacro;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
|
function ShowCodeMacroSelectDialog: TIDECodeMacro;
|
||||||
|
var
|
||||||
|
CodeMacroSelectDlg: TCodeMacroSelectDlg;
|
||||||
|
begin
|
||||||
|
CodeMacroSelectDlg:=TCodeMacroSelectDlg.Create(nil);
|
||||||
|
if CodeMacroSelectDlg.ShowModal=mrOk then begin
|
||||||
|
Result:=CodeMacroSelectDlg.Selected;
|
||||||
|
end else begin
|
||||||
|
Result:=nil;
|
||||||
|
end;
|
||||||
|
CodeMacroSelectDlg.Free;
|
||||||
|
end;
|
||||||
|
|
||||||
{ TCodeMacroSelectDlg }
|
{ TCodeMacroSelectDlg }
|
||||||
|
|
||||||
procedure TCodeMacroSelectDlg.FormCreate(Sender: TObject);
|
procedure TCodeMacroSelectDlg.FormCreate(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
Caption:='Select Code Macro';
|
IDEDialogLayoutList.ApplyLayout(Self,550,250);
|
||||||
MacrosGroupBox.Caption:='Macros';
|
|
||||||
DescriptionGroupBox.Caption:='Description';
|
Caption:=lisCTSelectCodeMacro;
|
||||||
OkButton.Caption:='Insert Macro';
|
MacrosGroupBox.Caption:=lisEdtExtToolMacros;
|
||||||
CancelButton.Caption:='Cancel';
|
DescriptionGroupBox.Caption:=lisToDoLDescription;
|
||||||
|
OkButton.Caption:=lisCTInsertMacro;
|
||||||
|
CancelButton.Caption:=dlgCancel;
|
||||||
|
|
||||||
|
FillMacrosListbox;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCodeMacroSelectDlg.FormClose(Sender: TObject;
|
||||||
|
var CloseAction: TCloseAction);
|
||||||
|
begin
|
||||||
|
IDEDialogLayoutList.SaveLayout(Self);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCodeMacroSelectDlg.MacrosListBoxSelectionChange(Sender: TObject;
|
||||||
|
User: boolean);
|
||||||
|
var
|
||||||
|
i: LongInt;
|
||||||
|
MacroName: string;
|
||||||
|
begin
|
||||||
|
i:=MacrosListBox.ItemIndex;
|
||||||
|
if (i>=0) then begin
|
||||||
|
MacroName:=MacrosListBox.Items[i];
|
||||||
|
FSelected:=IDECodeMacros.FindByName(MacroName);
|
||||||
|
end else begin
|
||||||
|
FSelected:=nil;
|
||||||
|
end;
|
||||||
|
if FSelected<>nil then begin
|
||||||
|
DescriptionLabel.Caption:=FSelected.LongDescription;
|
||||||
|
end else begin
|
||||||
|
DescriptionLabel.Caption:=lisCTPleaseSelectAMacro;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCodeMacroSelectDlg.FillMacrosListbox;
|
||||||
|
var
|
||||||
|
i: Integer;
|
||||||
|
begin
|
||||||
|
with MacrosListBox.Items do begin
|
||||||
|
BeginUpdate;
|
||||||
|
Clear;
|
||||||
|
for i:=0 to IDECodeMacros.Count-1 do
|
||||||
|
Add(IDECodeMacros[i].Name);
|
||||||
|
EndUpdate;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
initialization
|
initialization
|
||||||
|
|||||||
@ -1,28 +1,28 @@
|
|||||||
object CodeTemplateDialog: TCodeTemplateDialog
|
object CodeTemplateDialog: TCodeTemplateDialog
|
||||||
ActiveControl = FilenameEdit
|
ActiveControl = FilenameEdit
|
||||||
Caption = 'CodeTemplateDialog'
|
Caption = 'CodeTemplateDialog'
|
||||||
ClientHeight = 432
|
ClientHeight = 450
|
||||||
ClientWidth = 596
|
ClientWidth = 600
|
||||||
|
OnClose = FormClose
|
||||||
OnCreate = FormCreate
|
OnCreate = FormCreate
|
||||||
PixelsPerInch = 112
|
PixelsPerInch = 75
|
||||||
HorzScrollBar.Page = 595
|
HorzScrollBar.Page = 599
|
||||||
VertScrollBar.Page = 431
|
VertScrollBar.Page = 449
|
||||||
Left = 290
|
Left = 290
|
||||||
Height = 432
|
Height = 450
|
||||||
Top = 163
|
Top = 163
|
||||||
Width = 596
|
Width = 600
|
||||||
object FilenameGroupBox: TGroupBox
|
object FilenameGroupBox: TGroupBox
|
||||||
Align = alTop
|
Align = alTop
|
||||||
BorderSpacing.Around = 5
|
BorderSpacing.Around = 5
|
||||||
Caption = 'FilenameGroupBox'
|
Caption = 'FilenameGroupBox'
|
||||||
ClientHeight = 42
|
ClientHeight = 42
|
||||||
ClientWidth = 582
|
ClientWidth = 586
|
||||||
ParentColor = True
|
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
Left = 5
|
Left = 5
|
||||||
Height = 59
|
Height = 59
|
||||||
Top = 5
|
Top = 5
|
||||||
Width = 586
|
Width = 590
|
||||||
object FilenameEdit: TEdit
|
object FilenameEdit: TEdit
|
||||||
Anchors = [akTop, akLeft, akRight]
|
Anchors = [akTop, akLeft, akRight]
|
||||||
BorderSpacing.Right = 5
|
BorderSpacing.Right = 5
|
||||||
@ -59,9 +59,9 @@ object CodeTemplateDialog: TCodeTemplateDialog
|
|||||||
AnchorSideRight.Control = CancelButton
|
AnchorSideRight.Control = CancelButton
|
||||||
AnchorSideBottom.Control = CancelButton
|
AnchorSideBottom.Control = CancelButton
|
||||||
AnchorSideBottom.Side = asrBottom
|
AnchorSideBottom.Side = asrBottom
|
||||||
Left = 423
|
Left = 427
|
||||||
Height = 26
|
Height = 26
|
||||||
Top = 396
|
Top = 414
|
||||||
Width = 61
|
Width = 61
|
||||||
end
|
end
|
||||||
object CancelButton: TButton
|
object CancelButton: TButton
|
||||||
@ -71,9 +71,9 @@ object CodeTemplateDialog: TCodeTemplateDialog
|
|||||||
Caption = 'CancelButton'
|
Caption = 'CancelButton'
|
||||||
ModalResult = 2
|
ModalResult = 2
|
||||||
TabOrder = 2
|
TabOrder = 2
|
||||||
Left = 498
|
Left = 502
|
||||||
Height = 26
|
Height = 26
|
||||||
Top = 396
|
Top = 414
|
||||||
Width = 85
|
Width = 85
|
||||||
end
|
end
|
||||||
object TemplateGroupBox: TGroupBox
|
object TemplateGroupBox: TGroupBox
|
||||||
@ -81,32 +81,34 @@ object CodeTemplateDialog: TCodeTemplateDialog
|
|||||||
Anchors = [akTop, akLeft, akRight, akBottom]
|
Anchors = [akTop, akLeft, akRight, akBottom]
|
||||||
BorderSpacing.Around = 5
|
BorderSpacing.Around = 5
|
||||||
Caption = 'TemplateGroupBox'
|
Caption = 'TemplateGroupBox'
|
||||||
ClientHeight = 305
|
ClientHeight = 323
|
||||||
ClientWidth = 582
|
ClientWidth = 586
|
||||||
ParentColor = True
|
|
||||||
TabOrder = 3
|
TabOrder = 3
|
||||||
AnchorSideBottom.Control = CancelButton
|
AnchorSideBottom.Control = CancelButton
|
||||||
Left = 5
|
Left = 5
|
||||||
Height = 322
|
Height = 340
|
||||||
Top = 69
|
Top = 69
|
||||||
Width = 586
|
Width = 590
|
||||||
object TemplateListBox: TListBox
|
object TemplateListBox: TListBox
|
||||||
Anchors = [akTop, akLeft, akRight, akBottom]
|
Anchors = [akTop, akLeft, akRight, akBottom]
|
||||||
OnSelectionChange = TemplateListBoxSelectionChange
|
OnSelectionChange = TemplateListBoxSelectionChange
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
TopIndex = -1
|
TopIndex = -1
|
||||||
AnchorSideBottom.Control = TemplateSplitter
|
AnchorSideBottom.Control = TemplateSplitter
|
||||||
Height = 150
|
Height = 190
|
||||||
Width = 408
|
Width = 412
|
||||||
end
|
end
|
||||||
object TemplateSynEdit: TSynEdit
|
object TemplateSynEdit: TSynEdit
|
||||||
Align = alBottom
|
Align = alBottom
|
||||||
Font.Height = -18
|
Font.Height = -18
|
||||||
Font.Name = 'courier'
|
Font.Name = 'courier'
|
||||||
Height = 150
|
Height = 128
|
||||||
Name = 'TemplateSynEdit'
|
Name = 'TemplateSynEdit'
|
||||||
|
ParentColor = False
|
||||||
TabOrder = 1
|
TabOrder = 1
|
||||||
Width = 582
|
Width = 586
|
||||||
|
BookMarkOptions.OnChange = nil
|
||||||
|
Gutter.OnChange = nil
|
||||||
Gutter.CodeFoldingWidth = 14
|
Gutter.CodeFoldingWidth = 14
|
||||||
Highlighter = ASynPasSyn
|
Highlighter = ASynPasSyn
|
||||||
Keystrokes = <
|
Keystrokes = <
|
||||||
@ -433,22 +435,22 @@ object CodeTemplateDialog: TCodeTemplateDialog
|
|||||||
Lines.Strings = (
|
Lines.Strings = (
|
||||||
'TemplateSynEdit'
|
'TemplateSynEdit'
|
||||||
)
|
)
|
||||||
|
SelectedColor.OnChange = nil
|
||||||
Cursor = crIBeam
|
Cursor = crIBeam
|
||||||
Height = 150
|
Height = 128
|
||||||
Top = 155
|
Top = 195
|
||||||
Width = 582
|
Width = 586
|
||||||
end
|
end
|
||||||
object TemplateSplitter: TSplitter
|
object TemplateSplitter: TSplitter
|
||||||
Align = alBottom
|
Align = alBottom
|
||||||
Cursor = crVSplit
|
Cursor = crVSplit
|
||||||
Height = 5
|
Height = 5
|
||||||
ParentColor = True
|
Width = 586
|
||||||
Width = 582
|
|
||||||
ResizeAnchor = akBottom
|
ResizeAnchor = akBottom
|
||||||
Cursor = crVSplit
|
Cursor = crVSplit
|
||||||
Height = 5
|
Height = 5
|
||||||
Top = 150
|
Top = 190
|
||||||
Width = 582
|
Width = 586
|
||||||
end
|
end
|
||||||
object AddButton: TButton
|
object AddButton: TButton
|
||||||
Anchors = [akTop, akRight]
|
Anchors = [akTop, akRight]
|
||||||
@ -456,7 +458,7 @@ object CodeTemplateDialog: TCodeTemplateDialog
|
|||||||
Caption = 'AddButton'
|
Caption = 'AddButton'
|
||||||
OnClick = AddButtonClick
|
OnClick = AddButtonClick
|
||||||
TabOrder = 2
|
TabOrder = 2
|
||||||
Left = 457
|
Left = 461
|
||||||
Height = 30
|
Height = 30
|
||||||
Width = 115
|
Width = 115
|
||||||
end
|
end
|
||||||
@ -466,7 +468,7 @@ object CodeTemplateDialog: TCodeTemplateDialog
|
|||||||
Caption = 'DeleteButton'
|
Caption = 'DeleteButton'
|
||||||
OnClick = DeleteButtonClick
|
OnClick = DeleteButtonClick
|
||||||
TabOrder = 3
|
TabOrder = 3
|
||||||
Left = 457
|
Left = 461
|
||||||
Height = 30
|
Height = 30
|
||||||
Top = 36
|
Top = 36
|
||||||
Width = 115
|
Width = 115
|
||||||
@ -477,7 +479,7 @@ object CodeTemplateDialog: TCodeTemplateDialog
|
|||||||
Caption = 'EditButton'
|
Caption = 'EditButton'
|
||||||
OnClick = EditButtonClick
|
OnClick = EditButtonClick
|
||||||
TabOrder = 4
|
TabOrder = 4
|
||||||
Left = 457
|
Left = 461
|
||||||
Height = 30
|
Height = 30
|
||||||
Top = 71
|
Top = 71
|
||||||
Width = 115
|
Width = 115
|
||||||
@ -486,10 +488,21 @@ object CodeTemplateDialog: TCodeTemplateDialog
|
|||||||
Anchors = [akTop, akRight]
|
Anchors = [akTop, akRight]
|
||||||
Caption = 'UseMakrosCheckBox'
|
Caption = 'UseMakrosCheckBox'
|
||||||
TabOrder = 5
|
TabOrder = 5
|
||||||
Left = 426
|
Left = 433
|
||||||
Height = 24
|
Height = 24
|
||||||
Top = 106
|
Top = 106
|
||||||
Width = 146
|
Width = 143
|
||||||
|
end
|
||||||
|
object InsertMacroButton: TButton
|
||||||
|
Anchors = [akTop, akRight]
|
||||||
|
BorderSpacing.InnerBorder = 2
|
||||||
|
Caption = 'InsertMacroButton'
|
||||||
|
OnClick = InsertMacroButtonClick
|
||||||
|
TabOrder = 6
|
||||||
|
Left = 461
|
||||||
|
Height = 25
|
||||||
|
Top = 141
|
||||||
|
Width = 115
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
object ASynPasSyn: TSynPasSyn
|
object ASynPasSyn: TSynPasSyn
|
||||||
|
|||||||
@ -2,99 +2,104 @@
|
|||||||
|
|
||||||
LazarusResources.Add('TCodeTemplateDialog','FORMDATA',[
|
LazarusResources.Add('TCodeTemplateDialog','FORMDATA',[
|
||||||
'TPF0'#19'TCodeTemplateDialog'#18'CodeTemplateDialog'#13'ActiveControl'#7#12
|
'TPF0'#19'TCodeTemplateDialog'#18'CodeTemplateDialog'#13'ActiveControl'#7#12
|
||||||
+'FilenameEdit'#7'Caption'#6#18'CodeTemplateDialog'#12'ClientHeight'#3#176#1
|
+'FilenameEdit'#7'Caption'#6#18'CodeTemplateDialog'#12'ClientHeight'#3#194#1
|
||||||
+#11'ClientWidth'#3'T'#2#8'OnCreate'#7#10'FormCreate'#13'PixelsPerInch'#2'p'
|
+#11'ClientWidth'#3'X'#2#7'OnClose'#7#9'FormClose'#8'OnCreate'#7#10'FormCreat'
|
||||||
+#18'HorzScrollBar.Page'#3'S'#2#18'VertScrollBar.Page'#3#175#1#4'Left'#3'"'#1
|
+'e'#13'PixelsPerInch'#2'K'#18'HorzScrollBar.Page'#3'W'#2#18'VertScrollBar.Pa'
|
||||||
+#6'Height'#3#176#1#3'Top'#3#163#0#5'Width'#3'T'#2#0#9'TGroupBox'#16'Filename'
|
+'ge'#3#193#1#4'Left'#3'"'#1#6'Height'#3#194#1#3'Top'#3#163#0#5'Width'#3'X'#2
|
||||||
+'GroupBox'#5'Align'#7#5'alTop'#20'BorderSpacing.Around'#2#5#7'Caption'#6#16
|
+#0#9'TGroupBox'#16'FilenameGroupBox'#5'Align'#7#5'alTop'#20'BorderSpacing.Ar'
|
||||||
+'FilenameGroupBox'#12'ClientHeight'#2'*'#11'ClientWidth'#3'F'#2#11'ParentCol'
|
+'ound'#2#5#7'Caption'#6#16'FilenameGroupBox'#12'ClientHeight'#2'*'#11'Client'
|
||||||
+'or'#9#8'TabOrder'#2#0#4'Left'#2#5#6'Height'#2';'#3'Top'#2#5#5'Width'#3'J'#2
|
+'Width'#3'J'#2#8'TabOrder'#2#0#4'Left'#2#5#6'Height'#2';'#3'Top'#2#5#5'Width'
|
||||||
+#0#5'TEdit'#12'FilenameEdit'#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#0#19
|
+#3'N'#2#0#5'TEdit'#12'FilenameEdit'#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRig'
|
||||||
+'BorderSpacing.Right'#2#5#8'TabOrder'#2#0#4'Text'#6#12'FilenameEdit'#23'Anch'
|
+'ht'#0#19'BorderSpacing.Right'#2#5#8'TabOrder'#2#0#4'Text'#6#12'FilenameEdit'
|
||||||
+'orSideRight.Control'#7#14'FilenameButton'#4'Left'#2#9#6'Height'#2#23#3'Top'
|
+#23'AnchorSideRight.Control'#7#14'FilenameButton'#4'Left'#2#9#6'Height'#2#23
|
||||||
+#2#4#5'Width'#3#19#2#0#0#7'TButton'#14'FilenameButton'#7'Anchors'#11#5'akTop'
|
+#3'Top'#2#4#5'Width'#3#19#2#0#0#7'TButton'#14'FilenameButton'#7'Anchors'#11#5
|
||||||
+#6'akLeft'#8'akBottom'#0#25'BorderSpacing.InnerBorder'#2#2#7'Caption'#6#3'..'
|
+'akTop'#6'akLeft'#8'akBottom'#0#25'BorderSpacing.InnerBorder'#2#2#7'Caption'
|
||||||
+'.'#7'OnClick'#7#19'FilenameButtonClick'#8'TabOrder'#2#1#24'AnchorSideBottom'
|
+#6#3'...'#7'OnClick'#7#19'FilenameButtonClick'#8'TabOrder'#2#1#24'AnchorSide'
|
||||||
+'.Control'#7#12'FilenameEdit'#21'AnchorSideBottom.Side'#7#9'asrBottom'#4'Lef'
|
+'Bottom.Control'#7#12'FilenameEdit'#21'AnchorSideBottom.Side'#7#9'asrBottom'
|
||||||
+'t'#3'!'#2#6'Height'#2#23#3'Top'#2#4#5'Width'#2#30#0#0#0#7'TButton'#8'OkButt'
|
+#4'Left'#3'!'#2#6'Height'#2#23#3'Top'#2#4#5'Width'#2#30#0#0#0#7'TButton'#8'O'
|
||||||
+'on'#7'Anchors'#11#7'akRight'#8'akBottom'#0#8'AutoSize'#9#19'BorderSpacing.R'
|
+'kButton'#7'Anchors'#11#7'akRight'#8'akBottom'#0#8'AutoSize'#9#19'BorderSpac'
|
||||||
+'ight'#2#14#25'BorderSpacing.InnerBorder'#2#2#7'Caption'#6#8'OkButton'#7'OnC'
|
+'ing.Right'#2#14#25'BorderSpacing.InnerBorder'#2#2#7'Caption'#6#8'OkButton'#7
|
||||||
+'lick'#7#13'OkButtonClick'#8'TabOrder'#2#1#23'AnchorSideRight.Control'#7#12
|
+'OnClick'#7#13'OkButtonClick'#8'TabOrder'#2#1#23'AnchorSideRight.Control'#7
|
||||||
+'CancelButton'#24'AnchorSideBottom.Control'#7#12'CancelButton'#21'AnchorSide'
|
+#12'CancelButton'#24'AnchorSideBottom.Control'#7#12'CancelButton'#21'AnchorS'
|
||||||
+'Bottom.Side'#7#9'asrBottom'#4'Left'#3#167#1#6'Height'#2#26#3'Top'#3#140#1#5
|
+'ideBottom.Side'#7#9'asrBottom'#4'Left'#3#171#1#6'Height'#2#26#3'Top'#3#158#1
|
||||||
+'Width'#2'='#0#0#7'TButton'#12'CancelButton'#7'Anchors'#11#7'akRight'#8'akBo'
|
+#5'Width'#2'='#0#0#7'TButton'#12'CancelButton'#7'Anchors'#11#7'akRight'#8'ak'
|
||||||
+'ttom'#0#8'AutoSize'#9#25'BorderSpacing.InnerBorder'#2#2#7'Caption'#6#12'Can'
|
+'Bottom'#0#8'AutoSize'#9#25'BorderSpacing.InnerBorder'#2#2#7'Caption'#6#12'C'
|
||||||
+'celButton'#11'ModalResult'#2#2#8'TabOrder'#2#2#4'Left'#3#242#1#6'Height'#2
|
+'ancelButton'#11'ModalResult'#2#2#8'TabOrder'#2#2#4'Left'#3#246#1#6'Height'#2
|
||||||
+#26#3'Top'#3#140#1#5'Width'#2'U'#0#0#9'TGroupBox'#16'TemplateGroupBox'#5'Ali'
|
+#26#3'Top'#3#158#1#5'Width'#2'U'#0#0#9'TGroupBox'#16'TemplateGroupBox'#5'Ali'
|
||||||
+'gn'#7#5'alTop'#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#8'akBottom'#0#20
|
+'gn'#7#5'alTop'#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#8'akBottom'#0#20
|
||||||
+'BorderSpacing.Around'#2#5#7'Caption'#6#16'TemplateGroupBox'#12'ClientHeight'
|
+'BorderSpacing.Around'#2#5#7'Caption'#6#16'TemplateGroupBox'#12'ClientHeight'
|
||||||
+#3'1'#1#11'ClientWidth'#3'F'#2#11'ParentColor'#9#8'TabOrder'#2#3#24'AnchorSi'
|
+#3'C'#1#11'ClientWidth'#3'J'#2#8'TabOrder'#2#3#24'AnchorSideBottom.Control'#7
|
||||||
+'deBottom.Control'#7#12'CancelButton'#4'Left'#2#5#6'Height'#3'B'#1#3'Top'#2
|
+#12'CancelButton'#4'Left'#2#5#6'Height'#3'T'#1#3'Top'#2'E'#5'Width'#3'N'#2#0
|
||||||
+'E'#5'Width'#3'J'#2#0#8'TListBox'#15'TemplateListBox'#7'Anchors'#11#5'akTop'
|
+#8'TListBox'#15'TemplateListBox'#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'
|
||||||
+#6'akLeft'#7'akRight'#8'akBottom'#0#17'OnSelectionChange'#7#30'TemplateListB'
|
+#8'akBottom'#0#17'OnSelectionChange'#7#30'TemplateListBoxSelectionChange'#8
|
||||||
+'oxSelectionChange'#8'TabOrder'#2#0#8'TopIndex'#2#255#24'AnchorSideBottom.Co'
|
+'TabOrder'#2#0#8'TopIndex'#2#255#24'AnchorSideBottom.Control'#7#16'TemplateS'
|
||||||
+'ntrol'#7#16'TemplateSplitter'#6'Height'#3#150#0#5'Width'#3#152#1#0#0#8'TSyn'
|
+'plitter'#6'Height'#3#190#0#5'Width'#3#156#1#0#0#8'TSynEdit'#15'TemplateSynE'
|
||||||
+'Edit'#15'TemplateSynEdit'#5'Align'#7#8'alBottom'#11'Font.Height'#2#238#9'Fo'
|
+'dit'#5'Align'#7#8'alBottom'#11'Font.Height'#2#238#9'Font.Name'#6#7'courier'
|
||||||
+'nt.Name'#6#7'courier'#6'Height'#3#150#0#4'Name'#6#15'TemplateSynEdit'#8'Tab'
|
+#6'Height'#3#128#0#4'Name'#6#15'TemplateSynEdit'#11'ParentColor'#8#8'TabOrde'
|
||||||
+'Order'#2#1#5'Width'#3'F'#2#23'Gutter.CodeFoldingWidth'#2#14#11'Highlighter'
|
+'r'#2#1#5'Width'#3'J'#2#24'BookMarkOptions.OnChange'#13#15'Gutter.OnChange'
|
||||||
+#7#10'ASynPasSyn'#10'Keystrokes'#14#1#7'Command'#2#3#8'ShortCut'#2'&'#0#1#7
|
+#13#23'Gutter.CodeFoldingWidth'#2#14#11'Highlighter'#7#10'ASynPasSyn'#10'Key'
|
||||||
+'Command'#2'g'#8'ShortCut'#3'& '#0#1#7'Command'#3#211#0#8'ShortCut'#3'&@'#0#1
|
+'strokes'#14#1#7'Command'#2#3#8'ShortCut'#2'&'#0#1#7'Command'#2'g'#8'ShortCu'
|
||||||
+#7'Command'#2#4#8'ShortCut'#2'('#0#1#7'Command'#2'h'#8'ShortCut'#3'( '#0#1#7
|
+'t'#3'& '#0#1#7'Command'#3#211#0#8'ShortCut'#3'&@'#0#1#7'Command'#2#4#8'Shor'
|
||||||
+'Command'#3#212#0#8'ShortCut'#3'(@'#0#1#7'Command'#2#1#8'ShortCut'#2'%'#0#1#7
|
+'tCut'#2'('#0#1#7'Command'#2'h'#8'ShortCut'#3'( '#0#1#7'Command'#3#212#0#8'S'
|
||||||
+'Command'#2'e'#8'ShortCut'#3'% '#0#1#7'Command'#2#5#8'ShortCut'#3'%@'#0#1#7
|
+'hortCut'#3'(@'#0#1#7'Command'#2#1#8'ShortCut'#2'%'#0#1#7'Command'#2'e'#8'Sh'
|
||||||
+'Command'#2'i'#8'ShortCut'#3'%`'#0#1#7'Command'#2#2#8'ShortCut'#2''''#0#1#7
|
+'ortCut'#3'% '#0#1#7'Command'#2#5#8'ShortCut'#3'%@'#0#1#7'Command'#2'i'#8'Sh'
|
||||||
+'Command'#2'f'#8'ShortCut'#3''' '#0#1#7'Command'#2#6#8'ShortCut'#3'''@'#0#1#7
|
+'ortCut'#3'%`'#0#1#7'Command'#2#2#8'ShortCut'#2''''#0#1#7'Command'#2'f'#8'Sh'
|
||||||
+'Command'#2'j'#8'ShortCut'#3'''`'#0#1#7'Command'#2#10#8'ShortCut'#2'"'#0#1#7
|
+'ortCut'#3''' '#0#1#7'Command'#2#6#8'ShortCut'#3'''@'#0#1#7'Command'#2'j'#8
|
||||||
+'Command'#2'n'#8'ShortCut'#3'" '#0#1#7'Command'#2#14#8'ShortCut'#3'"@'#0#1#7
|
+'ShortCut'#3'''`'#0#1#7'Command'#2#10#8'ShortCut'#2'"'#0#1#7'Command'#2'n'#8
|
||||||
+'Command'#2'r'#8'ShortCut'#3'"`'#0#1#7'Command'#2#9#8'ShortCut'#2'!'#0#1#7'C'
|
+'ShortCut'#3'" '#0#1#7'Command'#2#14#8'ShortCut'#3'"@'#0#1#7'Command'#2'r'#8
|
||||||
+'ommand'#2'm'#8'ShortCut'#3'! '#0#1#7'Command'#2#13#8'ShortCut'#3'!@'#0#1#7
|
+'ShortCut'#3'"`'#0#1#7'Command'#2#9#8'ShortCut'#2'!'#0#1#7'Command'#2'm'#8'S'
|
||||||
+'Command'#2'q'#8'ShortCut'#3'!`'#0#1#7'Command'#2#7#8'ShortCut'#2'$'#0#1#7'C'
|
+'hortCut'#3'! '#0#1#7'Command'#2#13#8'ShortCut'#3'!@'#0#1#7'Command'#2'q'#8
|
||||||
+'ommand'#2'k'#8'ShortCut'#3'$ '#0#1#7'Command'#2#15#8'ShortCut'#3'$@'#0#1#7
|
+'ShortCut'#3'!`'#0#1#7'Command'#2#7#8'ShortCut'#2'$'#0#1#7'Command'#2'k'#8'S'
|
||||||
+'Command'#2's'#8'ShortCut'#3'$`'#0#1#7'Command'#2#8#8'ShortCut'#2'#'#0#1#7'C'
|
+'hortCut'#3'$ '#0#1#7'Command'#2#15#8'ShortCut'#3'$@'#0#1#7'Command'#2's'#8
|
||||||
+'ommand'#2'l'#8'ShortCut'#3'# '#0#1#7'Command'#2#16#8'ShortCut'#3'#@'#0#1#7
|
+'ShortCut'#3'$`'#0#1#7'Command'#2#8#8'ShortCut'#2'#'#0#1#7'Command'#2'l'#8'S'
|
||||||
+'Command'#2't'#8'ShortCut'#3'#`'#0#1#7'Command'#3#223#0#8'ShortCut'#2'-'#0#1
|
+'hortCut'#3'# '#0#1#7'Command'#2#16#8'ShortCut'#3'#@'#0#1#7'Command'#2't'#8
|
||||||
+#7'Command'#3#201#0#8'ShortCut'#3'-@'#0#1#7'Command'#3'\'#2#8'ShortCut'#3'- '
|
+'ShortCut'#3'#`'#0#1#7'Command'#3#223#0#8'ShortCut'#2'-'#0#1#7'Command'#3#201
|
||||||
+#0#1#7'Command'#3#246#1#8'ShortCut'#2'.'#0#1#7'Command'#3'['#2#8'ShortCut'#3
|
+#0#8'ShortCut'#3'-@'#0#1#7'Command'#3'\'#2#8'ShortCut'#3'- '#0#1#7'Command'#3
|
||||||
+'. '#0#1#7'Command'#3#245#1#8'ShortCut'#2#8#0#1#7'Command'#3#245#1#8'ShortCu'
|
+#246#1#8'ShortCut'#2'.'#0#1#7'Command'#3'['#2#8'ShortCut'#3'. '#0#1#7'Comman'
|
||||||
+'t'#3#8' '#0#1#7'Command'#3#248#1#8'ShortCut'#3#8'@'#0#1#7'Command'#3'Y'#2#8
|
+'d'#3#245#1#8'ShortCut'#2#8#0#1#7'Command'#3#245#1#8'ShortCut'#3#8' '#0#1#7
|
||||||
+'ShortCut'#4#8#128#0#0#0#1#7'Command'#3'Z'#2#8'ShortCut'#4#8#160#0#0#0#1#7'C'
|
+'Command'#3#248#1#8'ShortCut'#3#8'@'#0#1#7'Command'#3'Y'#2#8'ShortCut'#4#8
|
||||||
+'ommand'#3#253#1#8'ShortCut'#2#13#0#1#7'Command'#3#199#0#8'ShortCut'#3'A@'#0
|
+#128#0#0#0#1#7'Command'#3'Z'#2#8'ShortCut'#4#8#160#0#0#0#1#7'Command'#3#253#1
|
||||||
+#1#7'Command'#3#201#0#8'ShortCut'#3'C@'#0#1#7'Command'#3'b'#2#8'ShortCut'#3
|
+#8'ShortCut'#2#13#0#1#7'Command'#3#199#0#8'ShortCut'#3'A@'#0#1#7'Command'#3
|
||||||
+'I`'#0#1#7'Command'#3#253#1#8'ShortCut'#3'M@'#0#1#7'Command'#3#254#1#8'Short'
|
+#201#0#8'ShortCut'#3'C@'#0#1#7'Command'#3'b'#2#8'ShortCut'#3'I`'#0#1#7'Comma'
|
||||||
+'Cut'#3'N@'#0#1#7'Command'#3#247#1#8'ShortCut'#3'T@'#0#1#7'Command'#3'c'#2#8
|
+'nd'#3#253#1#8'ShortCut'#3'M@'#0#1#7'Command'#3#254#1#8'ShortCut'#3'N@'#0#1#7
|
||||||
+'ShortCut'#3'U`'#0#1#7'Command'#3'\'#2#8'ShortCut'#3'V@'#0#1#7'Command'#3'['
|
+'Command'#3#247#1#8'ShortCut'#3'T@'#0#1#7'Command'#3'c'#2#8'ShortCut'#3'U`'#0
|
||||||
+#2#8'ShortCut'#3'X@'#0#1#7'Command'#3#251#1#8'ShortCut'#3'Y@'#0#1#7'Command'
|
+#1#7'Command'#3'\'#2#8'ShortCut'#3'V@'#0#1#7'Command'#3'['#2#8'ShortCut'#3'X'
|
||||||
+#3#250#1#8'ShortCut'#3'Y`'#0#1#7'Command'#3'Y'#2#8'ShortCut'#3'Z@'#0#1#7'Com'
|
+'@'#0#1#7'Command'#3#251#1#8'ShortCut'#3'Y@'#0#1#7'Command'#3#250#1#8'ShortC'
|
||||||
,'mand'#3'Z'#2#8'ShortCut'#3'Z`'#0#1#7'Command'#3'-'#1#8'ShortCut'#3'0@'#0#1#7
|
,'ut'#3'Y`'#0#1#7'Command'#3'Y'#2#8'ShortCut'#3'Z@'#0#1#7'Command'#3'Z'#2#8'S'
|
||||||
+'Command'#3'.'#1#8'ShortCut'#3'1@'#0#1#7'Command'#3'/'#1#8'ShortCut'#3'2@'#0
|
+'hortCut'#3'Z`'#0#1#7'Command'#3'-'#1#8'ShortCut'#3'0@'#0#1#7'Command'#3'.'#1
|
||||||
+#1#7'Command'#3'0'#1#8'ShortCut'#3'3@'#0#1#7'Command'#3'1'#1#8'ShortCut'#3'4'
|
+#8'ShortCut'#3'1@'#0#1#7'Command'#3'/'#1#8'ShortCut'#3'2@'#0#1#7'Command'#3
|
||||||
+'@'#0#1#7'Command'#3'2'#1#8'ShortCut'#3'5@'#0#1#7'Command'#3'3'#1#8'ShortCut'
|
+'0'#1#8'ShortCut'#3'3@'#0#1#7'Command'#3'1'#1#8'ShortCut'#3'4@'#0#1#7'Comman'
|
||||||
+#3'6@'#0#1#7'Command'#3'4'#1#8'ShortCut'#3'7@'#0#1#7'Command'#3'5'#1#8'Short'
|
+'d'#3'2'#1#8'ShortCut'#3'5@'#0#1#7'Command'#3'3'#1#8'ShortCut'#3'6@'#0#1#7'C'
|
||||||
+'Cut'#3'8@'#0#1#7'Command'#3'6'#1#8'ShortCut'#3'9@'#0#1#7'Command'#3'_'#1#8
|
+'ommand'#3'4'#1#8'ShortCut'#3'7@'#0#1#7'Command'#3'5'#1#8'ShortCut'#3'8@'#0#1
|
||||||
+'ShortCut'#3'0`'#0#1#7'Command'#3'`'#1#8'ShortCut'#3'1`'#0#1#7'Command'#3'a'
|
+#7'Command'#3'6'#1#8'ShortCut'#3'9@'#0#1#7'Command'#3'_'#1#8'ShortCut'#3'0`'
|
||||||
+#1#8'ShortCut'#3'2`'#0#1#7'Command'#3'b'#1#8'ShortCut'#3'3`'#0#1#7'Command'#3
|
+#0#1#7'Command'#3'`'#1#8'ShortCut'#3'1`'#0#1#7'Command'#3'a'#1#8'ShortCut'#3
|
||||||
+'c'#1#8'ShortCut'#3'4`'#0#1#7'Command'#3'd'#1#8'ShortCut'#3'5`'#0#1#7'Comman'
|
+'2`'#0#1#7'Command'#3'b'#1#8'ShortCut'#3'3`'#0#1#7'Command'#3'c'#1#8'ShortCu'
|
||||||
+'d'#3'e'#1#8'ShortCut'#3'6`'#0#1#7'Command'#3'f'#1#8'ShortCut'#3'7`'#0#1#7'C'
|
+'t'#3'4`'#0#1#7'Command'#3'd'#1#8'ShortCut'#3'5`'#0#1#7'Command'#3'e'#1#8'Sh'
|
||||||
+'ommand'#3'g'#1#8'ShortCut'#3'8`'#0#1#7'Command'#3'h'#1#8'ShortCut'#3'9`'#0#1
|
+'ortCut'#3'6`'#0#1#7'Command'#3'f'#1#8'ShortCut'#3'7`'#0#1#7'Command'#3'g'#1
|
||||||
+#7'Command'#3#231#0#8'ShortCut'#3'N`'#0#1#7'Command'#3#232#0#8'ShortCut'#3'C'
|
+#8'ShortCut'#3'8`'#0#1#7'Command'#3'h'#1#8'ShortCut'#3'9`'#0#1#7'Command'#3
|
||||||
+'`'#0#1#7'Command'#3#233#0#8'ShortCut'#3'L`'#0#1#7'Command'#3'd'#2#8'ShortCu'
|
+#231#0#8'ShortCut'#3'N`'#0#1#7'Command'#3#232#0#8'ShortCut'#3'C`'#0#1#7'Comm'
|
||||||
+'t'#2#9#0#1#7'Command'#3'e'#2#8'ShortCut'#3#9' '#0#1#7'Command'#3#250#0#8'Sh'
|
+'and'#3#233#0#8'ShortCut'#3'L`'#0#1#7'Command'#3'd'#2#8'ShortCut'#2#9#0#1#7
|
||||||
+'ortCut'#3'B`'#0#0#13'Lines.Strings'#1#6#15'TemplateSynEdit'#0#6'Cursor'#7#7
|
+'Command'#3'e'#2#8'ShortCut'#3#9' '#0#1#7'Command'#3#250#0#8'ShortCut'#3'B`'
|
||||||
+'crIBeam'#6'Height'#3#150#0#3'Top'#3#155#0#5'Width'#3'F'#2#0#0#9'TSplitter'
|
+#0#0#13'Lines.Strings'#1#6#15'TemplateSynEdit'#0#22'SelectedColor.OnChange'
|
||||||
+#16'TemplateSplitter'#5'Align'#7#8'alBottom'#6'Cursor'#7#8'crVSplit'#6'Heigh'
|
+#13#6'Cursor'#7#7'crIBeam'#6'Height'#3#128#0#3'Top'#3#195#0#5'Width'#3'J'#2#0
|
||||||
+'t'#2#5#11'ParentColor'#9#5'Width'#3'F'#2#12'ResizeAnchor'#7#8'akBottom'#6'C'
|
+#0#9'TSplitter'#16'TemplateSplitter'#5'Align'#7#8'alBottom'#6'Cursor'#7#8'cr'
|
||||||
+'ursor'#7#8'crVSplit'#6'Height'#2#5#3'Top'#3#150#0#5'Width'#3'F'#2#0#0#7'TBu'
|
+'VSplit'#6'Height'#2#5#5'Width'#3'J'#2#12'ResizeAnchor'#7#8'akBottom'#6'Curs'
|
||||||
+'tton'#9'AddButton'#7'Anchors'#11#5'akTop'#7'akRight'#0#25'BorderSpacing.Inn'
|
+'or'#7#8'crVSplit'#6'Height'#2#5#3'Top'#3#190#0#5'Width'#3'J'#2#0#0#7'TButto'
|
||||||
+'erBorder'#2#2#7'Caption'#6#9'AddButton'#7'OnClick'#7#14'AddButtonClick'#8'T'
|
+'n'#9'AddButton'#7'Anchors'#11#5'akTop'#7'akRight'#0#25'BorderSpacing.InnerB'
|
||||||
+'abOrder'#2#2#4'Left'#3#201#1#6'Height'#2#30#5'Width'#2's'#0#0#7'TButton'#12
|
+'order'#2#2#7'Caption'#6#9'AddButton'#7'OnClick'#7#14'AddButtonClick'#8'TabO'
|
||||||
+'DeleteButton'#7'Anchors'#11#5'akTop'#7'akRight'#0#25'BorderSpacing.InnerBor'
|
+'rder'#2#2#4'Left'#3#205#1#6'Height'#2#30#5'Width'#2's'#0#0#7'TButton'#12'De'
|
||||||
+'der'#2#2#7'Caption'#6#12'DeleteButton'#7'OnClick'#7#17'DeleteButtonClick'#8
|
+'leteButton'#7'Anchors'#11#5'akTop'#7'akRight'#0#25'BorderSpacing.InnerBorde'
|
||||||
+'TabOrder'#2#3#4'Left'#3#201#1#6'Height'#2#30#3'Top'#2'$'#5'Width'#2's'#0#0#7
|
+'r'#2#2#7'Caption'#6#12'DeleteButton'#7'OnClick'#7#17'DeleteButtonClick'#8'T'
|
||||||
|
+'abOrder'#2#3#4'Left'#3#205#1#6'Height'#2#30#3'Top'#2'$'#5'Width'#2's'#0#0#7
|
||||||
+'TButton'#10'EditButton'#7'Anchors'#11#5'akTop'#7'akRight'#0#25'BorderSpacin'
|
+'TButton'#10'EditButton'#7'Anchors'#11#5'akTop'#7'akRight'#0#25'BorderSpacin'
|
||||||
+'g.InnerBorder'#2#2#7'Caption'#6#10'EditButton'#7'OnClick'#7#15'EditButtonCl'
|
+'g.InnerBorder'#2#2#7'Caption'#6#10'EditButton'#7'OnClick'#7#15'EditButtonCl'
|
||||||
+'ick'#8'TabOrder'#2#4#4'Left'#3#201#1#6'Height'#2#30#3'Top'#2'G'#5'Width'#2
|
+'ick'#8'TabOrder'#2#4#4'Left'#3#205#1#6'Height'#2#30#3'Top'#2'G'#5'Width'#2
|
||||||
+'s'#0#0#9'TCheckBox'#17'UseMakrosCheckBox'#7'Anchors'#11#5'akTop'#7'akRight'
|
+'s'#0#0#9'TCheckBox'#17'UseMakrosCheckBox'#7'Anchors'#11#5'akTop'#7'akRight'
|
||||||
+#0#7'Caption'#6#17'UseMakrosCheckBox'#8'TabOrder'#2#5#4'Left'#3#170#1#6'Heig'
|
+#0#7'Caption'#6#17'UseMakrosCheckBox'#8'TabOrder'#2#5#4'Left'#3#177#1#6'Heig'
|
||||||
+'ht'#2#24#3'Top'#2'j'#5'Width'#3#146#0#0#0#0#10'TSynPasSyn'#10'ASynPasSyn'#7
|
+'ht'#2#24#3'Top'#2'j'#5'Width'#3#143#0#0#0#7'TButton'#17'InsertMacroButton'#7
|
||||||
+'Enabled'#8#4'left'#3#24#1#3'top'#3#216#0#0#0#0
|
+'Anchors'#11#5'akTop'#7'akRight'#0#25'BorderSpacing.InnerBorder'#2#2#7'Capti'
|
||||||
|
+'on'#6#17'InsertMacroButton'#7'OnClick'#7#22'InsertMacroButtonClick'#8'TabOr'
|
||||||
|
+'der'#2#6#4'Left'#3#205#1#6'Height'#2#25#3'Top'#3#141#0#5'Width'#2's'#0#0#0
|
||||||
|
+#10'TSynPasSyn'#10'ASynPasSyn'#7'Enabled'#8#4'left'#3#24#1#3'top'#3#216#0#0#0
|
||||||
|
+#0
|
||||||
]);
|
]);
|
||||||
|
|||||||
@ -34,7 +34,7 @@ uses
|
|||||||
Classes, SysUtils, LCLProc, LResources, Forms, Controls, Graphics, Dialogs,
|
Classes, SysUtils, LCLProc, LResources, Forms, Controls, Graphics, Dialogs,
|
||||||
ClipBrd, StdCtrls, Buttons, ExtCtrls, Menus,
|
ClipBrd, StdCtrls, Buttons, ExtCtrls, Menus,
|
||||||
SynEdit, SynHighlighterPas, SynEditAutoComplete,
|
SynEdit, SynHighlighterPas, SynEditAutoComplete,
|
||||||
IDECommands, TextTools, SrcEditorIntf, MenuIntf,
|
IDECommands, TextTools, SrcEditorIntf, MenuIntf, IDEWindowIntf,
|
||||||
InputHistory, LazarusIDEStrConsts, EditorOptions, CodeMacroSelect;
|
InputHistory, LazarusIDEStrConsts, EditorOptions, CodeMacroSelect;
|
||||||
|
|
||||||
type
|
type
|
||||||
@ -43,6 +43,7 @@ type
|
|||||||
|
|
||||||
TCodeTemplateDialog = class(TForm)
|
TCodeTemplateDialog = class(TForm)
|
||||||
AddButton: TButton;
|
AddButton: TButton;
|
||||||
|
InsertMacroButton: TButton;
|
||||||
UseMakrosCheckBox: TCheckBox;
|
UseMakrosCheckBox: TCheckBox;
|
||||||
EditButton: TButton;
|
EditButton: TButton;
|
||||||
DeleteButton: TButton;
|
DeleteButton: TButton;
|
||||||
@ -61,7 +62,9 @@ type
|
|||||||
procedure DeleteButtonClick(Sender: TObject);
|
procedure DeleteButtonClick(Sender: TObject);
|
||||||
procedure EditButtonClick(Sender: TObject);
|
procedure EditButtonClick(Sender: TObject);
|
||||||
procedure FilenameButtonClick(Sender: TObject);
|
procedure FilenameButtonClick(Sender: TObject);
|
||||||
|
procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
|
||||||
procedure FormCreate(Sender: TObject);
|
procedure FormCreate(Sender: TObject);
|
||||||
|
procedure InsertMacroButtonClick(Sender: TObject);
|
||||||
procedure OkButtonClick(Sender: TObject);
|
procedure OkButtonClick(Sender: TObject);
|
||||||
procedure OnCopyMenuItem(Sender: TObject);
|
procedure OnCopyMenuItem(Sender: TObject);
|
||||||
procedure OnCutMenuItem(Sender: TObject);
|
procedure OnCutMenuItem(Sender: TObject);
|
||||||
@ -72,6 +75,7 @@ type
|
|||||||
SynAutoComplete: TSynEditAutoComplete;
|
SynAutoComplete: TSynEditAutoComplete;
|
||||||
LastTemplate: integer;
|
LastTemplate: integer;
|
||||||
procedure BuildPopupMenu;
|
procedure BuildPopupMenu;
|
||||||
|
procedure DoInsertMacro;
|
||||||
public
|
public
|
||||||
procedure FillCodeTemplateListBox;
|
procedure FillCodeTemplateListBox;
|
||||||
procedure ShowCurCodeTemplate;
|
procedure ShowCurCodeTemplate;
|
||||||
@ -132,6 +136,10 @@ function CodeMakroLower(const Parameter: string; InteractiveValue: TPersistent;
|
|||||||
function CodeMakroPaste(const Parameter: string; InteractiveValue: TPersistent;
|
function CodeMakroPaste(const Parameter: string; InteractiveValue: TPersistent;
|
||||||
SrcEdit: TSourceEditorInterface;
|
SrcEdit: TSourceEditorInterface;
|
||||||
var Value, ErrorMsg: string): boolean;
|
var Value, ErrorMsg: string): boolean;
|
||||||
|
function CodeMakroProcedureHead(const Parameter: string;
|
||||||
|
InteractiveValue: TPersistent;
|
||||||
|
SrcEdit: TSourceEditorInterface;
|
||||||
|
var Value, ErrorMsg: string): boolean;
|
||||||
|
|
||||||
const
|
const
|
||||||
CodeTemplatesMenuRootName = 'CodeTemplates';
|
CodeTemplatesMenuRootName = 'CodeTemplates';
|
||||||
@ -231,6 +239,14 @@ begin
|
|||||||
Result:=true;
|
Result:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function CodeMakroProcedureHead(const Parameter: string;
|
||||||
|
InteractiveValue: TPersistent; SrcEdit: TSourceEditorInterface; var Value,
|
||||||
|
ErrorMsg: string): boolean;
|
||||||
|
begin
|
||||||
|
|
||||||
|
Result:=true;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure RegisterStandardCodeTemplatesMenuItems;
|
procedure RegisterStandardCodeTemplatesMenuItems;
|
||||||
var
|
var
|
||||||
Path: string;
|
Path: string;
|
||||||
@ -256,6 +272,31 @@ begin
|
|||||||
RegisterCodeMacro('Paste','paste clipboard',
|
RegisterCodeMacro('Paste','paste clipboard',
|
||||||
'Paste text from clipboard',
|
'Paste text from clipboard',
|
||||||
@CodeMakroPaste,nil);
|
@CodeMakroPaste,nil);
|
||||||
|
RegisterCodeMacro('ProcedureHead','insert procedure head',
|
||||||
|
'Insert header of current procedure'#13
|
||||||
|
+'Optional Parameters (comma separated):'#13
|
||||||
|
+'WithStart, // proc keyword e.g. ''function'', ''class procedure'''#13
|
||||||
|
+'WithoutClassKeyword,// without ''class'' proc keyword'#13
|
||||||
|
+'AddClassName, // extract/add ClassName.'#13
|
||||||
|
+'WithoutClassName, // skip classname'#13
|
||||||
|
+'WithoutName, // skip function name'#13
|
||||||
|
+'WithoutParamList, // skip param list'#13
|
||||||
|
+'WithVarModifiers, // extract ''var'', ''out'', ''const'''#13
|
||||||
|
+'WithParameterNames, // extract parameter names'#13
|
||||||
|
+'WithoutParamTypes, // skip colon, param types and default values'#13
|
||||||
|
+'WithDefaultValues, // extract default values'#13
|
||||||
|
+'WithResultType, // extract colon + result type'#13
|
||||||
|
+'WithOfObject, // extract ''of object'''#13
|
||||||
|
+'WithCallingSpecs, // extract cdecl; inline;'#13
|
||||||
|
+'WithProcModifiers, // extract forward; alias; external;'#13
|
||||||
|
+'WithComments, // extract comments and spaces'#13
|
||||||
|
+'InUpperCase, // turn to uppercase'#13
|
||||||
|
+'CommentsToSpace, // replace comments with a single space'#13
|
||||||
|
+' // (default is to skip unnecessary space,'#13
|
||||||
|
+' // e.g ''Do ;'' normally becomes ''Do;'''#13
|
||||||
|
+' // with this option you get ''Do ;'')'#13
|
||||||
|
+'WithoutBrackets, // skip start- and end-bracket of parameter list'#13,
|
||||||
|
@CodeMakroPaste,nil);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TCodeTemplateEditForm }
|
{ TCodeTemplateEditForm }
|
||||||
@ -403,6 +444,8 @@ var
|
|||||||
s: String;
|
s: String;
|
||||||
ColorScheme: String;
|
ColorScheme: String;
|
||||||
begin
|
begin
|
||||||
|
IDEDialogLayoutList.ApplyLayout(Self,600,450);
|
||||||
|
|
||||||
SynAutoComplete:=TSynEditAutoComplete.Create(Self);
|
SynAutoComplete:=TSynEditAutoComplete.Create(Self);
|
||||||
LastTemplate:=-1;
|
LastTemplate:=-1;
|
||||||
|
|
||||||
@ -454,6 +497,11 @@ begin
|
|||||||
BuildPopupMenu;
|
BuildPopupMenu;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCodeTemplateDialog.InsertMacroButtonClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
DoInsertMacro;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TCodeTemplateDialog.OkButtonClick(Sender: TObject);
|
procedure TCodeTemplateDialog.OkButtonClick(Sender: TObject);
|
||||||
var
|
var
|
||||||
Res: TModalResult;
|
Res: TModalResult;
|
||||||
@ -496,7 +544,7 @@ end;
|
|||||||
|
|
||||||
procedure TCodeTemplateDialog.OnInsertMacroMenuItem(Sender: TObject);
|
procedure TCodeTemplateDialog.OnInsertMacroMenuItem(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
|
DoInsertMacro;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCodeTemplateDialog.OnPasteMenuItem(Sender: TObject);
|
procedure TCodeTemplateDialog.OnPasteMenuItem(Sender: TObject);
|
||||||
@ -575,6 +623,12 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCodeTemplateDialog.FormClose(Sender: TObject;
|
||||||
|
var CloseAction: TCloseAction);
|
||||||
|
begin
|
||||||
|
IDEDialogLayoutList.SaveLayout(Self);
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TCodeTemplateDialog.TemplateListBoxSelectionChange(Sender: TObject;
|
procedure TCodeTemplateDialog.TemplateListBoxSelectionChange(Sender: TObject;
|
||||||
User: boolean);
|
User: boolean);
|
||||||
begin
|
begin
|
||||||
@ -598,17 +652,31 @@ begin
|
|||||||
PopupMenu:=MainPopupMenu;
|
PopupMenu:=MainPopupMenu;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCodeTemplateDialog.FillCodeTemplateListBox;
|
procedure TCodeTemplateDialog.DoInsertMacro;
|
||||||
var a:integer;
|
var
|
||||||
|
Macro: TIDECodeMacro;
|
||||||
begin
|
begin
|
||||||
with TemplateListBox do begin
|
Macro:=ShowCodeMacroSelectDialog;
|
||||||
Items.BeginUpdate;
|
if Macro<>nil then begin
|
||||||
Items.Clear;
|
TemplateSynEdit.SelText:='$'+Macro.Name+'()';
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCodeTemplateDialog.FillCodeTemplateListBox;
|
||||||
|
var
|
||||||
|
a: integer;
|
||||||
|
sl: TStringList;
|
||||||
|
begin
|
||||||
|
sl:=TStringList.Create;
|
||||||
|
try
|
||||||
for a:=0 to SynAutoComplete.Completions.Count-1 do begin
|
for a:=0 to SynAutoComplete.Completions.Count-1 do begin
|
||||||
Items.Add(SynAutoComplete.Completions[a]
|
sl.Add(SynAutoComplete.Completions[a]
|
||||||
+' - "'+SynAutoComplete.CompletionComments[a]+'"');
|
+' - "'+SynAutoComplete.CompletionComments[a]+'"');
|
||||||
end;
|
end;
|
||||||
Items.EndUpdate;
|
sl.Sort;
|
||||||
|
TemplateListBox.Items.Assign(sl);
|
||||||
|
finally
|
||||||
|
sl.Free;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -632,9 +700,18 @@ var
|
|||||||
begin
|
begin
|
||||||
EnableMakros:=false;
|
EnableMakros:=false;
|
||||||
LineCount:=0;
|
LineCount:=0;
|
||||||
|
i:=TemplateListBox.ItemIndex;
|
||||||
|
// search template
|
||||||
|
if i>=0 then begin
|
||||||
|
s:=TemplateListBox.Items[i];
|
||||||
|
sp:=Pos(' ',s);
|
||||||
|
if sp>0 then
|
||||||
|
s:=copy(s,1,sp-1);
|
||||||
|
i:=SynAutoComplete.Completions.IndexOf(s);
|
||||||
|
end;
|
||||||
|
|
||||||
TemplateSynEdit.Lines.BeginUpdate;
|
TemplateSynEdit.Lines.BeginUpdate;
|
||||||
TemplateSynEdit.Lines.Clear;
|
TemplateSynEdit.Lines.Clear;
|
||||||
i:=TemplateListBox.ItemIndex;
|
|
||||||
//debugln('TCodeTemplateDialog.ShowCurCodeTemplate A i=',dbgs(i));
|
//debugln('TCodeTemplateDialog.ShowCurCodeTemplate A i=',dbgs(i));
|
||||||
if i>=0 then begin
|
if i>=0 then begin
|
||||||
LastTemplate:=-1;
|
LastTemplate:=-1;
|
||||||
|
|||||||
@ -693,6 +693,7 @@ resourcestring
|
|||||||
lisLazDoc = 'LazDoc';
|
lisLazDoc = 'LazDoc';
|
||||||
lisOkBtn = 'Ok';
|
lisOkBtn = 'Ok';
|
||||||
dlgCancel = 'Cancel';
|
dlgCancel = 'Cancel';
|
||||||
|
lisCTPleaseSelectAMacro = 'please select a macro';
|
||||||
lisA2PCreateNewFile = 'Create new file';
|
lisA2PCreateNewFile = 'Create new file';
|
||||||
dlgEnvLanguage = 'Language';
|
dlgEnvLanguage = 'Language';
|
||||||
dlgAutoSave = 'Auto save';
|
dlgAutoSave = 'Auto save';
|
||||||
@ -1847,6 +1848,7 @@ resourcestring
|
|||||||
lisTodoListPrintList='Print todo items';
|
lisTodoListPrintList='Print todo items';
|
||||||
lisToDoListOptions='ToDo options...';
|
lisToDoListOptions='ToDo options...';
|
||||||
lisToDoLDescription = 'Description';
|
lisToDoLDescription = 'Description';
|
||||||
|
lisCTInsertMacro = 'Insert Macro';
|
||||||
lisToDoLFile = 'File';
|
lisToDoLFile = 'File';
|
||||||
lisToDoLLine = 'Line';
|
lisToDoLLine = 'Line';
|
||||||
|
|
||||||
@ -2877,6 +2879,7 @@ resourcestring
|
|||||||
lisLazDocExampleTag = 'Example';
|
lisLazDocExampleTag = 'Example';
|
||||||
lisLazDocBrowseExampleButton = 'Browse';
|
lisLazDocBrowseExampleButton = 'Browse';
|
||||||
lisEnableMakros = 'Enable Makros';
|
lisEnableMakros = 'Enable Makros';
|
||||||
|
lisCTSelectCodeMacro = 'Select Code Macro';
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
end.
|
end.
|
||||||
|
|||||||
@ -201,8 +201,6 @@ type
|
|||||||
ActiveUnitInfo: TUnitInfo;
|
ActiveUnitInfo: TUnitInfo;
|
||||||
NewSource: TCodeBuffer; NewX, NewY, NewTopLine: integer;
|
NewSource: TCodeBuffer; NewX, NewY, NewTopLine: integer;
|
||||||
AddJumpPoint: boolean): TModalResult; virtual; abstract;
|
AddJumpPoint: boolean): TModalResult; virtual; abstract;
|
||||||
procedure DoJumpToCodeToolBossError; virtual; abstract;
|
|
||||||
procedure SaveSourceEditorChangesToCodeCache(PageIndex: integer); virtual; abstract;
|
|
||||||
|
|
||||||
procedure FindInFilesPerDialog(AProject: TProject); virtual; abstract;
|
procedure FindInFilesPerDialog(AProject: TProject); virtual; abstract;
|
||||||
procedure FindInFiles(AProject: TProject; const FindText: string); virtual; abstract;
|
procedure FindInFiles(AProject: TProject; const FindText: string); virtual; abstract;
|
||||||
|
|||||||
@ -126,6 +126,9 @@ type
|
|||||||
TryWithoutNumber: boolean): string; virtual; abstract;
|
TryWithoutNumber: boolean): string; virtual; abstract;
|
||||||
|
|
||||||
function SubstituteMakros(var s: string): boolean; virtual; abstract;
|
function SubstituteMakros(var s: string): boolean; virtual; abstract;
|
||||||
|
|
||||||
|
procedure DoJumpToCodeToolBossError; virtual; abstract;
|
||||||
|
procedure SaveSourceEditorChangesToCodeCache(PageIndex: integer); virtual; abstract;
|
||||||
public
|
public
|
||||||
property ActiveProject: TLazProject read GetActiveProject;
|
property ActiveProject: TLazProject read GetActiveProject;
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user