[Monodevelop-patches-list] r495 - trunk/MonoDevelop/src/Libraries/ICSharpCode.TextEditor/src/Gui/CompletionWindow
commit-watcher at mono-cvs.ximian.com
commit-watcher at mono-cvs.ximian.com
Fri Jan 16 00:30:55 EST 2004
Author: benm
Date: 2004-01-16 00:30:55 -0500 (Fri, 16 Jan 2004)
New Revision: 495
Modified:
trunk/MonoDevelop/src/Libraries/ICSharpCode.TextEditor/src/Gui/CompletionWindow/CompletionWindow.cs
trunk/MonoDevelop/src/Libraries/ICSharpCode.TextEditor/src/Gui/CompletionWindow/DeclarationViewWindow.cs
Log:
initial try at tooltips
Modified: trunk/MonoDevelop/src/Libraries/ICSharpCode.TextEditor/src/Gui/CompletionWindow/CompletionWindow.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/ICSharpCode.TextEditor/src/Gui/CompletionWindow/CompletionWindow.cs 2004-01-16 05:17:44 UTC (rev 494)
+++ trunk/MonoDevelop/src/Libraries/ICSharpCode.TextEditor/src/Gui/CompletionWindow/CompletionWindow.cs 2004-01-16 05:30:55 UTC (rev 495)
@@ -184,7 +184,8 @@
listView.KeyReleaseEvent += new KeyReleaseEventHandler(ListKeyreleaseEvent);
listView.FocusOutEvent += new FocusOutEventHandler(LostFocusListView);
listView.RowActivated += new RowActivatedHandler(ActivateItem);
- listView.AddEvents ((int) (Gdk.EventMask.KeyPressMask));
+ listView.AddEvents ((int) (Gdk.EventMask.KeyPressMask));
+ listView.Selection.Changed += new EventHandler (RowActivated);
//listView.SelectedIndexChanged += new EventHandler(SelectedIndexChanged);
/*
@@ -264,7 +265,7 @@
void LostFocusListView(object sender, FocusOutEventArgs e)
{
control.HasFocus = true;
- declarationviewwindow.Hide();
+ declarationviewwindow.HideAll ();
Hide();
}
@@ -280,6 +281,19 @@
}
// sort here
store.SetSortColumnId (0, SortType.Ascending);
+ }
+
+ void RowActivated (object sender, EventArgs a)
+ {
+ Gtk.TreeIter iter;
+ Gtk.TreeModel model;
+
+ if (listView.Selection.GetSelected (out model, out iter)){
+ ICompletionData data = (ICompletionData) store.GetValue (iter, 2);
+ Console.WriteLine (data.Description);
+ declarationviewwindow.Description = data.Description;
+ declarationviewwindow.ShowAll ();
+ }
}
}
}
Modified: trunk/MonoDevelop/src/Libraries/ICSharpCode.TextEditor/src/Gui/CompletionWindow/DeclarationViewWindow.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/ICSharpCode.TextEditor/src/Gui/CompletionWindow/DeclarationViewWindow.cs 2004-01-16 05:17:44 UTC (rev 494)
+++ trunk/MonoDevelop/src/Libraries/ICSharpCode.TextEditor/src/Gui/CompletionWindow/DeclarationViewWindow.cs 2004-01-16 05:30:55 UTC (rev 495)
@@ -12,61 +12,35 @@
using ICSharpCode.TextEditor.Document;
using ICSharpCode.TextEditor.Util;
-using ICSharpCode.TextEditor;
+using ICSharpCode.TextEditor;
+
+using Gtk;
+using GtkSharp;
namespace ICSharpCode.TextEditor.Gui.CompletionWindow
{
- public class DeclarationViewWindow : Gtk.Widget
+ public class DeclarationViewWindow : Gtk.Window
{
- static GLib.GType type;
- string description = String.Empty;
+ string description = "";
+
+ Label label;
public string Description {
get {
- return description;
- }
+ return label.Text;
+ }
+
set {
- description = value;
- if (Visible) {
- QueueDraw ();
- }
+ label.Text = value;
+ QueueDraw ();
}
}
-
- static DeclarationViewWindow ()
+
+ public DeclarationViewWindow () : base (WindowType.Popup)
{
- type = RegisterGType (typeof (DeclarationViewWindow));
+ BorderWidth = 4;
+
+ Add (label = new Label (description));
}
-
- public DeclarationViewWindow() : base (type)
- {
-#if !GTK
- StartPosition = FormStartPosition.Manual;
- FormBorderStyle = FormBorderStyle.None;
- TopMost = true;
- ShowInTaskbar = false;
-
-// Enabled = false;
- Size = new Size(0, 0);
-
- SetStyle(ControlStyles.UserPaint, true);
- SetStyle(ControlStyles.DoubleBuffer, true);
-#endif
- }
-
-#if !GTK
- protected override void OnPaint(PaintEventArgs pe)
- {
- TipPainterTools.DrawHelpTipFromCombinedDescription
- (this, pe.Graphics, Font, null, description);
- }
-
- protected override void OnPaintBackground(PaintEventArgs pe)
- {
- if (description != null && description.Length > 0) {
- pe.Graphics.FillRectangle(SystemBrushes.Info, pe.ClipRectangle);
- }
- }
-#endif
}
}
More information about the Monodevelop-patches-list
mailing list