IDE, DBG: add option for class auto-typecast for hints

git-svn-id: trunk@32226 -
This commit is contained in:
martin 2011-09-08 10:22:56 +00:00
parent 48ce3e8d5c
commit 40b978309a
5 changed files with 68 additions and 38 deletions

View File

@ -993,6 +993,7 @@ type
FAutoRemoveEmptyMethods: Boolean;
fAutoToolTipExprEval: Boolean;
fAutoToolTipSymbTools: Boolean;
FDbgHintAutoTypeCastClass: Boolean;
fCodeTemplateFileName: String;
fCTemplIndentToTokenStart: Boolean;
@ -1143,6 +1144,10 @@ type
read fAutoToolTipExprEval write fAutoToolTipExprEval default True; // debugger hints
property AutoToolTipSymbTools: Boolean
read fAutoToolTipSymbTools write fAutoToolTipSymbTools default True; // declaration hints
published
property DbgHintAutoTypeCastClass: Boolean
read FDbgHintAutoTypeCastClass write FDbgHintAutoTypeCastClass default True; // declaration hints
public
property AutoDelayInMSec: Integer read fAutoDelayInMSec
write fAutoDelayInMSec default 1000;
property CodeTemplateFileName: String
@ -3084,6 +3089,9 @@ begin
FMarkupCurWordTrim := True;
FMarkupCurWordNoTimer := False;
// hints
FDbgHintAutoTypeCastClass := True;
// Code Tools options
FCompletionLongLineHintType := DefaultCompletionLongLineHintType;

View File

