mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-10 06:08:17 +02:00
IDE: Separate delays for hints and completion box. Issue #29482, patch from Paweł Dmitruk.
git-svn-id: trunk@60691 -
This commit is contained in:
parent
5274919338
commit
73c8d8326e
@ -1481,6 +1481,7 @@ type
|
||||
fAutoBlockCompletion: Boolean;
|
||||
fAutoCodeParameters: Boolean;
|
||||
fAutoDelayInMSec: Integer;
|
||||
fAutoHintDelayInMSec: Integer;
|
||||
FAutoRemoveEmptyMethods: Boolean;
|
||||
fAutoToolTipExprEval: Boolean;
|
||||
fAutoToolTipSymbTools: Boolean;
|
||||
@ -1687,6 +1688,8 @@ type
|
||||
public
|
||||
property AutoDelayInMSec: Integer read fAutoDelayInMSec
|
||||
write fAutoDelayInMSec default 1000;
|
||||
property AutoHintDelayInMSec: Integer read fAutoHintDelayInMSec
|
||||
write fAutoHintDelayInMSec default 1000;
|
||||
property CodeTemplateFileNameRaw: String
|
||||
read fCodeTemplateFileNameRaw write fCodeTemplateFileNameRaw;
|
||||
property CodeTemplateFileNameExpand:String
|
||||
@ -4988,6 +4991,8 @@ begin
|
||||
XMLConfig.GetValue('EditorOptions/CodeTools/AutoToolTipSymbTools', True);
|
||||
fAutoDelayInMSec :=
|
||||
XMLConfig.GetValue('EditorOptions/CodeTools/AutoDelayInMSec', 1000);
|
||||
fAutoHintDelayInMSec :=
|
||||
XMLConfig.GetValue('EditorOptions/CodeTools/AutoDelayHintInMSec', 1000);
|
||||
fCodeTemplateFileNameRaw :=
|
||||
XMLConfig.GetValue('EditorOptions/CodeTools/CodeTemplateFileName'
|
||||
, TrimFilename(AppendPathDelim(GetPrimaryConfigPath) + DefaultCodeTemplatesFilename));
|
||||
@ -5186,6 +5191,8 @@ begin
|
||||
, fAutoToolTipSymbTools, True);
|
||||
XMLConfig.SetDeleteValue('EditorOptions/CodeTools/AutoDelayInMSec'
|
||||
, fAutoDelayInMSec, 1000);
|
||||
XMLConfig.SetDeleteValue('EditorOptions/CodeTools/AutoDelayHintInMSec'
|
||||
, fAutoHintDelayInMSec, 1000);
|
||||
XMLConfig.SetDeleteValue('EditorOptions/CodeTools/CodeTemplateFileName'
|
||||
, fCodeTemplateFileNameRaw, '');
|
||||
XMLConfig.SetDeleteValue(
|
||||
|
@ -13,10 +13,10 @@ object EditorCodetoolsOptionsFrame: TEditorCodetoolsOptionsFrame
|
||||
DesignLeft = 263
|
||||
DesignTop = 222
|
||||
object AutoDelayLabel: TLabel
|
||||
AnchorSideLeft.Control = AutoHintAndCompletionDelayLabel
|
||||
AnchorSideLeft.Control = AutoCompletionDelayLabel
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
AnchorSideTop.Control = AutoHintAndCompletionDelayLabel
|
||||
Left = 217
|
||||
AnchorSideTop.Control = AutoCompletionDelayLabel
|
||||
Left = 172
|
||||
Height = 15
|
||||
Top = 156
|
||||
Width = 83
|
||||
@ -89,9 +89,9 @@ object EditorCodetoolsOptionsFrame: TEditorCodetoolsOptionsFrame
|
||||
Caption = 'AutoToolTipExprEvalCheckBox'
|
||||
TabOrder = 3
|
||||
end
|
||||
object AutoDelayTrackBar: TTrackBar
|
||||
object AutoCompletionDelayTrackBar: TTrackBar
|
||||
AnchorSideLeft.Control = Owner
|
||||
AnchorSideTop.Control = AutoHintAndCompletionDelayLabel
|
||||
AnchorSideTop.Control = AutoCompletionDelayLabel
|
||||
AnchorSideTop.Side = asrBottom
|
||||
AnchorSideRight.Control = Owner
|
||||
AnchorSideRight.Side = asrBottom
|
||||
@ -102,7 +102,7 @@ object EditorCodetoolsOptionsFrame: TEditorCodetoolsOptionsFrame
|
||||
Frequency = 250
|
||||
Max = 4000
|
||||
Min = 10
|
||||
OnChange = AutoDelayTrackBarChange
|
||||
OnChange = AutoCompletionDelayTrackBarChange
|
||||
Position = 500
|
||||
ShowSelRange = False
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
@ -111,17 +111,17 @@ object EditorCodetoolsOptionsFrame: TEditorCodetoolsOptionsFrame
|
||||
BorderSpacing.Right = 6
|
||||
TabOrder = 4
|
||||
end
|
||||
object AutoHintAndCompletionDelayLabel: TLabel
|
||||
object AutoCompletionDelayLabel: TLabel
|
||||
AnchorSideLeft.Control = ToolTipBevel
|
||||
AnchorSideTop.Control = DbgToolTipAutoCastClass
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 6
|
||||
Height = 15
|
||||
Top = 156
|
||||
Width = 191
|
||||
Width = 146
|
||||
BorderSpacing.Left = 6
|
||||
BorderSpacing.Top = 6
|
||||
Caption = 'AutoHintAndCompletionDelayLabel'
|
||||
Caption = 'AutoCompletionDelayLabel'
|
||||
ParentColor = False
|
||||
end
|
||||
object CompletionDropDownHintTrackBar: TTrackBar
|
||||
@ -132,26 +132,26 @@ object EditorCodetoolsOptionsFrame: TEditorCodetoolsOptionsFrame
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 6
|
||||
Height = 30
|
||||
Top = 224
|
||||
Top = 276
|
||||
Width = 622
|
||||
Frequency = 250
|
||||
Max = 4000
|
||||
OnChange = AutoDelayTrackBarChange
|
||||
OnChange = AutoCompletionDelayTrackBarChange
|
||||
Position = 0
|
||||
ShowSelRange = False
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
BorderSpacing.Left = 6
|
||||
BorderSpacing.Top = 1
|
||||
BorderSpacing.Right = 6
|
||||
TabOrder = 5
|
||||
TabOrder = 6
|
||||
end
|
||||
object CompletionDropDownLabel: TLabel
|
||||
AnchorSideLeft.Control = ToolTipBevel
|
||||
AnchorSideTop.Control = AutoDelayTrackBar
|
||||
AnchorSideTop.Control = AutoHintDelayTrackBar
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 6
|
||||
Height = 15
|
||||
Top = 208
|
||||
Top = 260
|
||||
Width = 148
|
||||
BorderSpacing.Left = 6
|
||||
BorderSpacing.Top = 6
|
||||
@ -164,7 +164,7 @@ object EditorCodetoolsOptionsFrame: TEditorCodetoolsOptionsFrame
|
||||
AnchorSideTop.Control = CompletionDropDownLabel
|
||||
Left = 174
|
||||
Height = 15
|
||||
Top = 208
|
||||
Top = 260
|
||||
Width = 177
|
||||
BorderSpacing.Left = 20
|
||||
Caption = 'CompletionDropDownDelayLabel'
|
||||
@ -178,13 +178,13 @@ object EditorCodetoolsOptionsFrame: TEditorCodetoolsOptionsFrame
|
||||
AnchorSideBottom.Side = asrBottom
|
||||
Left = 6
|
||||
Height = 23
|
||||
Top = 256
|
||||
Top = 308
|
||||
Width = 220
|
||||
BorderSpacing.Left = 6
|
||||
BorderSpacing.Top = 2
|
||||
ItemHeight = 15
|
||||
Style = csDropDownList
|
||||
TabOrder = 6
|
||||
TabOrder = 7
|
||||
end
|
||||
object CompletionDropDownHintLabel: TLabel
|
||||
AnchorSideLeft.Control = CompletionDropDownHint
|
||||
@ -193,7 +193,7 @@ object EditorCodetoolsOptionsFrame: TEditorCodetoolsOptionsFrame
|
||||
AnchorSideTop.Side = asrCenter
|
||||
Left = 232
|
||||
Height = 15
|
||||
Top = 260
|
||||
Top = 312
|
||||
Width = 171
|
||||
BorderSpacing.Around = 6
|
||||
Caption = 'CompletionDropDownHintLabel'
|
||||
@ -209,7 +209,7 @@ object EditorCodetoolsOptionsFrame: TEditorCodetoolsOptionsFrame
|
||||
Width = 159
|
||||
BorderSpacing.Left = 20
|
||||
Caption = 'DbgToolTipAutoCastClass'
|
||||
TabOrder = 7
|
||||
TabOrder = 8
|
||||
end
|
||||
object AutoDisplayFuncProtoCheckBox: TCheckBox
|
||||
AnchorSideLeft.Control = Owner
|
||||
@ -221,6 +221,53 @@ object EditorCodetoolsOptionsFrame: TEditorCodetoolsOptionsFrame
|
||||
BorderSpacing.Left = 6
|
||||
BorderSpacing.Top = 6
|
||||
Caption = 'AutoDisplayFuncProtoCheckBox'
|
||||
TabOrder = 8
|
||||
TabOrder = 9
|
||||
end
|
||||
object AutoHintDelayLabel: TLabel
|
||||
AnchorSideLeft.Control = ToolTipBevel
|
||||
AnchorSideTop.Control = AutoCompletionDelayTrackBar
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 6
|
||||
Height = 15
|
||||
Top = 208
|
||||
Width = 106
|
||||
BorderSpacing.Left = 6
|
||||
BorderSpacing.Top = 6
|
||||
Caption = 'AutoHintDelayLabel'
|
||||
ParentColor = False
|
||||
end
|
||||
object AutoHintDelayTrackBar: TTrackBar
|
||||
AnchorSideLeft.Control = Owner
|
||||
AnchorSideTop.Control = AutoHintDelayLabel
|
||||
AnchorSideTop.Side = asrBottom
|
||||
AnchorSideRight.Control = Owner
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 6
|
||||
Height = 30
|
||||
Top = 224
|
||||
Width = 622
|
||||
Frequency = 250
|
||||
Max = 4000
|
||||
Min = 10
|
||||
OnChange = AutoCompletionDelayTrackBarChange
|
||||
Position = 500
|
||||
ShowSelRange = False
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
BorderSpacing.Left = 6
|
||||
BorderSpacing.Top = 1
|
||||
BorderSpacing.Right = 6
|
||||
TabOrder = 5
|
||||
end
|
||||
object AutoHDelayLabel: TLabel
|
||||
AnchorSideLeft.Control = AutoHintDelayLabel
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
AnchorSideTop.Control = AutoHintDelayLabel
|
||||
Left = 132
|
||||
Height = 15
|
||||
Top = 208
|
||||
Width = 92
|
||||
BorderSpacing.Left = 20
|
||||
Caption = 'AutoHDelayLabel'
|
||||
ParentColor = False
|
||||
end
|
||||
end
|
||||
|
@ -41,20 +41,23 @@ type
|
||||
TEditorCodetoolsOptionsFrame = class(TAbstractIDEOptionsEditor)
|
||||
AutoCompleteBlockCheckBox: TCheckBox;
|
||||
AutoDelayLabel: TLabel;
|
||||
AutoHDelayLabel: TLabel;
|
||||
AutoHintDelayTrackBar: TTrackBar;
|
||||
AutoDisplayFuncProtoCheckBox: TCheckBox;
|
||||
AutoHintDelayLabel: TLabel;
|
||||
DbgToolTipAutoCastClass: TCheckBox;
|
||||
CompletionDropDownHintLabel: TLabel;
|
||||
CompletionDropDownHint: TComboBox;
|
||||
CompletionDropDownDelayLabel: TLabel;
|
||||
AutoDelayTrackBar: TTrackBar;
|
||||
AutoCompletionDelayTrackBar: TTrackBar;
|
||||
CompletionDropDownLabel: TLabel;
|
||||
CompletionDropDownHintTrackBar: TTrackBar;
|
||||
AutoToolTipExprEvalCheckBox: TCheckBox;
|
||||
AutoHintAndCompletionDelayLabel: TLabel;
|
||||
AutoCompletionDelayLabel: TLabel;
|
||||
ToolTipBevel: TBevel;
|
||||
AutoToolTipSymbToolsCheckBox: TCheckBox;
|
||||
AutoRemoveEmptyMethodsOnSave: TCheckBox;
|
||||
procedure AutoDelayTrackBarChange(Sender: TObject);
|
||||
procedure AutoCompletionDelayTrackBarChange(Sender: TObject);
|
||||
public
|
||||
function GetTitle: String; override;
|
||||
procedure Setup({%H-}ADialog: TAbstractOptionsEditorDialog); override;
|
||||
@ -69,10 +72,12 @@ implementation
|
||||
|
||||
{ TEditorCodetoolsOptionsFrame }
|
||||
|
||||
procedure TEditorCodetoolsOptionsFrame.AutoDelayTrackBarChange(Sender: TObject);
|
||||
procedure TEditorCodetoolsOptionsFrame.AutoCompletionDelayTrackBarChange(Sender: TObject);
|
||||
begin
|
||||
AutoDelayLabel.Caption :=
|
||||
Format(dlgEdDelayInSec, [FormatFloat('0.00', AutoDelayTrackBar.Position/1000)]);
|
||||
Format(dlgEdDelayInSec, [FormatFloat('0.00', AutoCompletionDelayTrackBar.Position/1000)]);
|
||||
AutoHDelayLabel.Caption :=
|
||||
Format(dlgEdDelayInSec, [FormatFloat('0.00', AutoHintDelayTrackBar.Position/1000)]);
|
||||
CompletionDropDownDelayLabel.Caption :=
|
||||
Format(dlgEdDelayInSec, [FormatFloat('0.00', CompletionDropDownHintTrackBar.Position/1000)]);
|
||||
end;
|
||||
@ -91,7 +96,8 @@ begin
|
||||
AutoCompleteBlockCheckBox.Caption := dlgEdCompleteBlocks;
|
||||
AutoDisplayFuncProtoCheckBox.Caption := dlgAutoDisplayFuncProto;
|
||||
|
||||
AutoHintAndCompletionDelayLabel.Caption:=lisDelayForHintsAndCompletionBox;
|
||||
AutoCompletionDelayLabel.Caption:=lisDelayForCompletionBox;
|
||||
AutoHintDelayLabel.Caption:=lisDelayForHints;
|
||||
CompletionDropDownLabel.Caption := lisDelayForCompletionLongLineHint;
|
||||
CompletionDropDownHintLabel.Caption := lisCompletionLongLineHintType;
|
||||
CompletionDropDownHint.Clear;
|
||||
@ -109,7 +115,8 @@ begin
|
||||
AutoToolTipExprEvalCheckBox.Checked := AutoToolTipExprEval;
|
||||
AutoToolTipSymbToolsCheckBox.Checked := AutoToolTipSymbTools;
|
||||
DbgToolTipAutoCastClass.Checked := DbgHintAutoTypeCastClass;
|
||||
AutoDelayTrackBar.Position := AutoDelayInMSec;
|
||||
AutoCompletionDelayTrackBar.Position := AutoDelayInMSec;
|
||||
AutoHintDelayTrackBar.Position := AutoHintDelayInMSec;
|
||||
AutoRemoveEmptyMethodsOnSave.Checked := AutoRemoveEmptyMethods;
|
||||
AutoDisplayFuncProtoCheckBox.Checked := AutoDisplayFunctionPrototypes;
|
||||
|
||||
@ -117,7 +124,7 @@ begin
|
||||
CompletionDropDownHint.ItemIndex := ord(CompletionLongLineHintType);
|
||||
|
||||
end;
|
||||
AutoDelayTrackBarChange(nil);
|
||||
AutoCompletionDelayTrackBarChange(nil);
|
||||
end;
|
||||
|
||||
procedure TEditorCodetoolsOptionsFrame.WriteSettings(AOptions: TAbstractIDEOptions);
|
||||
@ -128,7 +135,8 @@ begin
|
||||
AutoToolTipExprEval := AutoToolTipExprEvalCheckBox.Checked;
|
||||
AutoToolTipSymbTools := AutoToolTipSymbToolsCheckBox.Checked;
|
||||
DbgHintAutoTypeCastClass := DbgToolTipAutoCastClass.Checked;
|
||||
AutoDelayInMSec := AutoDelayTrackBar.Position;
|
||||
AutoDelayInMSec := AutoCompletionDelayTrackBar.Position;
|
||||
AutoHintDelayInMSec := AutoHintDelayTrackBar.Position;
|
||||
AutoRemoveEmptyMethods := AutoRemoveEmptyMethodsOnSave.Checked;
|
||||
AutoDisplayFunctionPrototypes := AutoDisplayFuncProtoCheckBox.Checked;
|
||||
|
||||
|
@ -1981,7 +1981,8 @@ resourcestring
|
||||
dlgAutoDisplayFuncProto = 'Auto Display Function Prototypes';
|
||||
lisShowDeclarationHints = 'Show declaration hints';
|
||||
dlgEdDelayInSec = '(%s sec delay)';
|
||||
lisDelayForHintsAndCompletionBox = 'Delay for hints and completion box';
|
||||
lisDelayForCompletionBox = 'Delay for completion box';
|
||||
lisDelayForHints = 'Delay for hints';
|
||||
lisDelayForCompletionLongLineHint = 'Delay for long line hints in completion box';
|
||||
lisCompletionLongLineHintType = 'Show long line hints';
|
||||
lisCompletionLongLineHintTypeNone = 'Never';
|
||||
|
@ -2175,7 +2175,7 @@ begin
|
||||
// HintTimer
|
||||
FAutoHintTimer := TIdleTimer.Create(nil);
|
||||
with FAutoHintTimer do begin
|
||||
Interval := EditorOpts.AutoDelayInMSec;
|
||||
Interval := EditorOpts.AutoHintDelayInMSec;
|
||||
Enabled := False;
|
||||
AutoEnabled := False;
|
||||
OnTimer := @HintTimer;
|
||||
@ -10311,7 +10311,7 @@ begin
|
||||
IndentToTokenStart:=EditorOpts.CodeTemplateIndentToTokenStart;
|
||||
end;
|
||||
|
||||
FHints.AutoHintTimer.Interval:=EditorOpts.AutoDelayInMSec;
|
||||
FHints.AutoHintTimer.Interval:=EditorOpts.AutoHintDelayInMSec;
|
||||
|
||||
if FDefaultCompletionForm <> nil then begin
|
||||
FDefaultCompletionForm.LongLineHintTime := EditorOpts.CompletionLongLineHintInMSec;
|
||||
|
Loading…
Reference in New Issue
Block a user