From c319ad6bd86c666d75f9fd8747a176592e4c36c2 Mon Sep 17 00:00:00 2001 From: martin Date: Mon, 28 May 2012 15:20:17 +0000 Subject: [PATCH] DBG: Watches, save "Use instance class" to config git-svn-id: trunk@37444 - --- debugger/debugger.pp | 12 ++++++++++++ debugger/watchpropertydlg.lfm | 3 +-- debugger/watchpropertydlg.pp | 3 +++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/debugger/debugger.pp b/debugger/debugger.pp index 9c5f9cbc27..f3ca2935e1 100644 --- a/debugger/debugger.pp +++ b/debugger/debugger.pp @@ -4783,6 +4783,9 @@ begin FThreadId := AConfig.GetValue(APath + 'ThreadId', -1); FStackFrame := AConfig.GetValue(APath + 'StackFrame', -1); FValue := AConfig.GetValue(APath + 'Value', ''); + if AConfig.GetValue(APath + 'ClassAutoCast', False) + then Include(FEvaluateFlags, defClassAutoCast) + else Exclude(FEvaluateFlags, defClassAutoCast); try ReadStr(AConfig.GetValue(APath + 'DisplayFormat', 'wdfDefault'), FDisplayFormat); except FDisplayFormat := wdfDefault; end; try ReadStr(AConfig.GetValue(APath + 'Validity', 'ddsValid'), FValidity); @@ -4800,6 +4803,7 @@ begin AConfig.SetDeleteValue(APath + 'DisplayFormat', s, 'wdfDefault'); WriteStr(s, FValidity); AConfig.SetDeleteValue(APath + 'Validity', s, 'ddsValid'); + AConfig.SetDeleteValue(APath + 'ClassAutoCast', defClassAutoCast in FEvaluateFlags, False); end; constructor TWatchValue.Create; @@ -8248,6 +8252,9 @@ procedure TWatch.LoadDataFromXMLConfig(const AConfig: TXMLConfig; const APath: s begin FEnabled := AConfig.GetValue(APath + 'Enabled', True); FExpression := AConfig.GetValue(APath + 'Expression', ''); + if AConfig.GetValue(APath + 'ClassAutoCast', False) + then Include(FEvaluateFlags, defClassAutoCast) + else Exclude(FEvaluateFlags, defClassAutoCast); try ReadStr(AConfig.GetValue(APath + 'DisplayFormat', 'wdfDefault'), FDisplayFormat); except FDisplayFormat := wdfDefault; end; @@ -8262,6 +8269,7 @@ begin AConfig.SetDeleteValue(APath + 'Expression', FExpression, ''); WriteStr(s{%H-}, FDisplayFormat); AConfig.SetDeleteValue(APath + 'DisplayFormat', s, 'wdfDefault'); + AConfig.SetDeleteValue(APath + 'ClassAutoCast', defClassAutoCast in FEvaluateFlags, False); FValueList.SaveDataToXMLConfig(AConfig, APath + 'ValueList/'); end; @@ -8354,6 +8362,9 @@ var begin Expression := AConfig.GetValue(APath + 'Expression/Value', ''); Enabled := AConfig.GetValue(APath + 'Enabled/Value', true); + if AConfig.GetValue(APath + 'ClassAutoCast', False) + then Include(FEvaluateFlags, defClassAutoCast) + else Exclude(FEvaluateFlags, defClassAutoCast); i := StringCase (AConfig.GetValue(APath + 'DisplayStyle/Value', TWatchDisplayFormatNames[wdfDefault]), TWatchDisplayFormatNames); @@ -8368,6 +8379,7 @@ begin AConfig.SetDeleteValue(APath + 'Enabled/Value', Enabled, true); AConfig.SetDeleteValue(APath + 'DisplayStyle/Value', TWatchDisplayFormatNames[DisplayFormat], TWatchDisplayFormatNames[wdfDefault]); + AConfig.SetDeleteValue(APath + 'ClassAutoCast', defClassAutoCast in FEvaluateFlags, False); end; { =========================================================================== } diff --git a/debugger/watchpropertydlg.lfm b/debugger/watchpropertydlg.lfm index c0fe2b4a14..2e6d14bb89 100644 --- a/debugger/watchpropertydlg.lfm +++ b/debugger/watchpropertydlg.lfm @@ -12,7 +12,7 @@ object WatchPropertyDlg: TWatchPropertyDlg ClientWidth = 420 Constraints.MinWidth = 400 Position = poScreenCenter - LCLVersion = '0.9.31' + LCLVersion = '1.1' object lblExpression: TLabel AnchorSideTop.Control = txtExpression AnchorSideTop.Side = asrCenter @@ -98,7 +98,6 @@ object WatchPropertyDlg: TWatchPropertyDlg Height = 19 Top = 64 Width = 62 - AllowGrayed = True BorderSpacing.Left = 6 BorderSpacing.Top = 6 Caption = 'Enabled' diff --git a/debugger/watchpropertydlg.pp b/debugger/watchpropertydlg.pp index d06f2c40b2..fdaad28639 100644 --- a/debugger/watchpropertydlg.pp +++ b/debugger/watchpropertydlg.pp @@ -123,13 +123,16 @@ begin chkEnabled.Checked := True; txtExpression.Text := AWatchExpression; rgStyle.ItemIndex := 7; + chkUseInstanceClass.Checked := False; end else begin txtExpression.Text := FWatch.Expression; chkEnabled.Checked := FWatch.Enabled; rgStyle.ItemIndex := DispFormatToStyle[FWatch.DisplayFormat]; + chkUseInstanceClass.Checked := defClassAutoCast in FWatch.EvaluateFlags; end; + lblRepCount.Enabled := False; txtRepCount.Enabled := False; lblDigits.Enabled := False;