@ -1,10 +1,11 @@
inherited EditorCodetoolsOptionsFrame: TEditorCodetoolsOptionsFrame
Height = 492
Width = 634
HorzScrollBar.Page = 634
VertScrollBar.Page = 492
AutoScroll = True
ClientHeight = 492
ClientWidth = 634
TabOrder = 0
Visible = False
DesignLeft = 263
DesignTop = 222
@ -12,10 +13,10 @@ inherited EditorCodetoolsOptionsFrame: TEditorCodetoolsOptionsFrame
AnchorSideLeft.Control = AutoHintAndCompletionDelayLabel
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = AutoHintAndCompletionDelayLabel
Left = 193
Height = 14
Top = 107
Width = 76
Left = 218
Height = 16
Top = 134
Width = 84
BorderSpacing.Left = 20
Caption = 'AutoDelayLabel'
ParentColor = False
@ -28,7 +29,7 @@ inherited EditorCodetoolsOptionsFrame: TEditorCodetoolsOptionsFrame
AnchorSideRight.Side = asrBottom
Left = 0
Height = 3
Top = 52
Top = 56
Width = 634
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Top = 6
@ -38,9 +39,9 @@ inherited EditorCodetoolsOptionsFrame: TEditorCodetoolsOptionsFrame
AnchorSideLeft.Control = Owner
AnchorSideTop.Control = Owner
Left = 6
Height = 17
Height = 19
Top = 6
Width = 189
Width = 210
BorderSpacing.Left = 6
BorderSpacing.Top = 6
Caption = 'AutoRemoveEmptyMethodsOnSave'
@ -51,9 +52,9 @@ inherited EditorCodetoolsOptionsFrame: TEditorCodetoolsOptionsFrame
AnchorSideTop.Control = ToolTipBevel
AnchorSideTop.Side = asrBottom
Left = 6
Height = 17
Top = 61
Width = 173
Height = 19
Top = 65
Width = 198
BorderSpacing.Left = 6
BorderSpacing.Top = 6
Caption = 'AutoToolTipSymbToolsCheckBox'
@ -64,9 +65,9 @@ inherited EditorCodetoolsOptionsFrame: TEditorCodetoolsOptionsFrame
AnchorSideTop.Control = AutoRemoveEmptyMethodsOnSave
AnchorSideTop.Side = asrBottom
Left = 6
Height = 17
Top = 29
Width = 157
Height = 19
Top = 31
Width = 179
BorderSpacing.Left = 6
BorderSpacing.Top = 6
Caption = 'AutoCompleteBlockCheckBox'
@ -77,9 +78,9 @@ inherited EditorCodetoolsOptionsFrame: TEditorCodetoolsOptionsFrame
AnchorSideTop.Control = AutoToolTipSymbToolsCheckBox
AnchorSideTop.Side = asrBottom
Left = 6
Height = 17
Top = 84
Width = 164
Height = 19
Top = 90
Width = 182
BorderSpacing.Left = 6
BorderSpacing.Top = 6
Caption = 'AutoToolTipExprEvalCheckBox'
@ -93,7 +94,7 @@ inherited EditorCodetoolsOptionsFrame: TEditorCodetoolsOptionsFrame
AnchorSideRight.Side = asrBottom
Left = 6
Height = 30
Top = 122
Top = 151
Width = 622
Frequency = 250
Max = 4000
@ -109,12 +110,12 @@ inherited EditorCodetoolsOptionsFrame: TEditorCodetoolsOptionsFrame
end
object AutoHintAndCompletionDelayLabel: TLabel[7]
AnchorSideLeft.Control = ToolTipBevel
AnchorSideTop.Control = AutoToolTipExprEvalCheckBox
AnchorSideTop.Control = DbgToolTipAutoCastClass
AnchorSideTop.Side = asrBottom
Left = 6
Height = 14
Top = 107
Width = 167
Height = 16
Top = 134
Width = 192
BorderSpacing.Left = 6
BorderSpacing.Top = 6
Caption = 'AutoHintAndCompletionDelayLabel'
@ -128,7 +129,7 @@ inherited EditorCodetoolsOptionsFrame: TEditorCodetoolsOptionsFrame
AnchorSideRight.Side = asrBottom
Left = 6
Height = 30
Top = 173
Top = 204
Width = 622
Frequency = 250
Max = 4000
@ -146,9 +147,9 @@ inherited EditorCodetoolsOptionsFrame: TEditorCodetoolsOptionsFrame
AnchorSideTop.Control = AutoDelayTrackBar
AnchorSideTop.Side = asrBottom
Left = 6
Height = 14
Top = 158
Width = 129
Height = 16
Top = 187
Width = 149
BorderSpacing.Left = 6
BorderSpacing.Top = 6
Caption = 'CompletionDropDownLabel'
@ -158,10 +159,10 @@ inherited EditorCodetoolsOptionsFrame: TEditorCodetoolsOptionsFrame
AnchorSideLeft.Control = CompletionDropDownLabel
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = CompletionDropDownLabel
Left = 155
Height = 14
Top = 158
Width = 156
Left = 175
Height = 16
Top = 187
Width = 178
BorderSpacing.Left = 20
Caption = 'CompletionDropDownDelayLabel'
ParentColor = False
@ -173,12 +174,12 @@ inherited EditorCodetoolsOptionsFrame: TEditorCodetoolsOptionsFrame
AnchorSideBottom.Control = Owner
AnchorSideBottom.Side = asrBottom
Left = 6
Height = 21
Top = 205
Height = 23
Top = 236
Width = 220
BorderSpacing.Left = 6
BorderSpacing.Top = 2
ItemHeight = 13
ItemHeight = 15
Style = csDropDownList
TabOrder = 6
end
@ -188,11 +189,23 @@ inherited EditorCodetoolsOptionsFrame: TEditorCodetoolsOptionsFrame
AnchorSideTop.Control = CompletionDropDownHint
AnchorSideTop.Side = asrCenter
Left = 232
Height = 14
Top = 208
Width = 148
Height = 16
Top = 239
Width = 172
BorderSpacing.Around = 6
Caption = 'CompletionDropDownHintLabel'
ParentColor = False
end
object DbgToolTipAutoCastClass: TCheckBox[13]
AnchorSideLeft.Control = AutoToolTipExprEvalCheckBox
AnchorSideTop.Control = AutoToolTipExprEvalCheckBox
AnchorSideTop.Side = asrBottom
Left = 26
Height = 19
Top = 109
Width = 159
BorderSpacing.Left = 20
Caption = 'DbgToolTipAutoCastClass'
TabOrder = 7
end
end

View File

