Browse Source

Fixed debugger tooltip grid.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@683 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 20 years ago
parent
commit
e71835b49f
  1. 1
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Service/WindowsDebugger.cs
  2. 28
      src/Main/Base/Project/Src/Gui/TreeGrid/DynamicTreeRow.cs
  3. 39
      src/Main/Base/Project/Src/Services/Debugger/DebuggerGridControl.cs

1
src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Service/WindowsDebugger.cs

@ -253,6 +253,7 @@ namespace ICSharpCode.SharpDevelop.Services @@ -253,6 +253,7 @@ namespace ICSharpCode.SharpDevelop.Services
row.ChildRows.Clear();
foreach(Variable variable in row.Variable.SubVariables) {
DynamicTreeDebuggerRow newRow = new DynamicTreeDebuggerRow(variable);
DebuggerGridControl.AddColumns(newRow.ChildColumns);
newRow.Expanding += TooltipControlRowExpanding;
row.ChildRows.Add(newRow);
}

28
src/Main/Base/Project/Src/Gui/TreeGrid/DynamicTreeRow.cs

@ -21,14 +21,32 @@ namespace ICSharpCode.SharpDevelop.Gui.TreeGrid @@ -21,14 +21,32 @@ namespace ICSharpCode.SharpDevelop.Gui.TreeGrid
public DynamicTreeRow()
{
plus = this[0];
plus.HighlightBrush = Brushes.AliceBlue;
plus.Cursor = Cursors.Hand;
plus.Click += OnPlusClick;
plus.Paint += OnPlusPaint;
plus.Text = "+";
plus.TextFormat = new StringFormat(plus.TextFormat);
plus.TextFormat.Alignment = StringAlignment.Center;
plus.TextFormat.LineAlignment = StringAlignment.Center;
ShowPlus = true;
}
bool showPlus;
public bool ShowPlus {
get {
return showPlus;
}
set {
showPlus = value;
plus.HighlightBrush = showPlus ? Brushes.AliceBlue : null;
plus.Cursor = showPlus ? Cursors.Hand : null;
if (showPlus) {
plus.Click += OnPlusClick;
plus.Paint += OnPlusPaint;
plus.Text = "+";
} else {
plus.Click -= OnPlusClick;
plus.Paint -= OnPlusPaint;
plus.Text = "";
}
}
}
protected virtual void OnPlusPaint(object sender, PaintEventArgs e)

39
src/Main/Base/Project/Src/Services/Debugger/DebuggerGridControl.cs

@ -6,6 +6,7 @@ @@ -6,6 +6,7 @@
*/
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;
using ICSharpCode.SharpDevelop.Gui.TreeGrid;
@ -22,27 +23,35 @@ namespace ICSharpCode.Core @@ -22,27 +23,35 @@ namespace ICSharpCode.Core
DynamicTreeRow row;
public static void AddColumns(IList<DynamicListColumn> columns)
{
columns.Add(new DynamicListColumn());
columns.Add(new DynamicListColumn());
columns.Add(new DynamicListColumn());
columns.Add(new DynamicListColumn());
columns[0].BackgroundBrush = SystemBrushes.ControlLightLight;
// default is allowgrow = true and autosize = false
columns[0].AllowGrow = false;
columns[1].AllowGrow = false;
columns[1].Width = 18;
columns[2].AutoSize = true;
columns[2].MinimumWidth = 75;
columns[3].AutoSize = true;
columns[3].MinimumWidth = 75;
}
public DebuggerGridControl(DynamicTreeRow row)
{
this.row = row;
BeginUpdate();
Columns.Add(new DynamicListColumn());
Columns.Add(new DynamicListColumn());
Columns.Add(new DynamicListColumn());
Columns.Add(new DynamicListColumn());
Columns[0].BackgroundBrush = SystemBrushes.ControlLightLight;
// default is allowgrow = true and autosize = false
Columns[0].AllowGrow = false;
Columns[1].AllowGrow = false;
Columns[1].Width = 18;
Columns[2].AutoSize = true;
Columns[3].AutoSize = true;
AddColumns(Columns);
Rows.Add(row);
foreach (DynamicListColumn col in Columns) {
row.ChildColumns.Add(col.Clone());
}
AddColumns(row.ChildColumns);
row.Expanded += delegate { isExpanded = true; };
row.Collapsed += delegate { isExpanded = false; };
@ -64,7 +73,7 @@ namespace ICSharpCode.Core @@ -64,7 +73,7 @@ namespace ICSharpCode.Core
int ypos = (textArea.Document.GetVisibleLine(logicTextPos.Y) + 1) * textArea.TextView.FontHeight - textArea.VirtualTop.Y;
Point p = new Point(0, ypos);
p = textArea.PointToScreen(p);
p.X = Control.MousePosition.X;
p.X = Control.MousePosition.X - 16;
frm.StartPosition = FormStartPosition.Manual;
frm.ShowInTaskbar = false;
frm.Location = p;

Loading…
Cancel
Save