[Monodevelop-patches-list] r649 - trunk/MonoDevelop/src/Libraries/MonoDevelop.Gui/IconView
commit-watcher at mono-cvs.ximian.com
commit-watcher at mono-cvs.ximian.com
Sun Jan 25 12:13:39 EST 2004
Author: benm
Date: 2004-01-25 12:13:39 -0500 (Sun, 25 Jan 2004)
New Revision: 649
Modified:
trunk/MonoDevelop/src/Libraries/MonoDevelop.Gui/IconView/IconView.cs
Log:
treat enter like double click in the iconlist
Modified: trunk/MonoDevelop/src/Libraries/MonoDevelop.Gui/IconView/IconView.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/MonoDevelop.Gui/IconView/IconView.cs 2004-01-25 12:36:14 UTC (rev 648)
+++ trunk/MonoDevelop/src/Libraries/MonoDevelop.Gui/IconView/IconView.cs 2004-01-25 17:13:39 UTC (rev 649)
@@ -20,6 +20,7 @@
{
iconList = new IconList (100, null, 0);
iconList.IconSelected += new IconSelectedHandler (HandleIconSelected);
+ iconList.KeyPressEvent += new KeyPressEventHandler (HandleKeyPressed);
this.Add (iconList);
this.WidthRequest = 350;
@@ -32,16 +33,25 @@
userData.Add (itm, obj);
}
+ void HandleKeyPressed (object o, KeyPressEventArgs args)
+ {
+ if (CurrentlySelected == null)
+ return;
+
+ if (args.Event.Key == Gdk.Key.Return && IconDoubleClicked != null)
+ IconDoubleClicked (this, EventArgs.Empty);
+ }
+
void HandleIconSelected (object o, IconSelectedArgs args)
{
CurrentlySelected = userData [args.Num];
if (IconSelected != null)
- IconSelected (this, new EventArgs ());
+ IconSelected (this, EventArgs.Empty);
if (args.Event != null && args.Event.Type == Gdk.EventType.TwoButtonPress)
if (IconDoubleClicked != null)
- IconDoubleClicked (this, new EventArgs ());
+ IconDoubleClicked (this, EventArgs.Empty);
}
public void Clear ()
More information about the Monodevelop-patches-list
mailing list