mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-22 08:59:32 +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
|
||||
ActiveControl = MacrosListBox
|
||||
Caption = 'CodeMacroSelectDlg'
|
||||
ClientHeight = 275
|
||||
ClientHeight = 319
|
||||
ClientWidth = 560
|
||||
OnClose = FormClose
|
||||
OnCreate = FormCreate
|
||||
PixelsPerInch = 112
|
||||
HorzScrollBar.Page = 559
|
||||
VertScrollBar.Page = 274
|
||||
VertScrollBar.Page = 318
|
||||
Left = 318
|
||||
Height = 275
|
||||
Height = 319
|
||||
Top = 200
|
||||
Width = 560
|
||||
object MacrosGroupBox: TGroupBox
|
||||
Anchors = [akTop, akLeft, akBottom]
|
||||
Caption = 'MacrosGroupBox'
|
||||
ClientHeight = 198
|
||||
ClientHeight = 193
|
||||
ClientWidth = 166
|
||||
TabOrder = 0
|
||||
Left = 10
|
||||
Height = 215
|
||||
Height = 210
|
||||
Top = 10
|
||||
Width = 170
|
||||
object MacrosListBox: TListBox
|
||||
@ -27,18 +27,18 @@ object CodeMacroSelectDlg: TCodeMacroSelectDlg
|
||||
OnSelectionChange = MacrosListBoxSelectionChange
|
||||
TabOrder = 0
|
||||
TopIndex = -1
|
||||
Height = 198
|
||||
Height = 193
|
||||
Width = 166
|
||||
end
|
||||
end
|
||||
object DescriptionGroupBox: TGroupBox
|
||||
Anchors = [akTop, akLeft, akRight, akBottom]
|
||||
Caption = 'DescriptionGroupBox'
|
||||
ClientHeight = 198
|
||||
ClientHeight = 193
|
||||
ClientWidth = 356
|
||||
TabOrder = 1
|
||||
Left = 190
|
||||
Height = 215
|
||||
Height = 210
|
||||
Top = 10
|
||||
Width = 360
|
||||
object DescriptionMemo: TMemo
|
||||
@ -48,7 +48,7 @@ object CodeMacroSelectDlg: TCodeMacroSelectDlg
|
||||
)
|
||||
ReadOnly = True
|
||||
TabOrder = 0
|
||||
Height = 198
|
||||
Height = 193
|
||||
Width = 356
|
||||
end
|
||||
end
|
||||
@ -65,7 +65,7 @@ object CodeMacroSelectDlg: TCodeMacroSelectDlg
|
||||
AnchorSideRight.Control = CancelButton
|
||||
Left = 394
|
||||
Height = 26
|
||||
Top = 235
|
||||
Top = 284
|
||||
Width = 61
|
||||
end
|
||||
object CancelButton: TButton
|
||||
@ -77,7 +77,25 @@ object CodeMacroSelectDlg: TCodeMacroSelectDlg
|
||||
TabOrder = 3
|
||||
Left = 465
|
||||
Height = 26
|
||||
Top = 235
|
||||
Top = 284
|
||||
Width = 85
|
||||
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
|
||||
|
@ -2,28 +2,33 @@
|
||||
|
||||
LazarusResources.Add('TCodeMacroSelectDlg','FORMDATA',[
|
||||
'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'
|
||||
+'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'
|
||||
+#0#7'Caption'#6#14'MacrosGroupBox'#12'ClientHeight'#3#198#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
|
||||
+#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#210#0#3'Top'#2#10#5'Width'#3
|
||||
+#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
|
||||
+#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
|
||||
+'DescriptionGroupBox'#12'ClientHeight'#3#198#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
|
||||
+'DescriptionGroupBox'#12'ClientHeight'#3#193#0#11'ClientWidth'#3'd'#1#8'TabO'
|
||||
+'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'
|
||||
+'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
|
||||
+#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
|
||||
+#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
|
||||
+'Width'#2'='#0#0#7'TButton'#12'CancelButton'#7'Anchors'#11#7'akRight'#8'akBo'
|
||||
+'ttom'#0#8'AutoSize'#9#25'BorderSpacing.InnerBorder'#2#2#7'Caption'#6#12'Can'
|
||||
+'celButton'#11'ModalResult'#2#2#8'TabOrder'#2#3#4'Left'#3#209#1#6'Height'#2
|
||||
+#26#3'Top'#3#235#0#5'Width'#2'U'#0#0#0
|
||||
+'ontrol'#7#12'CancelButton'#4'Left'#3#138#1#6'Height'#2#26#3'Top'#3#28#1#5'W'
|
||||
+'idth'#2'='#0#0#7'TButton'#12'CancelButton'#7'Anchors'#11#7'akRight'#8'akBot'
|
||||
+'tom'#0#8'AutoSize'#9#25'BorderSpacing.InnerBorder'#2#2#7'Caption'#6#12'Canc'
|
||||
+'elButton'#11'ModalResult'#2#2#8'TabOrder'#2#3#4'Left'#3#209#1#6'Height'#2#26
|
||||
+#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 = class(TForm)
|
||||
ParameterEdit: TEdit;
|
||||
ParameterGroupBox: TGroupBox;
|
||||
MacrosListBox: TListBox;
|
||||
DescriptionMemo: TMemo;
|
||||
OkButton: TButton;
|
||||
@ -56,19 +58,21 @@ type
|
||||
end;
|
||||
|
||||
|
||||
function ShowCodeMacroSelectDialog: TIDECodeMacro;
|
||||
function ShowCodeMacroSelectDialog(var Parameter: string): TIDECodeMacro;
|
||||
|
||||
implementation
|
||||
|
||||
function ShowCodeMacroSelectDialog: TIDECodeMacro;
|
||||
function ShowCodeMacroSelectDialog(var Parameter: string): TIDECodeMacro;
|
||||
var
|
||||
CodeMacroSelectDlg: TCodeMacroSelectDlg;
|
||||
begin
|
||||
CodeMacroSelectDlg:=TCodeMacroSelectDlg.Create(nil);
|
||||
if CodeMacroSelectDlg.ShowModal=mrOk then begin
|
||||
Result:=CodeMacroSelectDlg.Selected;
|
||||
Parameter:=CodeMacroSelectDlg.ParameterEdit.Text;
|
||||
end else begin
|
||||
Result:=nil;
|
||||
Parameter:='';
|
||||
end;
|
||||
CodeMacroSelectDlg.Free;
|
||||
end;
|
||||
@ -84,6 +88,8 @@ begin
|
||||
DescriptionGroupBox.Caption:=lisToDoLDescription;
|
||||
OkButton.Caption:=lisCTInsertMacro;
|
||||
CancelButton.Caption:=dlgCancel;
|
||||
ParameterGroupBox.Caption:=lisCMParameter;
|
||||
ParameterEdit.Text:='';
|
||||
|
||||
FillMacrosListbox;
|
||||
end;
|
||||
|
@ -733,10 +733,11 @@ end;
|
||||
procedure TCodeTemplateDialog.DoInsertMacro;
|
||||
var
|
||||
Macro: TIDECodeMacro;
|
||||
Parameter: string;
|
||||
begin
|
||||
Macro:=ShowCodeMacroSelectDialog;
|
||||
Macro:=ShowCodeMacroSelectDialog(Parameter);
|
||||
if Macro<>nil then begin
|
||||
TemplateSynEdit.SelText:='$'+Macro.Name+'()';
|
||||
TemplateSynEdit.SelText:='$'+Macro.Name+'('+Parameter+')';
|
||||
end;
|
||||
end;
|
||||
|
||||
|
@ -693,6 +693,7 @@ resourcestring
|
||||
lisLazDoc = 'LazDoc';
|
||||
lisOkBtn = 'Ok';
|
||||
dlgCancel = 'Cancel';
|
||||
lisCMParameter = 'Parameter';
|
||||
lisCTPleaseSelectAMacro = 'please select a macro';
|
||||
lisA2PCreateNewFile = 'Create new file';
|
||||
dlgEnvLanguage = 'Language';
|
||||
|
Loading…
Reference in New Issue
Block a user