@ -36,6 +36,7 @@ type
TEditorCodetoolsOptionsFrame = class(TAbstractIDEOptionsEditor)
AutoCompleteBlockCheckBox: TCheckBox;
AutoDelayLabel: TLabel;
DbgToolTipAutoCastClass: TCheckBox;
CompletionDropDownHintLabel: TLabel;
CompletionDropDownHint: TComboBox;
CompletionDropDownDelayLabel: TLabel;
@ -79,6 +80,7 @@ begin
AutoRemoveEmptyMethodsOnSave.Caption := dlgAutoRemoveEmptyMethods;
AutoToolTipSymbToolsCheckBox.Caption := lisShowDeclarationHints;
AutoToolTipExprEvalCheckBox.Caption := lisShowValueHintsWhileDebugging;
DbgToolTipAutoCastClass.Caption := lisDebugHintAutoTypeCastClass;
AutoCompleteBlockCheckBox.Caption := dlgEdCompleteBlocks;
AutoHintAndCompletionDelayLabel.Caption:=lisDelayForHintsAndCompletionBox;
@ -98,6 +100,7 @@ begin
AutoCompleteBlockCheckBox.Checked := AutoBlockCompletion;
AutoToolTipExprEvalCheckBox.Checked := AutoToolTipExprEval;
AutoToolTipSymbToolsCheckBox.Checked := AutoToolTipSymbTools;
DbgToolTipAutoCastClass.Checked := DbgHintAutoTypeCastClass;
AutoDelayTrackBar.Position := AutoDelayInMSec;
AutoRemoveEmptyMethodsOnSave.Checked := AutoRemoveEmptyMethods;
@ -115,6 +118,7 @@ begin
AutoBlockCompletion := AutoCompleteBlockCheckBox.Checked;
AutoToolTipExprEval := AutoToolTipExprEvalCheckBox.Checked;
AutoToolTipSymbTools := AutoToolTipSymbToolsCheckBox.Checked;
DbgHintAutoTypeCastClass := DbgToolTipAutoCastClass.Checked;
AutoDelayInMSec := AutoDelayTrackBar.Position;
AutoRemoveEmptyMethods := AutoRemoveEmptyMethodsOnSave.Checked;

View File

@ -1464,6 +1464,7 @@ resourcestring
dlgEdIdComlet = 'Identifier completion';
dlgEdCompleteBlocks = 'Add close statement for pascal blocks';
lisShowValueHintsWhileDebugging = 'Show value hints while debugging';
lisDebugHintAutoTypeCastClass = 'Automatic type-cast for objects';
dlgTooltipEval = 'Tooltip expression evaluation';
dlgTooltipTools = 'Tooltip symbol Tools';
dlgMarkupGroup = 'Word under Caret Highlight';

View File

@ -16197,6 +16197,7 @@ var
DBGType,DBGTypeDerefer: TDBGType;
HasHint: Boolean;
p: SizeInt;
Opts: TDBGEvaluateFlags;
begin
//DebugLn(['TMainIDE.OnSrcNotebookShowHintForSource START']);
if (SrcEdit=nil) then exit;
@ -16231,7 +16232,10 @@ begin
//DebugLn(['TMainIDE.OnSrcNotebookShowHintForSource Expression="',Expression,'"']);
DBGType:=nil;
DBGTypeDerefer:=nil;
if not DebugBoss.Evaluate(Expression, DebugEval, DBGType, [defClassAutoCast]) or (DebugEval = '') then
Opts := [];
if EditorOpts.DbgHintAutoTypeCastClass
then Opts := [defClassAutoCast];
if not DebugBoss.Evaluate(Expression, DebugEval, DBGType, Opts) or (DebugEval = '') then
DebugEval := '???';
// deference a pointer - maybe it is a class
if Assigned(DBGType) and (DBGType.Kind in [skPointer]) and
@ -16240,7 +16244,7 @@ begin
begin
if DBGType.Value.AsPointer <> nil then
begin
if DebugBoss.Evaluate(Expression + '^', DebugEvalDerefer, DBGTypeDerefer, [defClassAutoCast]) then
if DebugBoss.Evaluate(Expression + '^', DebugEvalDerefer, DBGTypeDerefer, Opts) then
begin
if Assigned(DBGTypeDerefer) and
( (DBGTypeDerefer.Kind <> skPointer) or