mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-06 20:26:13 +02:00
IDE: CodeTools CodeCreation frame simpler. Issue #29104, patch from Alexey Torgashin.
git-svn-id: trunk@50696 -
This commit is contained in:
parent
41aa946ab3
commit
2fe0fde59e
@ -14,9 +14,9 @@ object CodetoolsCodeCreationOptionsFrame: TCodetoolsCodeCreationOptionsFrame
|
||||
AnchorSideTop.Control = ForwardProcsInsertPolicyComboBox
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 6
|
||||
Height = 19
|
||||
Top = 45
|
||||
Width = 200
|
||||
Height = 24
|
||||
Top = 53
|
||||
Width = 261
|
||||
BorderSpacing.Left = 6
|
||||
BorderSpacing.Top = 6
|
||||
Caption = 'ForwardProcsKeepOrderCheckBox'
|
||||
@ -27,9 +27,9 @@ object CodetoolsCodeCreationOptionsFrame: TCodetoolsCodeCreationOptionsFrame
|
||||
AnchorSideTop.Control = UsesInsertPolicyComboBox
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 6
|
||||
Height = 19
|
||||
Top = 99
|
||||
Width = 217
|
||||
Height = 24
|
||||
Top = 120
|
||||
Width = 279
|
||||
BorderSpacing.Left = 6
|
||||
BorderSpacing.Top = 6
|
||||
Caption = 'UpdateMultiProcSignaturesCheckBox'
|
||||
@ -40,9 +40,9 @@ object CodetoolsCodeCreationOptionsFrame: TCodetoolsCodeCreationOptionsFrame
|
||||
AnchorSideTop.Control = UpdateMultiProcSignaturesCheckBox
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 6
|
||||
Height = 19
|
||||
Top = 118
|
||||
Width = 244
|
||||
Height = 24
|
||||
Top = 144
|
||||
Width = 315
|
||||
BorderSpacing.Left = 6
|
||||
Caption = 'UpdateOtherProcSignaturesCaseCheckBox'
|
||||
TabOrder = 4
|
||||
@ -52,53 +52,20 @@ object CodetoolsCodeCreationOptionsFrame: TCodetoolsCodeCreationOptionsFrame
|
||||
AnchorSideTop.Control = TemplateFileEdit
|
||||
AnchorSideTop.Side = asrCenter
|
||||
Left = 6
|
||||
Height = 15
|
||||
Top = 195
|
||||
Width = 95
|
||||
Height = 17
|
||||
Top = 240
|
||||
Width = 124
|
||||
Caption = 'TemplateFileLabel'
|
||||
ParentColor = False
|
||||
end
|
||||
object TemplateFileEdit: TEdit
|
||||
AnchorSideLeft.Control = TemplateFileLabel
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
AnchorSideTop.Control = EventMethodSectionComboBox
|
||||
AnchorSideTop.Side = asrBottom
|
||||
AnchorSideRight.Control = TemplateFileBrowseButton
|
||||
Left = 107
|
||||
Height = 23
|
||||
Top = 191
|
||||
Width = 418
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
BorderSpacing.Left = 6
|
||||
BorderSpacing.Top = 6
|
||||
TabOrder = 7
|
||||
Text = 'TemplateFileEdit'
|
||||
end
|
||||
object TemplateFileBrowseButton: TButton
|
||||
AnchorSideTop.Control = TemplateFileEdit
|
||||
AnchorSideRight.Control = Owner
|
||||
AnchorSideRight.Side = asrBottom
|
||||
AnchorSideBottom.Control = TemplateFileEdit
|
||||
AnchorSideBottom.Side = asrBottom
|
||||
Left = 525
|
||||
Height = 23
|
||||
Top = 191
|
||||
Width = 35
|
||||
Anchors = [akTop, akRight, akBottom]
|
||||
AutoSize = True
|
||||
BorderSpacing.Right = 6
|
||||
Caption = '...'
|
||||
OnClick = TemplateFileBrowseButtonClick
|
||||
TabOrder = 8
|
||||
end
|
||||
object GroupLocalVariablesCheckBox: TCheckBox
|
||||
AnchorSideLeft.Control = Owner
|
||||
AnchorSideTop.Control = UpdateOtherProcSignaturesCaseCheckBox
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 6
|
||||
Height = 19
|
||||
Top = 137
|
||||
Width = 180
|
||||
Height = 24
|
||||
Top = 168
|
||||
Width = 234
|
||||
BorderSpacing.Left = 6
|
||||
Caption = 'GroupLocalVariablesCheckBox'
|
||||
TabOrder = 5
|
||||
@ -106,11 +73,11 @@ object CodetoolsCodeCreationOptionsFrame: TCodetoolsCodeCreationOptionsFrame
|
||||
object ForwardProcsInsertPolicyComboBox: TComboBox
|
||||
AnchorSideLeft.Control = ForwardProcsInsertPolicyLabel
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
Left = 173
|
||||
Height = 23
|
||||
Left = 223
|
||||
Height = 31
|
||||
Top = 16
|
||||
Width = 170
|
||||
ItemHeight = 15
|
||||
ItemHeight = 0
|
||||
Style = csDropDownList
|
||||
TabOrder = 0
|
||||
end
|
||||
@ -120,9 +87,9 @@ object CodetoolsCodeCreationOptionsFrame: TCodetoolsCodeCreationOptionsFrame
|
||||
AnchorSideTop.Side = asrCenter
|
||||
AnchorSideRight.Control = ForwardProcsInsertPolicyComboBox
|
||||
Left = 6
|
||||
Height = 15
|
||||
Top = 20
|
||||
Width = 161
|
||||
Height = 17
|
||||
Top = 23
|
||||
Width = 211
|
||||
BorderSpacing.Around = 6
|
||||
Caption = 'ForwardProcsInsertPolicyLabel'
|
||||
ParentColor = False
|
||||
@ -133,9 +100,9 @@ object CodetoolsCodeCreationOptionsFrame: TCodetoolsCodeCreationOptionsFrame
|
||||
AnchorSideTop.Side = asrCenter
|
||||
AnchorSideRight.Control = UsesInsertPolicyComboBox
|
||||
Left = 6
|
||||
Height = 15
|
||||
Top = 74
|
||||
Width = 113
|
||||
Height = 17
|
||||
Top = 90
|
||||
Width = 148
|
||||
BorderSpacing.Around = 6
|
||||
Caption = 'UsesInsertPolicyLabel'
|
||||
ParentColor = False
|
||||
@ -145,12 +112,12 @@ object CodetoolsCodeCreationOptionsFrame: TCodetoolsCodeCreationOptionsFrame
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
AnchorSideTop.Control = ForwardProcsKeepOrderCheckBox
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 125
|
||||
Height = 23
|
||||
Top = 70
|
||||
Left = 160
|
||||
Height = 31
|
||||
Top = 83
|
||||
Width = 170
|
||||
BorderSpacing.Top = 6
|
||||
ItemHeight = 15
|
||||
ItemHeight = 0
|
||||
Style = csDropDownList
|
||||
TabOrder = 2
|
||||
end
|
||||
@ -160,9 +127,9 @@ object CodetoolsCodeCreationOptionsFrame: TCodetoolsCodeCreationOptionsFrame
|
||||
AnchorSideTop.Side = asrCenter
|
||||
AnchorSideRight.Control = EventMethodSectionComboBox
|
||||
Left = 6
|
||||
Height = 15
|
||||
Top = 166
|
||||
Width = 138
|
||||
Height = 17
|
||||
Top = 205
|
||||
Width = 177
|
||||
BorderSpacing.Around = 6
|
||||
Caption = 'EventMethodSectionLabel'
|
||||
ParentColor = False
|
||||
@ -172,13 +139,36 @@ object CodetoolsCodeCreationOptionsFrame: TCodetoolsCodeCreationOptionsFrame
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
AnchorSideTop.Control = GroupLocalVariablesCheckBox
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 150
|
||||
Height = 23
|
||||
Top = 162
|
||||
Left = 189
|
||||
Height = 31
|
||||
Top = 198
|
||||
Width = 170
|
||||
BorderSpacing.Top = 6
|
||||
ItemHeight = 15
|
||||
ItemHeight = 0
|
||||
Style = csDropDownList
|
||||
TabOrder = 6
|
||||
end
|
||||
object TemplateFileEdit: TFileNameEdit
|
||||
AnchorSideLeft.Control = TemplateFileLabel
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
AnchorSideTop.Control = EventMethodSectionComboBox
|
||||
AnchorSideTop.Side = asrBottom
|
||||
AnchorSideRight.Control = Owner
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 136
|
||||
Height = 27
|
||||
Top = 235
|
||||
Width = 424
|
||||
FilterIndex = 0
|
||||
HideDirectories = False
|
||||
ButtonWidth = 50
|
||||
NumGlyphs = 1
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
BorderSpacing.Left = 6
|
||||
BorderSpacing.Top = 6
|
||||
BorderSpacing.Right = 6
|
||||
MaxLength = 0
|
||||
TabOrder = 7
|
||||
Text = 'TemplateFileEdit'
|
||||
end
|
||||
end
|
||||
|
@ -25,7 +25,7 @@ unit codetools_codecreation_options;
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, FileUtil, Forms, ExtCtrls, StdCtrls, Dialogs,
|
||||
Classes, SysUtils, FileUtil, Forms, ExtCtrls, StdCtrls, Dialogs, EditBtn,
|
||||
SourceChanger, CodeToolsOptions, LazarusIDEStrConsts, IDEOptionsIntf,
|
||||
IDEDialogs;
|
||||
|
||||
@ -35,19 +35,17 @@ type
|
||||
|
||||
TCodetoolsCodeCreationOptionsFrame = class(TAbstractIDEOptionsEditor)
|
||||
ForwardProcsInsertPolicyComboBox: TComboBox;
|
||||
TemplateFileEdit: TFileNameEdit;
|
||||
UsesInsertPolicyComboBox: TComboBox;
|
||||
ForwardProcsKeepOrderCheckBox: TCheckBox;
|
||||
ForwardProcsInsertPolicyLabel: TLabel;
|
||||
EventMethodSectionComboBox: TComboBox;
|
||||
UsesInsertPolicyLabel: TLabel;
|
||||
TemplateFileBrowseButton: TButton;
|
||||
TemplateFileEdit: TEdit;
|
||||
TemplateFileLabel: TLabel;
|
||||
UpdateMultiProcSignaturesCheckBox: TCheckBox;
|
||||
UpdateOtherProcSignaturesCaseCheckBox: TCheckBox;
|
||||
GroupLocalVariablesCheckBox: TCheckBox;
|
||||
EventMethodSectionLabel: TLabel;
|
||||
procedure TemplateFileBrowseButtonClick(Sender: TObject);
|
||||
private
|
||||
public
|
||||
function GetTitle: String; override;
|
||||
@ -63,26 +61,6 @@ implementation
|
||||
|
||||
{ TCodetoolsCodeCreationOptionsFrame }
|
||||
|
||||
procedure TCodetoolsCodeCreationOptionsFrame.TemplateFileBrowseButtonClick(
|
||||
Sender: TObject);
|
||||
var
|
||||
OpenDialog: TOpenDialog;
|
||||
begin
|
||||
OpenDialog:=TOpenDialog.Create(nil);
|
||||
try
|
||||
InitIDEFileDialog(OpenDialog);
|
||||
OpenDialog.Title:=lisChooseAFileWithCodeToolsTemplates;
|
||||
OpenDialog.Options:=OpenDialog.Options+[ofFileMustExist];
|
||||
OpenDialog.Filter:=dlgFilterCodetoolsTemplateFile+' (*.xml)|*.xml|'+dlgFilterAll+
|
||||
'|'+GetAllFilesMask;
|
||||
if OpenDialog.Execute then
|
||||
TemplateFileEdit.Text:=OpenDialog.FileName;
|
||||
finally
|
||||
StoreIDEFileDialog(OpenDialog);
|
||||
OpenDialog.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
function TCodetoolsCodeCreationOptionsFrame.GetTitle: String;
|
||||
begin
|
||||
Result := dlgCodeCreation;
|
||||
@ -142,8 +120,11 @@ begin
|
||||
{$IFNDEF EnableCodeCompleteTemplates}
|
||||
TemplateFileLabel.Enabled:=false;
|
||||
TemplateFileEdit.Enabled:=false;
|
||||
TemplateFileBrowseButton.Enabled:=false;
|
||||
{$ENDIF}
|
||||
|
||||
TemplateFileEdit.DialogTitle:=lisChooseAFileWithCodeToolsTemplates;
|
||||
TemplateFileEdit.Filter:=dlgFilterCodetoolsTemplateFile+' (*.xml)|*.xml|'+
|
||||
dlgFilterAll+'|'+GetAllFilesMask;
|
||||
end;
|
||||
|
||||
procedure TCodetoolsCodeCreationOptionsFrame.ReadSettings(
|
||||
|
Loading…
Reference in New Issue
Block a user