mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-10 08:19:18 +02:00
added parameter edit to code macro selection
git-svn-id: trunk@8132 -
This commit is contained in:
parent
8b5ea3ffa8
commit
488b1ad6e4
@ -1,25 +1,25 @@
|
|||||||
object CodeMacroSelectDlg: TCodeMacroSelectDlg
|
object CodeMacroSelectDlg: TCodeMacroSelectDlg
|
||||||
ActiveControl = MacrosListBox
|
ActiveControl = MacrosListBox
|
||||||
Caption = 'CodeMacroSelectDlg'
|
Caption = 'CodeMacroSelectDlg'
|
||||||
ClientHeight = 275
|
ClientHeight = 319
|
||||||
ClientWidth = 560
|
ClientWidth = 560
|
||||||
OnClose = FormClose
|
OnClose = FormClose
|
||||||
OnCreate = FormCreate
|
OnCreate = FormCreate
|
||||||
PixelsPerInch = 112
|
PixelsPerInch = 112
|
||||||
HorzScrollBar.Page = 559
|
HorzScrollBar.Page = 559
|
||||||
VertScrollBar.Page = 274
|
VertScrollBar.Page = 318
|
||||||
Left = 318
|
Left = 318
|
||||||
Height = 275
|
Height = 319
|
||||||
Top = 200
|
Top = 200
|
||||||
Width = 560
|
Width = 560
|
||||||
object MacrosGroupBox: TGroupBox
|
object MacrosGroupBox: TGroupBox
|
||||||
Anchors = [akTop, akLeft, akBottom]
|
Anchors = [akTop, akLeft, akBottom]
|
||||||
Caption = 'MacrosGroupBox'
|
Caption = 'MacrosGroupBox'
|
||||||
ClientHeight = 198
|
ClientHeight = 193
|
||||||
ClientWidth = 166
|
ClientWidth = 166
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
Left = 10
|
Left = 10
|
||||||
Height = 215
|
Height = 210
|
||||||
Top = 10
|
Top = 10
|
||||||
Width = 170
|
Width = 170
|
||||||
object MacrosListBox: TListBox
|
object MacrosListBox: TListBox
|
||||||
@ -27,18 +27,18 @@ object CodeMacroSelectDlg: TCodeMacroSelectDlg
|
|||||||
OnSelectionChange = MacrosListBoxSelectionChange
|
OnSelectionChange = MacrosListBoxSelectionChange
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
TopIndex = -1
|
TopIndex = -1
|
||||||
Height = 198
|
Height = 193
|
||||||
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 = 198
|
ClientHeight = 193
|
||||||
ClientWidth = 356
|
ClientWidth = 356
|
||||||
TabOrder = 1
|
TabOrder = 1
|
||||||
Left = 190
|
Left = 190
|
||||||
Height = 215
|
Height = 210
|
||||||
Top = 10
|
Top = 10
|
||||||
Width = 360
|
Width = 360
|
||||||
object DescriptionMemo: TMemo
|
object DescriptionMemo: TMemo
|
||||||
@ -48,7 +48,7 @@ object CodeMacroSelectDlg: TCodeMacroSelectDlg
|
|||||||
)
|
)
|
||||||
ReadOnly = True
|
ReadOnly = True
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
Height = 198
|
Height = 193
|
||||||
Width = 356
|
Width = 356
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -65,7 +65,7 @@ object CodeMacroSelectDlg: TCodeMacroSelectDlg
|
|||||||
AnchorSideRight.Control = CancelButton
|
AnchorSideRight.Control = CancelButton
|
||||||
Left = 394
|
Left = 394
|
||||||
Height = 26
|
Height = 26
|
||||||
Top = 235
|
Top = 284
|
||||||
Width = 61
|
Width = 61
|
||||||
end
|
end
|
||||||
object CancelButton: TButton
|
object CancelButton: TButton
|
||||||
@ -77,7 +77,25 @@ object CodeMacroSelectDlg: TCodeMacroSelectDlg
|
|||||||
TabOrder = 3
|
TabOrder = 3
|
||||||
Left = 465
|
Left = 465
|
||||||
Height = 26
|
Height = 26
|
||||||
Top = 235
|
Top = 284
|
||||||
Width = 85
|
Width = 85
|
||||||
end
|
end
|
||||||
|
object ParameterGroupBox: TGroupBox
|
||||||
|
Anchors = [akLeft, akBottom]
|
||||||
|
Caption = 'ParameterGroupBox'
|
||||||
|
ClientHeight = 32
|
||||||
|
ClientWidth = 536
|
||||||
|
TabOrder = 4
|
||||||
|
Left = 10
|
||||||
|
Height = 49
|
||||||
|
Top = 225
|
||||||
|
Width = 540
|
||||||
|
object ParameterEdit: TEdit
|
||||||
|
Align = alTop
|
||||||
|
TabOrder = 0
|
||||||
|
Text = 'ParameterEdit'
|
||||||
|
Height = 23
|
||||||
|
Width = 536
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
@ -2,28 +2,33 @@
|
|||||||
|
|
||||||
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#19#1
|
+'MacrosListBox'#7'Caption'#6#18'CodeMacroSelectDlg'#12'ClientHeight'#3'?'#1
|
||||||
+#11'ClientWidth'#3'0'#2#7'OnClose'#7#9'FormClose'#8'OnCreate'#7#10'FormCreat'
|
+#11'ClientWidth'#3'0'#2#7'OnClose'#7#9'FormClose'#8'OnCreate'#7#10'FormCreat'
|
||||||
+'e'#13'PixelsPerInch'#2'p'#18'HorzScrollBar.Page'#3'/'#2#18'VertScrollBar.Pa'
|
+'e'#13'PixelsPerInch'#2'p'#18'HorzScrollBar.Page'#3'/'#2#18'VertScrollBar.Pa'
|
||||||
+'ge'#3#18#1#4'Left'#3'>'#1#6'Height'#3#19#1#3'Top'#3#200#0#5'Width'#3'0'#2#0
|
+'ge'#3'>'#1#4'Left'#3'>'#1#6'Height'#3'?'#1#3'Top'#3#200#0#5'Width'#3'0'#2#0
|
||||||
+#9'TGroupBox'#14'MacrosGroupBox'#7'Anchors'#11#5'akTop'#6'akLeft'#8'akBottom'
|
+#9'TGroupBox'#14'MacrosGroupBox'#7'Anchors'#11#5'akTop'#6'akLeft'#8'akBottom'
|
||||||
+#0#7'Caption'#6#14'MacrosGroupBox'#12'ClientHeight'#3#198#0#11'ClientWidth'#3
|
+#0#7'Caption'#6#14'MacrosGroupBox'#12'ClientHeight'#3#193#0#11'ClientWidth'#3
|
||||||
+#166#0#8'TabOrder'#2#0#4'Left'#2#10#6'Height'#3#215#0#3'Top'#2#10#5'Width'#3
|
+#166#0#8'TabOrder'#2#0#4'Left'#2#10#6'Height'#3#210#0#3'Top'#2#10#5'Width'#3
|
||||||
+#170#0#0#8'TListBox'#13'MacrosListBox'#5'Align'#7#8'alClient'#17'OnSelection'
|
+#170#0#0#8'TListBox'#13'MacrosListBox'#5'Align'#7#8'alClient'#17'OnSelection'
|
||||||
+'Change'#7#28'MacrosListBoxSelectionChange'#8'TabOrder'#2#0#8'TopIndex'#2#255
|
+'Change'#7#28'MacrosListBoxSelectionChange'#8'TabOrder'#2#0#8'TopIndex'#2#255
|
||||||
+#6'Height'#3#198#0#5'Width'#3#166#0#0#0#0#9'TGroupBox'#19'DescriptionGroupBo'
|
+#6'Height'#3#193#0#5'Width'#3#166#0#0#0#0#9'TGroupBox'#19'DescriptionGroupBo'
|
||||||
+'x'#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#8'akBottom'#0#7'Caption'#6#19
|
+'x'#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#8'akBottom'#0#7'Caption'#6#19
|
||||||
+'DescriptionGroupBox'#12'ClientHeight'#3#198#0#11'ClientWidth'#3'd'#1#8'TabO'
|
+'DescriptionGroupBox'#12'ClientHeight'#3#193#0#11'ClientWidth'#3'd'#1#8'TabO'
|
||||||
+'rder'#2#1#4'Left'#3#190#0#6'Height'#3#215#0#3'Top'#2#10#5'Width'#3'h'#1#0#5
|
+'rder'#2#1#4'Left'#3#190#0#6'Height'#3#210#0#3'Top'#2#10#5'Width'#3'h'#1#0#5
|
||||||
+'TMemo'#15'DescriptionMemo'#5'Align'#7#8'alClient'#13'Lines.Strings'#1#6#5'M'
|
+'TMemo'#15'DescriptionMemo'#5'Align'#7#8'alClient'#13'Lines.Strings'#1#6#5'M'
|
||||||
+'emo1'#0#8'ReadOnly'#9#8'TabOrder'#2#0#6'Height'#3#198#0#5'Width'#3'd'#1#0#0
|
+'emo1'#0#8'ReadOnly'#9#8'TabOrder'#2#0#6'Height'#3#193#0#5'Width'#3'd'#1#0#0
|
||||||
+#0#7'TButton'#8'OkButton'#7'Anchors'#11#5'akTop'#7'akRight'#0#8'AutoSize'#9
|
+#0#7'TButton'#8'OkButton'#7'Anchors'#11#5'akTop'#7'akRight'#0#8'AutoSize'#9
|
||||||
+#19'BorderSpacing.Right'#2#10#25'BorderSpacing.InnerBorder'#2#2#7'Caption'#6
|
+#19'BorderSpacing.Right'#2#10#25'BorderSpacing.InnerBorder'#2#2#7'Caption'#6
|
||||||
+#8'OkButton'#11'ModalResult'#2#1#8'TabOrder'#2#2#21'AnchorSideTop.Control'#7
|
+#8'OkButton'#11'ModalResult'#2#1#8'TabOrder'#2#2#21'AnchorSideTop.Control'#7
|
||||||
+#12'CancelButton'#18'AnchorSideTop.Side'#7#9'asrCenter'#23'AnchorSideRight.C'
|
+#12'CancelButton'#18'AnchorSideTop.Side'#7#9'asrCenter'#23'AnchorSideRight.C'
|
||||||
+'ontrol'#7#12'CancelButton'#4'Left'#3#138#1#6'Height'#2#26#3'Top'#3#235#0#5
|
+'ontrol'#7#12'CancelButton'#4'Left'#3#138#1#6'Height'#2#26#3'Top'#3#28#1#5'W'
|
||||||
+'Width'#2'='#0#0#7'TButton'#12'CancelButton'#7'Anchors'#11#7'akRight'#8'akBo'
|
+'idth'#2'='#0#0#7'TButton'#12'CancelButton'#7'Anchors'#11#7'akRight'#8'akBot'
|
||||||
+'ttom'#0#8'AutoSize'#9#25'BorderSpacing.InnerBorder'#2#2#7'Caption'#6#12'Can'
|
+'tom'#0#8'AutoSize'#9#25'BorderSpacing.InnerBorder'#2#2#7'Caption'#6#12'Canc'
|
||||||
+'celButton'#11'ModalResult'#2#2#8'TabOrder'#2#3#4'Left'#3#209#1#6'Height'#2
|
+'elButton'#11'ModalResult'#2#2#8'TabOrder'#2#3#4'Left'#3#209#1#6'Height'#2#26
|
||||||
+#26#3'Top'#3#235#0#5'Width'#2'U'#0#0#0
|
+#3'Top'#3#28#1#5'Width'#2'U'#0#0#9'TGroupBox'#17'ParameterGroupBox'#7'Anchor'
|
||||||
|
+'s'#11#6'akLeft'#8'akBottom'#0#7'Caption'#6#17'ParameterGroupBox'#12'ClientH'
|
||||||
|
+'eight'#2' '#11'ClientWidth'#3#24#2#8'TabOrder'#2#4#4'Left'#2#10#6'Height'#2
|
||||||
|
+'1'#3'Top'#3#225#0#5'Width'#3#28#2#0#5'TEdit'#13'ParameterEdit'#5'Align'#7#5
|
||||||
|
+'alTop'#8'TabOrder'#2#0#4'Text'#6#13'ParameterEdit'#6'Height'#2#23#5'Width'#3
|
||||||
|
+#24#2#0#0#0#0
|
||||||
]);
|
]);
|
||||||
|
@ -39,6 +39,8 @@ type
|
|||||||
{ TCodeMacroSelectDlg }
|
{ TCodeMacroSelectDlg }
|
||||||
|
|
||||||
TCodeMacroSelectDlg = class(TForm)
|
TCodeMacroSelectDlg = class(TForm)
|
||||||
|
ParameterEdit: TEdit;
|
||||||
|
ParameterGroupBox: TGroupBox;
|
||||||
MacrosListBox: TListBox;
|
MacrosListBox: TListBox;
|
||||||
DescriptionMemo: TMemo;
|
DescriptionMemo: TMemo;
|
||||||
OkButton: TButton;
|
OkButton: TButton;
|
||||||
@ -56,19 +58,21 @@ type
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
function ShowCodeMacroSelectDialog: TIDECodeMacro;
|
function ShowCodeMacroSelectDialog(var Parameter: string): TIDECodeMacro;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
function ShowCodeMacroSelectDialog: TIDECodeMacro;
|
function ShowCodeMacroSelectDialog(var Parameter: string): TIDECodeMacro;
|
||||||
var
|
var
|
||||||
CodeMacroSelectDlg: TCodeMacroSelectDlg;
|
CodeMacroSelectDlg: TCodeMacroSelectDlg;
|
||||||
begin
|
begin
|
||||||
CodeMacroSelectDlg:=TCodeMacroSelectDlg.Create(nil);
|
CodeMacroSelectDlg:=TCodeMacroSelectDlg.Create(nil);
|
||||||
if CodeMacroSelectDlg.ShowModal=mrOk then begin
|
if CodeMacroSelectDlg.ShowModal=mrOk then begin
|
||||||
Result:=CodeMacroSelectDlg.Selected;
|
Result:=CodeMacroSelectDlg.Selected;
|
||||||
|
Parameter:=CodeMacroSelectDlg.ParameterEdit.Text;
|
||||||
end else begin
|
end else begin
|
||||||
Result:=nil;
|
Result:=nil;
|
||||||
|
Parameter:='';
|
||||||
end;
|
end;
|
||||||
CodeMacroSelectDlg.Free;
|
CodeMacroSelectDlg.Free;
|
||||||
end;
|
end;
|
||||||
@ -84,6 +88,8 @@ begin
|
|||||||
DescriptionGroupBox.Caption:=lisToDoLDescription;
|
DescriptionGroupBox.Caption:=lisToDoLDescription;
|
||||||
OkButton.Caption:=lisCTInsertMacro;
|
OkButton.Caption:=lisCTInsertMacro;
|
||||||
CancelButton.Caption:=dlgCancel;
|
CancelButton.Caption:=dlgCancel;
|
||||||
|
ParameterGroupBox.Caption:=lisCMParameter;
|
||||||
|
ParameterEdit.Text:='';
|
||||||
|
|
||||||
FillMacrosListbox;
|
FillMacrosListbox;
|
||||||
end;
|
end;
|
||||||
|
@ -733,10 +733,11 @@ end;
|
|||||||
procedure TCodeTemplateDialog.DoInsertMacro;
|
procedure TCodeTemplateDialog.DoInsertMacro;
|
||||||
var
|
var
|
||||||
Macro: TIDECodeMacro;
|
Macro: TIDECodeMacro;
|
||||||
|
Parameter: string;
|
||||||
begin
|
begin
|
||||||
Macro:=ShowCodeMacroSelectDialog;
|
Macro:=ShowCodeMacroSelectDialog(Parameter);
|
||||||
if Macro<>nil then begin
|
if Macro<>nil then begin
|
||||||
TemplateSynEdit.SelText:='$'+Macro.Name+'()';
|
TemplateSynEdit.SelText:='$'+Macro.Name+'('+Parameter+')';
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -693,6 +693,7 @@ resourcestring
|
|||||||
lisLazDoc = 'LazDoc';
|
lisLazDoc = 'LazDoc';
|
||||||
lisOkBtn = 'Ok';
|
lisOkBtn = 'Ok';
|
||||||
dlgCancel = 'Cancel';
|
dlgCancel = 'Cancel';
|
||||||
|
lisCMParameter = 'Parameter';
|
||||||
lisCTPleaseSelectAMacro = 'please select a macro';
|
lisCTPleaseSelectAMacro = 'please select a macro';
|
||||||
lisA2PCreateNewFile = 'Create new file';
|
lisA2PCreateNewFile = 'Create new file';
|
||||||
dlgEnvLanguage = 'Language';
|
dlgEnvLanguage = 'Language';
|
||||||
|
Loading…
Reference in New Issue
Block a user