// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) // This code is distributed under the GNU LGPL (for details please see \doc\license.txt) using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using WeifenLuo.WinFormsUI.Docking; namespace VisualPascalABC { public partial class DebugWatchListWindowForm : BottomDockContentForm { // private System.Windows.Forms.DataGridViewTextBoxColumn WColumn4; // private System.Windows.Forms.DataGridViewTextBoxColumn WColumn1; // private System.Windows.Forms.DataGridViewTextBoxColumn WColumn2; // private System.Windows.Forms.DataGridViewTextBoxColumn WColumn3; // private System.Windows.Forms.DataGridViewTextBoxColumn WColumn5; private System.Windows.Forms.DataGridViewTextBoxColumn WColumn4; private AdvancedDataGridView.TreeGridColumn WColumn1; private System.Windows.Forms.DataGridViewTextBoxColumn WColumn2; private System.Windows.Forms.DataGridViewTextBoxColumn WColumn3; private System.Windows.Forms.DataGridViewTextBoxColumn WColumn5; private System.Windows.Forms.DataGridViewTextBoxColumn WColumn6Empty; private System.Threading.Thread th; public void RefreshWatch() { //if (!dbgHelper.IsRunning) return; /*if (th != null && th.ThreadState == System.Threading.ThreadState.Running) { System.Threading.Thread.Sleep(50); if (th.ThreadState == System.Threading.ThreadState.Running) th.Suspend(); }*/ // if (th == null || th.ThreadState != System.Threading.ThreadState.Running) // { // th = new System.Threading.Thread(new System.Threading.ThreadStart(RefreshWatchInThread)); // th.Start(); // } RefreshWatchInThread(); } private string WrapPrimValue(object val) { if (val is string || val is char) return "'" + val.ToString() + "'"; return val.ToString(); } public void ClearAllSubTrees() { for (int i = 0; i < this.watchList.Rows.Count; i++) { if (this.watchList.Rows[i].Cells[0].Value != null) { ClearRow(i); } } } public void ClearRow(int i) { AdvancedDataGridView.TreeGridNode node = this.watchList.Rows[i] as AdvancedDataGridView.TreeGridNode; if (node.IsExpanded) node.Collapse(); node.populated = false; node.IsExpanded = false; node.InExpanding = false; node.HasChildren = false; node._grid= null; node.Nodes.Clear(); this.watchList.InvalidateRow(i); } public void SetUndefinedValue(int i) { if (this.watchList.Rows[i].Cells[0].Value != null) { this.ClearRow(i); //FixedItem fi = new FixedItem(this.watchList.Rows[i].Cells[0].Value as string,PascalABCCompiler.StringResources.Get("EXPR_VALUE_UNDEFINED_VALUE"),PascalABCCompiler.StringResources.Get("EXPR_VALUE_UNDEFINED_TYPE")); FixedItem fi = new FixedItem(this.watchList.Rows[i].Cells[0].Value as string,"",""); //fi.imageIndex = CodeCompletionProvider.ImagesProvider.IconNumberEvalError; this.watchList.Rows[i].Cells[1].Value = fi.Text; this.watchList.Rows[i].Cells[2].Value = fi.Type; (this.watchList.Rows[i] as AdvancedDataGridView.TreeGridNode)._grid = this.watchList; (this.watchList.Rows[i] as AdvancedDataGridView.TreeGridNode).Content = fi; this.watchList.InvalidateCell(0,i); } } public string[] GetExpressions() { List exprs = new List(); for (int i=0; i