[Monodevelop-patches-list] r2034 - in trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor: . CodeCompletion
commit-watcher at mono-cvs.ximian.com
commit-watcher at mono-cvs.ximian.com
Tue Nov 23 18:54:38 EST 2004
Author: alp
Date: 2004-11-23 18:54:38 -0500 (Tue, 23 Nov 2004)
New Revision: 2034
Modified:
trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/ChangeLog
trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/CodeCompletion/CodeCompletionData.cs
trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/CodeCompletion/CompletionListWindow.cs
trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/CodeCompletion/DeclarationViewWindow.cs
Log:
2004-11-24 Alp Toker <alp at atoker.com>
* CodeCompletion/CodeCompletionData.cs:
* CodeCompletion/CompletionListWindow.cs:
* CodeCompletion/DeclarationViewWindow.cs:
Fix wrapping of completion documentation.
Remove redundant overload count.
Add arrow UI hint for selecting an overloaded method.
Modified: trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/ChangeLog
===================================================================
--- trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/ChangeLog 2004-11-23 21:59:46 UTC (rev 2033)
+++ trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/ChangeLog 2004-11-23 23:54:38 UTC (rev 2034)
@@ -1,3 +1,12 @@
+2004-11-24 Alp Toker <alp at atoker.com>
+
+ * CodeCompletion/CodeCompletionData.cs:
+ * CodeCompletion/CompletionListWindow.cs:
+ * CodeCompletion/DeclarationViewWindow.cs:
+ Fix wrapping of completion documentation.
+ Remove redundant overload count.
+ Add arrow UI hint for selecting an overloaded method.
+
2004-11-23 Alp Toker <alp at atoker.com>
* CodeCompletion/CodeCompletionData.cs:
Modified: trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/CodeCompletion/CodeCompletionData.cs
===================================================================
--- trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/CodeCompletion/CodeCompletionData.cs 2004-11-23 21:59:46 UTC (rev 2033)
+++ trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/CodeCompletion/CodeCompletionData.cs 2004-11-23 23:54:38 UTC (rev 2034)
@@ -104,7 +104,7 @@
Console.WriteLine(e.ToString());
}
}
- return (description + (overloads > 0 ? " (+" + overloads + " overloads)" : String.Empty) + "\n" + documentation).Trim ();
+ return (description + "\n" + documentation).Trim ();
}
set {
description = value;
@@ -132,7 +132,7 @@
Console.WriteLine(e.ToString());
}
}
- return (pango_description + (overloads > 0 ? " (+" + overloads + " overloads)" : String.Empty) + "\n" + documentation).Trim ();
+ return (pango_description + "\n" + documentation).Trim ();
}
set {
description = value;
@@ -231,7 +231,7 @@
System.IO.StringReader reader = new System.IO.StringReader("<docroot>" + doc + "</docroot>");
XmlTextReader xml = new XmlTextReader(reader);
StringBuilder ret = new StringBuilder();
- Regex whitespace = new Regex(@"\s+");
+ Regex whitespace = new Regex(@"\s+", RegexOptions.Singleline);
try {
xml.Read();
@@ -270,15 +270,6 @@
Console.WriteLine ("DocBoom");
return doc;
}
- int i = 45;
- while (i < ret.Length) {
- while (ret[i] != ' ') {
- i++;
- if (i >= ret.Length) return ret.ToString ();
- }
- ret.Insert (i, '\n');
- i += 45;
- }
return ret.ToString ();
}
Modified: trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/CodeCompletion/CompletionListWindow.cs
===================================================================
--- trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/CodeCompletion/CompletionListWindow.cs 2004-11-23 21:59:46 UTC (rev 2033)
+++ trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/CodeCompletion/CompletionListWindow.cs 2004-11-23 23:54:38 UTC (rev 2034)
@@ -154,7 +154,9 @@
else
descMarkup = declarationviewwindow.DescriptionMarkup = data.Description;
- foreach (CodeCompletionData odata in ((CodeCompletionData) data).GetOverloads ()) {
+ CodeCompletionData ccdata = (CodeCompletionData) data;
+
+ foreach (CodeCompletionData odata in ccdata.GetOverloads ()) {
ICompletionDataWithMarkup odatawMarkup = odata as ICompletionDataWithMarkup;
descMarkup += "\n\n" + (odatawMarkup == null ? odata.Description : odatawMarkup.DescriptionPango);
}
@@ -169,6 +171,7 @@
declarationviewwindow.Move (this.Screen.Width+1, vert);
declarationviewwindow.ShowAll ();
+ declarationviewwindow.Multiple = (ccdata.Overloads != 0);
declarationviewwindow.GdkWindow.GetSize (out dvwWidth, out dvwHeight);
if (this.Screen.Width <= horiz + dvwWidth) {
Modified: trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/CodeCompletion/DeclarationViewWindow.cs
===================================================================
--- trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/CodeCompletion/DeclarationViewWindow.cs 2004-11-23 21:59:46 UTC (rev 2033)
+++ trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/CodeCompletion/DeclarationViewWindow.cs 2004-11-23 23:54:38 UTC (rev 2034)
@@ -16,24 +16,64 @@
{
public class DeclarationViewWindow : Window
{
- Label label;
+ static char[] newline = {'\n'};
+ static char[] whitespace = {' '};
+
+ Label headlabel, bodylabel;
+ Arrow left, right;
public string DescriptionMarkup
{
get {
- return label.Text;
+ return headlabel.Text + "\n" + bodylabel.Text;
}
set {
- label.Markup = value;
+ string[] parts = value.Split (newline, 2);
+ headlabel.Markup = parts[0].Trim (whitespace);
+ bodylabel.Markup = (parts.Length == 2 ? parts[1].Trim (whitespace) : String.Empty);
//QueueDraw ();
}
}
+
+ public bool Multiple
+ {
+ get {
+ return left.Visible;
+ }
+
+ set {
+ left.Visible = value;
+ right.Visible = value;
+ }
+ }
public DeclarationViewWindow () : base (WindowType.Popup)
{
+ headlabel = new Label ("");
+ headlabel.LineWrap = false;
+ headlabel.Xalign = 0;
+
+ bodylabel = new Label ("");
+ bodylabel.LineWrap = true;
+ bodylabel.Xalign = 0;
+
+ VBox vb = new VBox (false, 0);
+ vb.PackStart (headlabel, true, true, 0);
+ vb.PackStart (bodylabel, true, true, 0);
+
+ left = new Arrow (ArrowType.Left, ShadowType.None);
+ right = new Arrow (ArrowType.Right, ShadowType.None);
+
+ HBox hb = new HBox (false, 0);
+ hb.Spacing = 4;
+ hb.PackStart (left, false, true, 0);
+ hb.PackStart (vb, true, true, 0);
+ hb.PackStart (right, false, true, 0);
+
Frame frame = new Frame ();
- frame.Add (label = new Label (""));
+ frame.Add (hb);
+
this.Add (frame);
}
}
More information about the Monodevelop-patches-list
mailing list