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

View File

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

View File

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

View File

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

View File

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