mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-02 14:20:35 +02:00
codetools: local var completion: group vars with same type, from Ondrej Pokorny
git-svn-id: trunk@49840 -
This commit is contained in:
parent
cf3d8e35ba
commit
6e84cb390d
@ -1050,6 +1050,16 @@ function TCodeCompletionCodeTool.AddLocalVariable(CleanCursorPos: integer;
|
|||||||
CleanLevelPos: integer): boolean;
|
CleanLevelPos: integer): boolean;
|
||||||
// if CleanLevelPos<1 then CleanLevelPos:=CleanCursorPos
|
// if CleanLevelPos<1 then CleanLevelPos:=CleanCursorPos
|
||||||
// CleanLevelPos selects the target node, e.g. a ctnProcedure
|
// CleanLevelPos selects the target node, e.g. a ctnProcedure
|
||||||
|
|
||||||
|
function FindFirstVarDeclaration(var Node: TCodeTreeNode): TCodeTreeNode;
|
||||||
|
begin
|
||||||
|
Result := Node;
|
||||||
|
while Assigned(Result.PriorBrother) and (Result.PriorBrother.Desc = ctnVarDefinition) and
|
||||||
|
not Assigned(Result.PriorBrother.LastChild)
|
||||||
|
do
|
||||||
|
Result := Result.PriorBrother;
|
||||||
|
end;
|
||||||
|
|
||||||
var
|
var
|
||||||
CursorNode, VarSectionNode, VarNode: TCodeTreeNode;
|
CursorNode, VarSectionNode, VarNode: TCodeTreeNode;
|
||||||
Indent, InsertPos: integer;
|
Indent, InsertPos: integer;
|
||||||
@ -1060,6 +1070,10 @@ var
|
|||||||
OtherSectionNode: TCodeTreeNode;
|
OtherSectionNode: TCodeTreeNode;
|
||||||
HeaderNode: TCodeTreeNode;
|
HeaderNode: TCodeTreeNode;
|
||||||
Beauty: TBeautifyCodeOptions;
|
Beauty: TBeautifyCodeOptions;
|
||||||
|
VarTypeNode: TCodeTreeNode;
|
||||||
|
InsertVarLineStart: integer;
|
||||||
|
InsertVarLineEnd: integer;
|
||||||
|
InsertAsNewLine: Boolean;
|
||||||
begin
|
begin
|
||||||
Result:=false;
|
Result:=false;
|
||||||
if CleanLevelPos<1 then CleanLevelPos:=CleanCursorPos;
|
if CleanLevelPos<1 then CleanLevelPos:=CleanCursorPos;
|
||||||
@ -1127,22 +1141,71 @@ begin
|
|||||||
//DebugLn(['TCodeCompletionCodeTool.AddLocalVariable C InsertTxt="',InsertTxt,'" ParentNode=',ParentNode.DescAsString,' HeaderNode=',HeaderNode.DescAsString,' OtherSectionNode=',OtherSectionNode.DescAsString,' VarSectionNode=',VarSectionNode.DescAsString,' CursorNode=',CursorNode.DescAsString]);
|
//DebugLn(['TCodeCompletionCodeTool.AddLocalVariable C InsertTxt="',InsertTxt,'" ParentNode=',ParentNode.DescAsString,' HeaderNode=',HeaderNode.DescAsString,' OtherSectionNode=',OtherSectionNode.DescAsString,' VarSectionNode=',VarSectionNode.DescAsString,' CursorNode=',CursorNode.DescAsString]);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
InsertAsNewLine := True;
|
||||||
if (VarSectionNode<>nil) then begin
|
if (VarSectionNode<>nil) then begin
|
||||||
// there is already a var section
|
|
||||||
// -> append variable
|
|
||||||
//debugln(['TCodeCompletionCodeTool.AddLocalVariable insert into existing var section']);
|
//debugln(['TCodeCompletionCodeTool.AddLocalVariable insert into existing var section']);
|
||||||
|
// there is already a var section
|
||||||
|
// -> first check if variables with the same type are defined (search backwards)
|
||||||
|
VarTypeNode := nil;
|
||||||
|
if Beauty.GroupLocalVariables then
|
||||||
|
begin
|
||||||
|
VarNode:=VarSectionNode.LastChild;
|
||||||
|
while Assigned(VarNode) and not Assigned(VarTypeNode) do
|
||||||
|
begin
|
||||||
|
if (VarNode.Desc = ctnVarDefinition) and Assigned(VarNode.LastChild) and
|
||||||
|
(VarNode.LastChild.Desc = ctnIdentifier) and
|
||||||
|
(CompareIdentifiers(PChar(VariableType), PChar(ExtractNode(VarNode.LastChild,[phpCommentsToSpace]))) = 0)
|
||||||
|
then
|
||||||
|
VarTypeNode := VarNode;
|
||||||
|
VarNode := VarNode.PriorBrother;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
if Assigned(VarTypeNode) then
|
||||||
|
begin
|
||||||
|
// -> append variable to already defined line
|
||||||
|
VarNode := FindFirstVarDeclaration(VarTypeNode);//find starting indentation
|
||||||
|
Indent:=Beauty.GetLineIndent(Src,VarTypeNode.StartPos);
|
||||||
|
if PositionsInSameLine(Src,VarTypeNode.StartPos,VarNode.StartPos) then
|
||||||
|
inc(Indent,Beauty.Indent);
|
||||||
|
MoveCursorToNodeStart(VarTypeNode.LastChild);
|
||||||
|
ReadPriorAtom;
|
||||||
|
if CurPos.Flag = cafColon then
|
||||||
|
begin
|
||||||
|
InsertPos:=CurPos.StartPos;
|
||||||
|
GetLineStartEndAtPosition(Src, InsertPos, InsertVarLineStart, InsertVarLineEnd);
|
||||||
|
InsertTxt:=VariableName;
|
||||||
|
if InsertPos-InsertVarLineStart+Length(VariableName)+2 > Beauty.LineLength then//the variable name doesn't fit into the line
|
||||||
|
InsertTxt := Beauty.LineEnd + Beauty.GetIndentStr(Indent) + InsertTxt
|
||||||
|
else if InsertVarLineEnd-InsertVarLineStart+Length(VariableName)+2 > Beauty.LineLength then//the variable type doesn't fit into the line
|
||||||
|
begin
|
||||||
|
if atColon in Beauty.DoNotSplitLineInFront then
|
||||||
|
InsertTxt := Beauty.LineEnd + Beauty.GetIndentStr(Indent) + InsertTxt
|
||||||
|
else
|
||||||
|
InsertTxt := InsertTxt + Beauty.LineEnd + Beauty.GetIndentStr(Indent);
|
||||||
|
end;
|
||||||
|
InsertTxt:=','+InsertTxt;
|
||||||
|
Indent := 0;
|
||||||
|
InsertAsNewLine := False;
|
||||||
|
end else
|
||||||
|
VarTypeNode := nil;//error: colon not found, insert as new line
|
||||||
|
end;
|
||||||
|
if not Assigned(VarTypeNode) then
|
||||||
|
begin
|
||||||
|
// -> append variable to new line
|
||||||
VarNode:=VarSectionNode.LastChild;
|
VarNode:=VarSectionNode.LastChild;
|
||||||
if VarNode<>nil then begin
|
if VarNode<>nil then begin
|
||||||
|
InsertPos:=FindLineEndOrCodeAfterPosition(VarNode.EndPos);
|
||||||
|
VarNode := FindFirstVarDeclaration(VarNode);//find indentation of first var definition
|
||||||
Indent:=Beauty.GetLineIndent(Src,VarNode.StartPos);
|
Indent:=Beauty.GetLineIndent(Src,VarNode.StartPos);
|
||||||
if PositionsInSameLine(Src,VarSectionNode.StartPos,VarNode.StartPos) then
|
if PositionsInSameLine(Src,VarSectionNode.StartPos,VarNode.StartPos) then
|
||||||
inc(Indent,Beauty.Indent);
|
inc(Indent,Beauty.Indent);
|
||||||
InsertPos:=FindLineEndOrCodeAfterPosition(VarNode.EndPos);
|
|
||||||
end else begin
|
end else begin
|
||||||
Indent:=Beauty.GetLineIndent(Src,VarSectionNode.StartPos);
|
Indent:=Beauty.GetLineIndent(Src,VarSectionNode.StartPos)+Beauty.Indent;
|
||||||
MoveCursorToNodeStart(VarSectionNode);
|
MoveCursorToNodeStart(VarSectionNode);
|
||||||
ReadNextAtom;
|
ReadNextAtom;
|
||||||
InsertPos:=CurPos.EndPos;
|
InsertPos:=CurPos.EndPos;
|
||||||
end;
|
end;
|
||||||
|
end;
|
||||||
end else begin
|
end else begin
|
||||||
// there is no var section yet
|
// there is no var section yet
|
||||||
// -> create a new var section and append variable
|
// -> create a new var section and append variable
|
||||||
@ -1187,7 +1250,10 @@ begin
|
|||||||
// insert new code
|
// insert new code
|
||||||
InsertTxt:=Beauty.BeautifyStatement(InsertTxt,Indent);
|
InsertTxt:=Beauty.BeautifyStatement(InsertTxt,Indent);
|
||||||
//DebugLn('TCodeCompletionCodeTool.AddLocalVariable E ',InsertTxt,' ');
|
//DebugLn('TCodeCompletionCodeTool.AddLocalVariable E ',InsertTxt,' ');
|
||||||
SourceChangeCache.Replace(gtNewLine,gtNewLine,InsertPos,InsertPos,InsertTxt);
|
if InsertAsNewLine then
|
||||||
|
SourceChangeCache.Replace(gtNewLine,gtNewLine,InsertPos,InsertPos,InsertTxt)
|
||||||
|
else
|
||||||
|
SourceChangeCache.Replace(gtNone,gtNone,InsertPos,InsertPos,InsertTxt);
|
||||||
|
|
||||||
if (VariableTypeUnitName<>'')
|
if (VariableTypeUnitName<>'')
|
||||||
and (not IsHiddenUsedUnit(PChar(VariableTypeUnitName))) then begin
|
and (not IsHiddenUsedUnit(PChar(VariableTypeUnitName))) then begin
|
||||||
|
@ -150,6 +150,7 @@ type
|
|||||||
KeepForwardProcOrder: boolean;
|
KeepForwardProcOrder: boolean;
|
||||||
UpdateMultiProcSignatures: boolean;
|
UpdateMultiProcSignatures: boolean;
|
||||||
UpdateOtherProcSignaturesCase: boolean; // when updating proc signatures not under cursor, fix case
|
UpdateOtherProcSignaturesCase: boolean; // when updating proc signatures not under cursor, fix case
|
||||||
|
GroupLocalVariables: boolean;
|
||||||
// classes, methods, properties
|
// classes, methods, properties
|
||||||
ClassHeaderComments: boolean;
|
ClassHeaderComments: boolean;
|
||||||
ClassImplementationComments: boolean;
|
ClassImplementationComments: boolean;
|
||||||
@ -1256,6 +1257,7 @@ begin
|
|||||||
UpdateAllMethodSignatures:=true;
|
UpdateAllMethodSignatures:=true;
|
||||||
UpdateMultiProcSignatures:=true;
|
UpdateMultiProcSignatures:=true;
|
||||||
UpdateOtherProcSignaturesCase:=true;
|
UpdateOtherProcSignaturesCase:=true;
|
||||||
|
GroupLocalVariables:=true;
|
||||||
MethodInsertPolicy:=mipClassOrder;
|
MethodInsertPolicy:=mipClassOrder;
|
||||||
ForwardProcBodyInsertPolicy:=fpipBehindMethods;
|
ForwardProcBodyInsertPolicy:=fpipBehindMethods;
|
||||||
KeepForwardProcOrder:=true;
|
KeepForwardProcOrder:=true;
|
||||||
|
@ -87,6 +87,7 @@ type
|
|||||||
FUpdateAllMethodSignatures: boolean;
|
FUpdateAllMethodSignatures: boolean;
|
||||||
FUpdateMultiProcSignatures: boolean;
|
FUpdateMultiProcSignatures: boolean;
|
||||||
FUpdateOtherProcSignaturesCase: boolean;
|
FUpdateOtherProcSignaturesCase: boolean;
|
||||||
|
FGroupLocalVariables: boolean;
|
||||||
FWordPolicyExceptions: TStringList;
|
FWordPolicyExceptions: TStringList;
|
||||||
FDoNotSplitLineInFront: TAtomTypes;
|
FDoNotSplitLineInFront: TAtomTypes;
|
||||||
FDoNotSplitLineAfter: TAtomTypes;
|
FDoNotSplitLineAfter: TAtomTypes;
|
||||||
@ -178,6 +179,8 @@ type
|
|||||||
read FUpdateMultiProcSignatures write FUpdateMultiProcSignatures;
|
read FUpdateMultiProcSignatures write FUpdateMultiProcSignatures;
|
||||||
property UpdateOtherProcSignaturesCase: boolean
|
property UpdateOtherProcSignaturesCase: boolean
|
||||||
read FUpdateOtherProcSignaturesCase write FUpdateOtherProcSignaturesCase;
|
read FUpdateOtherProcSignaturesCase write FUpdateOtherProcSignaturesCase;
|
||||||
|
property GroupLocalVariables: boolean
|
||||||
|
read FGroupLocalVariables write FGroupLocalVariables;
|
||||||
property ClassHeaderComments: boolean
|
property ClassHeaderComments: boolean
|
||||||
read FClassHeaderComments write FClassHeaderComments;
|
read FClassHeaderComments write FClassHeaderComments;
|
||||||
property ClassImplementationComments: boolean
|
property ClassImplementationComments: boolean
|
||||||
@ -446,6 +449,8 @@ begin
|
|||||||
'CodeToolsOptions/UpdateMultiProcSignatures/Value',true);
|
'CodeToolsOptions/UpdateMultiProcSignatures/Value',true);
|
||||||
FUpdateOtherProcSignaturesCase:=XMLConfig.GetValue(
|
FUpdateOtherProcSignaturesCase:=XMLConfig.GetValue(
|
||||||
'CodeToolsOptions/UpdateOtherProcSignaturesCase/Value',true);
|
'CodeToolsOptions/UpdateOtherProcSignaturesCase/Value',true);
|
||||||
|
FGroupLocalVariables:=XMLConfig.GetValue(
|
||||||
|
'CodeToolsOptions/GroupLocalVariables/Value',true);
|
||||||
FClassHeaderComments:=XMLConfig.GetValue(
|
FClassHeaderComments:=XMLConfig.GetValue(
|
||||||
'CodeToolsOptions/ClassHeaderComments/Value',true);
|
'CodeToolsOptions/ClassHeaderComments/Value',true);
|
||||||
FClassImplementationComments:=XMLConfig.GetValue(
|
FClassImplementationComments:=XMLConfig.GetValue(
|
||||||
@ -600,6 +605,9 @@ begin
|
|||||||
XMLConfig.SetDeleteValue(
|
XMLConfig.SetDeleteValue(
|
||||||
'CodeToolsOptions/UpdateOtherProcSignaturesCase/Value',FUpdateOtherProcSignaturesCase,
|
'CodeToolsOptions/UpdateOtherProcSignaturesCase/Value',FUpdateOtherProcSignaturesCase,
|
||||||
true);
|
true);
|
||||||
|
XMLConfig.SetDeleteValue(
|
||||||
|
'CodeToolsOptions/GroupLocalVariables/Value',FGroupLocalVariables,
|
||||||
|
true);
|
||||||
XMLConfig.SetDeleteValue(
|
XMLConfig.SetDeleteValue(
|
||||||
'CodeToolsOptions/ClassImplementationComments/Value',
|
'CodeToolsOptions/ClassImplementationComments/Value',
|
||||||
FClassImplementationComments,true);
|
FClassImplementationComments,true);
|
||||||
@ -767,6 +775,7 @@ begin
|
|||||||
FKeepForwardProcOrder:=CodeToolsOpts.KeepForwardProcOrder;
|
FKeepForwardProcOrder:=CodeToolsOpts.KeepForwardProcOrder;
|
||||||
FUpdateMultiProcSignatures:=CodeToolsOpts.UpdateMultiProcSignatures;
|
FUpdateMultiProcSignatures:=CodeToolsOpts.UpdateMultiProcSignatures;
|
||||||
FUpdateOtherProcSignaturesCase:=CodeToolsOpts.UpdateOtherProcSignaturesCase;
|
FUpdateOtherProcSignaturesCase:=CodeToolsOpts.UpdateOtherProcSignaturesCase;
|
||||||
|
FGroupLocalVariables:=CodeToolsOpts.GroupLocalVariables;
|
||||||
FClassHeaderComments:=CodeToolsOpts.ClassHeaderComments;
|
FClassHeaderComments:=CodeToolsOpts.ClassHeaderComments;
|
||||||
FClassImplementationComments:=CodeToolsOpts.ClassImplementationComments;
|
FClassImplementationComments:=CodeToolsOpts.ClassImplementationComments;
|
||||||
FMethodInsertPolicy:=CodeToolsOpts.FMethodInsertPolicy;
|
FMethodInsertPolicy:=CodeToolsOpts.FMethodInsertPolicy;
|
||||||
@ -826,6 +835,7 @@ begin
|
|||||||
FKeepForwardProcOrder:=true;
|
FKeepForwardProcOrder:=true;
|
||||||
FUpdateMultiProcSignatures:=true;
|
FUpdateMultiProcSignatures:=true;
|
||||||
FUpdateOtherProcSignaturesCase:=true;
|
FUpdateOtherProcSignaturesCase:=true;
|
||||||
|
FGroupLocalVariables:=true;
|
||||||
FClassHeaderComments:=true;
|
FClassHeaderComments:=true;
|
||||||
FClassImplementationComments:=true;
|
FClassImplementationComments:=true;
|
||||||
FMethodInsertPolicy:=mipClassOrder;
|
FMethodInsertPolicy:=mipClassOrder;
|
||||||
@ -903,6 +913,7 @@ begin
|
|||||||
and (FKeepForwardProcOrder=CodeToolsOpts.KeepForwardProcOrder)
|
and (FKeepForwardProcOrder=CodeToolsOpts.KeepForwardProcOrder)
|
||||||
and (FUpdateMultiProcSignatures=CodeToolsOpts.UpdateMultiProcSignatures)
|
and (FUpdateMultiProcSignatures=CodeToolsOpts.UpdateMultiProcSignatures)
|
||||||
and (FUpdateOtherProcSignaturesCase=CodeToolsOpts.UpdateOtherProcSignaturesCase)
|
and (FUpdateOtherProcSignaturesCase=CodeToolsOpts.UpdateOtherProcSignaturesCase)
|
||||||
|
and (FGroupLocalVariables=CodeToolsOpts.GroupLocalVariables)
|
||||||
and (FClassHeaderComments=CodeToolsOpts.ClassHeaderComments)
|
and (FClassHeaderComments=CodeToolsOpts.ClassHeaderComments)
|
||||||
and (FClassImplementationComments=CodeToolsOpts.ClassImplementationComments)
|
and (FClassImplementationComments=CodeToolsOpts.ClassImplementationComments)
|
||||||
and (FMethodInsertPolicy=CodeToolsOpts.FMethodInsertPolicy)
|
and (FMethodInsertPolicy=CodeToolsOpts.FMethodInsertPolicy)
|
||||||
@ -1022,6 +1033,7 @@ begin
|
|||||||
Beauty.KeepForwardProcOrder:=KeepForwardProcOrder;
|
Beauty.KeepForwardProcOrder:=KeepForwardProcOrder;
|
||||||
Beauty.UpdateMultiProcSignatures:=UpdateMultiProcSignatures;
|
Beauty.UpdateMultiProcSignatures:=UpdateMultiProcSignatures;
|
||||||
Beauty.UpdateOtherProcSignaturesCase:=UpdateOtherProcSignaturesCase;
|
Beauty.UpdateOtherProcSignaturesCase:=UpdateOtherProcSignaturesCase;
|
||||||
|
Beauty.GroupLocalVariables:=GroupLocalVariables;
|
||||||
Beauty.ClassHeaderComments:=ClassHeaderComments;
|
Beauty.ClassHeaderComments:=ClassHeaderComments;
|
||||||
Beauty.ClassImplementationComments:=ClassImplementationComments;
|
Beauty.ClassImplementationComments:=ClassImplementationComments;
|
||||||
Beauty.MethodInsertPolicy:=MethodInsertPolicy;
|
Beauty.MethodInsertPolicy:=MethodInsertPolicy;
|
||||||
|
@ -7,8 +7,8 @@ object CodetoolsCodeCreationOptionsFrame: TCodetoolsCodeCreationOptionsFrame
|
|||||||
ClientWidth = 566
|
ClientWidth = 566
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
Visible = False
|
Visible = False
|
||||||
DesignLeft = 211
|
DesignLeft = 322
|
||||||
DesignTop = 209
|
DesignTop = 184
|
||||||
object ForwardProcsInsertPolicyRadioGroup: TRadioGroup
|
object ForwardProcsInsertPolicyRadioGroup: TRadioGroup
|
||||||
AnchorSideLeft.Control = Owner
|
AnchorSideLeft.Control = Owner
|
||||||
AnchorSideTop.Control = Owner
|
AnchorSideTop.Control = Owner
|
||||||
@ -37,9 +37,9 @@ object CodetoolsCodeCreationOptionsFrame: TCodetoolsCodeCreationOptionsFrame
|
|||||||
AnchorSideTop.Control = ForwardProcsInsertPolicyRadioGroup
|
AnchorSideTop.Control = ForwardProcsInsertPolicyRadioGroup
|
||||||
AnchorSideTop.Side = asrBottom
|
AnchorSideTop.Side = asrBottom
|
||||||
Left = 6
|
Left = 6
|
||||||
Height = 18
|
Height = 19
|
||||||
Top = 112
|
Top = 112
|
||||||
Width = 233
|
Width = 200
|
||||||
BorderSpacing.Around = 6
|
BorderSpacing.Around = 6
|
||||||
Caption = 'ForwardProcsKeepOrderCheckBox'
|
Caption = 'ForwardProcsKeepOrderCheckBox'
|
||||||
TabOrder = 1
|
TabOrder = 1
|
||||||
@ -52,7 +52,7 @@ object CodetoolsCodeCreationOptionsFrame: TCodetoolsCodeCreationOptionsFrame
|
|||||||
AnchorSideRight.Side = asrBottom
|
AnchorSideRight.Side = asrBottom
|
||||||
Left = 6
|
Left = 6
|
||||||
Height = 100
|
Height = 100
|
||||||
Top = 142
|
Top = 143
|
||||||
Width = 554
|
Width = 554
|
||||||
Anchors = [akTop, akLeft, akRight]
|
Anchors = [akTop, akLeft, akRight]
|
||||||
AutoFill = True
|
AutoFill = True
|
||||||
@ -76,9 +76,9 @@ object CodetoolsCodeCreationOptionsFrame: TCodetoolsCodeCreationOptionsFrame
|
|||||||
AnchorSideTop.Control = UsesInsertPolicyRadioGroup
|
AnchorSideTop.Control = UsesInsertPolicyRadioGroup
|
||||||
AnchorSideTop.Side = asrBottom
|
AnchorSideTop.Side = asrBottom
|
||||||
Left = 6
|
Left = 6
|
||||||
Height = 18
|
Height = 19
|
||||||
Top = 248
|
Top = 249
|
||||||
Width = 251
|
Width = 217
|
||||||
BorderSpacing.Left = 6
|
BorderSpacing.Left = 6
|
||||||
BorderSpacing.Top = 6
|
BorderSpacing.Top = 6
|
||||||
Caption = 'UpdateMultiProcSignaturesCheckBox'
|
Caption = 'UpdateMultiProcSignaturesCheckBox'
|
||||||
@ -89,37 +89,37 @@ object CodetoolsCodeCreationOptionsFrame: TCodetoolsCodeCreationOptionsFrame
|
|||||||
AnchorSideTop.Control = UpdateMultiProcSignaturesCheckBox
|
AnchorSideTop.Control = UpdateMultiProcSignaturesCheckBox
|
||||||
AnchorSideTop.Side = asrBottom
|
AnchorSideTop.Side = asrBottom
|
||||||
Left = 6
|
Left = 6
|
||||||
Height = 18
|
Height = 19
|
||||||
Top = 266
|
Top = 268
|
||||||
Width = 284
|
Width = 244
|
||||||
BorderSpacing.Left = 6
|
BorderSpacing.Left = 6
|
||||||
Caption = 'UpdateOtherProcSignaturesCaseCheckBox'
|
Caption = 'UpdateOtherProcSignaturesCaseCheckBox'
|
||||||
TabOrder = 4
|
TabOrder = 4
|
||||||
end
|
end
|
||||||
object TemplateFileLabel: TLabel
|
object TemplateFileLabel: TLabel
|
||||||
AnchorSideLeft.Control = UpdateOtherProcSignaturesCaseCheckBox
|
AnchorSideLeft.Control = GroupLocalVariablesCheckBox
|
||||||
AnchorSideTop.Control = TemplateFileEdit
|
AnchorSideTop.Control = TemplateFileEdit
|
||||||
AnchorSideTop.Side = asrCenter
|
AnchorSideTop.Side = asrCenter
|
||||||
Left = 6
|
Left = 6
|
||||||
Height = 16
|
Height = 15
|
||||||
Top = 293
|
Top = 316
|
||||||
Width = 114
|
Width = 95
|
||||||
Caption = 'TemplateFileLabel'
|
Caption = 'TemplateFileLabel'
|
||||||
ParentColor = False
|
ParentColor = False
|
||||||
end
|
end
|
||||||
object TemplateFileEdit: TEdit
|
object TemplateFileEdit: TEdit
|
||||||
AnchorSideLeft.Control = TemplateFileLabel
|
AnchorSideLeft.Control = TemplateFileLabel
|
||||||
AnchorSideLeft.Side = asrBottom
|
AnchorSideLeft.Side = asrBottom
|
||||||
AnchorSideTop.Control = UpdateOtherProcSignaturesCaseCheckBox
|
AnchorSideTop.Control = GroupLocalVariablesCheckBox
|
||||||
AnchorSideTop.Side = asrBottom
|
AnchorSideTop.Side = asrBottom
|
||||||
AnchorSideRight.Control = TemplateFileBrowseButton
|
AnchorSideRight.Control = TemplateFileBrowseButton
|
||||||
Left = 120
|
Left = 101
|
||||||
Height = 22
|
Height = 23
|
||||||
Top = 290
|
Top = 312
|
||||||
Width = 370
|
Width = 424
|
||||||
Anchors = [akTop, akLeft, akRight]
|
Anchors = [akTop, akLeft, akRight]
|
||||||
BorderSpacing.Top = 6
|
BorderSpacing.Top = 6
|
||||||
TabOrder = 5
|
TabOrder = 6
|
||||||
Text = 'TemplateFileEdit'
|
Text = 'TemplateFileEdit'
|
||||||
end
|
end
|
||||||
object TemplateFileBrowseButton: TButton
|
object TemplateFileBrowseButton: TButton
|
||||||
@ -128,15 +128,27 @@ object CodetoolsCodeCreationOptionsFrame: TCodetoolsCodeCreationOptionsFrame
|
|||||||
AnchorSideRight.Side = asrBottom
|
AnchorSideRight.Side = asrBottom
|
||||||
AnchorSideBottom.Control = TemplateFileEdit
|
AnchorSideBottom.Control = TemplateFileEdit
|
||||||
AnchorSideBottom.Side = asrBottom
|
AnchorSideBottom.Side = asrBottom
|
||||||
Left = 490
|
Left = 525
|
||||||
Height = 22
|
Height = 23
|
||||||
Top = 290
|
Top = 312
|
||||||
Width = 70
|
Width = 35
|
||||||
Anchors = [akTop, akRight, akBottom]
|
Anchors = [akTop, akRight, akBottom]
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
BorderSpacing.Right = 6
|
BorderSpacing.Right = 6
|
||||||
Caption = '...'
|
Caption = '...'
|
||||||
OnClick = TemplateFileBrowseButtonClick
|
OnClick = TemplateFileBrowseButtonClick
|
||||||
TabOrder = 6
|
TabOrder = 7
|
||||||
|
end
|
||||||
|
object GroupLocalVariablesCheckBox: TCheckBox
|
||||||
|
AnchorSideLeft.Control = Owner
|
||||||
|
AnchorSideTop.Control = UpdateOtherProcSignaturesCaseCheckBox
|
||||||
|
AnchorSideTop.Side = asrBottom
|
||||||
|
Left = 6
|
||||||
|
Height = 19
|
||||||
|
Top = 287
|
||||||
|
Width = 180
|
||||||
|
BorderSpacing.Left = 6
|
||||||
|
Caption = 'GroupLocalVariablesCheckBox'
|
||||||
|
TabOrder = 5
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -41,6 +41,7 @@ type
|
|||||||
TemplateFileLabel: TLabel;
|
TemplateFileLabel: TLabel;
|
||||||
UpdateMultiProcSignaturesCheckBox: TCheckBox;
|
UpdateMultiProcSignaturesCheckBox: TCheckBox;
|
||||||
UpdateOtherProcSignaturesCaseCheckBox: TCheckBox;
|
UpdateOtherProcSignaturesCaseCheckBox: TCheckBox;
|
||||||
|
GroupLocalVariablesCheckBox: TCheckBox;
|
||||||
UsesInsertPolicyRadioGroup: TRadioGroup;
|
UsesInsertPolicyRadioGroup: TRadioGroup;
|
||||||
procedure TemplateFileBrowseButtonClick(Sender: TObject);
|
procedure TemplateFileBrowseButtonClick(Sender: TObject);
|
||||||
private
|
private
|
||||||
@ -116,6 +117,8 @@ begin
|
|||||||
lisCTOUpdateMultipleProcedureSignatures;
|
lisCTOUpdateMultipleProcedureSignatures;
|
||||||
UpdateOtherProcSignaturesCaseCheckBox.Caption:=
|
UpdateOtherProcSignaturesCaseCheckBox.Caption:=
|
||||||
lisUpdateOtherProcedureSignaturesWhenOnlyLetterCaseHa;
|
lisUpdateOtherProcedureSignaturesWhenOnlyLetterCaseHa;
|
||||||
|
GroupLocalVariablesCheckBox.Caption:=
|
||||||
|
lisGroupLocalVariables;
|
||||||
|
|
||||||
TemplateFileLabel.Caption:=lisTemplateFile;
|
TemplateFileLabel.Caption:=lisTemplateFile;
|
||||||
{$IFNDEF EnableCodeCompleteTemplates}
|
{$IFNDEF EnableCodeCompleteTemplates}
|
||||||
@ -152,6 +155,7 @@ begin
|
|||||||
|
|
||||||
UpdateMultiProcSignaturesCheckBox.Checked:=UpdateMultiProcSignatures;
|
UpdateMultiProcSignaturesCheckBox.Checked:=UpdateMultiProcSignatures;
|
||||||
UpdateOtherProcSignaturesCaseCheckBox.Checked:=UpdateOtherProcSignaturesCase;
|
UpdateOtherProcSignaturesCaseCheckBox.Checked:=UpdateOtherProcSignaturesCase;
|
||||||
|
GroupLocalVariablesCheckBox.Checked:=GroupLocalVariables;
|
||||||
|
|
||||||
TemplateFileEdit.Text:=CodeCompletionTemplateFileName;
|
TemplateFileEdit.Text:=CodeCompletionTemplateFileName;
|
||||||
end;
|
end;
|
||||||
@ -180,6 +184,7 @@ begin
|
|||||||
|
|
||||||
UpdateMultiProcSignatures:=UpdateMultiProcSignaturesCheckBox.Checked;
|
UpdateMultiProcSignatures:=UpdateMultiProcSignaturesCheckBox.Checked;
|
||||||
UpdateOtherProcSignaturesCase:=UpdateOtherProcSignaturesCaseCheckBox.Checked;
|
UpdateOtherProcSignaturesCase:=UpdateOtherProcSignaturesCaseCheckBox.Checked;
|
||||||
|
GroupLocalVariables:=GroupLocalVariablesCheckBox.Checked;
|
||||||
|
|
||||||
CodeCompletionTemplateFileName:=TemplateFileEdit.Text;
|
CodeCompletionTemplateFileName:=TemplateFileEdit.Text;
|
||||||
end;
|
end;
|
||||||
|
@ -5999,6 +5999,7 @@ resourcestring
|
|||||||
lisUDUnits2 = 'Units: %s';
|
lisUDUnits2 = 'Units: %s';
|
||||||
lisCTOUpdateAllMethodSignatures = 'Update all method signatures';
|
lisCTOUpdateAllMethodSignatures = 'Update all method signatures';
|
||||||
lisCTOUpdateMultipleProcedureSignatures = 'Update multiple procedure signatures';
|
lisCTOUpdateMultipleProcedureSignatures = 'Update multiple procedure signatures';
|
||||||
|
lisGroupLocalVariables = 'Group automatically defined local variables';
|
||||||
lisUpdateOtherProcedureSignaturesWhenOnlyLetterCaseHa = 'Update other '
|
lisUpdateOtherProcedureSignaturesWhenOnlyLetterCaseHa = 'Update other '
|
||||||
+'procedure signatures when only letter case has changed';
|
+'procedure signatures when only letter case has changed';
|
||||||
lisTemplateFile = 'Template file';
|
lisTemplateFile = 'Template file';
|
||||||
|
Loading…
Reference in New Issue
Block a user