[svn] r7259: vs-plugin/trunk/Nemerle.VsIntegration/GUI: AstToolControl.Designer.cs AstToolControl.cs AstTo...

VladD2 svnadmin at nemerle.org
Fri Jan 12 12:53:06 CET 2007


Log:
Improve and fix AstToolWindow.

Author: VladD2
Date: Fri Jan 12 12:53:05 2007
New Revision: 7259

Modified:
   vs-plugin/trunk/Nemerle.VsIntegration/GUI/AstToolControl.Designer.cs
   vs-plugin/trunk/Nemerle.VsIntegration/GUI/AstToolControl.cs
   vs-plugin/trunk/Nemerle.VsIntegration/GUI/AstToolControl.resx

Modified: vs-plugin/trunk/Nemerle.VsIntegration/GUI/AstToolControl.Designer.cs
==============================================================================
--- vs-plugin/trunk/Nemerle.VsIntegration/GUI/AstToolControl.Designer.cs	(original)
+++ vs-plugin/trunk/Nemerle.VsIntegration/GUI/AstToolControl.Designer.cs	Fri Jan 12 12:53:05 2007
@@ -137,6 +137,7 @@
 			this._grid.VirtualMode = true;
 			this._grid.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this._grid_CellClick);
 			this._grid.CellValueNeeded += new System.Windows.Forms.DataGridViewCellValueEventHandler(this._grid_CellValueNeeded);
+			this._grid.CellFormatting += new System.Windows.Forms.DataGridViewCellFormattingEventHandler(this._grid_CellFormatting);
 			this._grid.CellToolTipTextNeeded += new System.Windows.Forms.DataGridViewCellToolTipTextNeededEventHandler(this._grid_CellToolTipTextNeeded);
 			// 
 			// _astColumn

Modified: vs-plugin/trunk/Nemerle.VsIntegration/GUI/AstToolControl.cs
==============================================================================
--- vs-plugin/trunk/Nemerle.VsIntegration/GUI/AstToolControl.cs	(original)
+++ vs-plugin/trunk/Nemerle.VsIntegration/GUI/AstToolControl.cs	Fri Jan 12 12:53:05 2007
@@ -13,6 +13,7 @@
 using Nemerle.VisualStudio.Project;
 using Nemerle.VisualStudio.LanguageService;
 using Nemerle.Compiler.Utils;
+using NLocation = Nemerle.Compiler.Location;
 
 namespace Nemerle.VisualStudio.GUI
 {
@@ -42,7 +43,7 @@
 			if (_items.Count <= 0)
 				return;
 
-			int index = Nemerle.Compiler.Location.IndexOfMostNested2(_items,
+			int index = NLocation.IndexOfMostNested2(_items,
 				delegate(AstNodeInfo n) { return n.Location; }, line, col);
 
 			if (index >= 0)
@@ -74,7 +75,11 @@
 			try
 			{
 				if (ShowLocation != null)
-					ShowLocation(_items[e.RowIndex].Location);
+				{
+					Location loc = _items[e.RowIndex].Location;
+					if (loc != NLocation.Default)
+						ShowLocation(loc);
+				}
 			}
 			catch { }
 		}
@@ -126,5 +131,15 @@
 			_grid.Invalidate();
 			_grid.Update();
 		}
+
+		private void _grid_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
+		{
+			Location loc = _items[e.RowIndex].Location;
+			if (loc == NLocation.Default)
+			{
+				e.CellStyle.ForeColor = Color.Red;
+				e.FormattingApplied = true;
+			}
+		}
 	}
 }

Modified: vs-plugin/trunk/Nemerle.VsIntegration/GUI/AstToolControl.resx
==============================================================================
--- vs-plugin/trunk/Nemerle.VsIntegration/GUI/AstToolControl.resx	(original)
+++ vs-plugin/trunk/Nemerle.VsIntegration/GUI/AstToolControl.resx	Fri Jan 12 12:53:05 2007
@@ -123,7 +123,4 @@
   <metadata name="_astColumn.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
-  <metadata name="_toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
-    <value>17, 17</value>
-  </metadata>
 </root>
\ No newline at end of file



More information about the svn mailing list