[Monodevelop-patches-list] r1519 - in trunk/MonoDevelop/src/Main/Base: . Gui/Pads/ClassScout Gui/Pads/ProjectBrowser
commit-watcher at mono-cvs.ximian.com
commit-watcher at mono-cvs.ximian.com
Tue Apr 27 00:10:39 EDT 2004
Author: jluke
Date: 2004-04-27 00:10:39 -0400 (Tue, 27 Apr 2004)
New Revision: 1519
Modified:
trunk/MonoDevelop/src/Main/Base/ChangeLog
trunk/MonoDevelop/src/Main/Base/Gui/Pads/ClassScout/ClassScout.cs
trunk/MonoDevelop/src/Main/Base/Gui/Pads/ProjectBrowser/ProjectBrowserView.cs
Log:
implement PopupMenu
Modified: trunk/MonoDevelop/src/Main/Base/ChangeLog
===================================================================
--- trunk/MonoDevelop/src/Main/Base/ChangeLog 2004-04-27 02:53:40 UTC (rev 1518)
+++ trunk/MonoDevelop/src/Main/Base/ChangeLog 2004-04-27 04:10:39 UTC (rev 1519)
@@ -1,7 +1,9 @@
2004-04-25 John Luke <jluke at cfl.rr.com>
* Gui/Dialogs/WordCountDialog.cs: use ShadowType.in
- * Gui/Pads/ClassScout.cs: implement redraw so its updated
+ * Gui/Pads/ClassScout/ClassScout.cs:
+ * Gui/Pads/ProjectBrowser/ProjectBrowserView.cs:
+ implement PopupMenu to show ContextMenus
2004-04-25 Pawel Rozanski <tokugawa at afn.no-ip.org>
Modified: trunk/MonoDevelop/src/Main/Base/Gui/Pads/ClassScout/ClassScout.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Gui/Pads/ClassScout/ClassScout.cs 2004-04-27 02:53:40 UTC (rev 1518)
+++ trunk/MonoDevelop/src/Main/Base/Gui/Pads/ClassScout/ClassScout.cs 2004-04-27 04:10:39 UTC (rev 1519)
@@ -19,9 +19,7 @@
using MonoDevelop.Core.AddIns;
using MonoDevelop.Core.Properties;
-
using MonoDevelop.Internal.Project;
-
using MonoDevelop.Core.Services;
using MonoDevelop.Services;
using MonoDevelop.Gui.Widgets;
@@ -122,6 +120,7 @@
ambienceService.AmbienceChanged += new EventHandler(AmbienceChangedEvent);
RowActivated += new Gtk.RowActivatedHandler(OnNodeActivated);
+ PopupMenu += OnPopupMenu;
contentPanel.ButtonReleaseEvent += new Gtk.ButtonReleaseEventHandler(OnButtonRelease);
}
@@ -134,7 +133,7 @@
public void RedrawContent()
{
- this.QueueDraw ();
+ Console.WriteLine ("redraw");
}
void OnCombineOpen(object sender, CombineEventArgs e)
@@ -216,18 +215,27 @@
*/
private void OnButtonRelease(object sender, Gtk.ButtonReleaseEventArgs args)
{
- //if (e.Button == MouseButtons.Right && SelectedNode != null && SelectedNode is AbstractClassScoutNode) {
if (args.Event.Button == 3 && SelectedNode != null && SelectedNode is AbstractClassScoutNode) {
- AbstractClassScoutNode selectedBrowserNode = (AbstractClassScoutNode)SelectedNode;
- if (selectedBrowserNode.ContextmenuAddinTreePath != null && selectedBrowserNode.ContextmenuAddinTreePath.Length > 0) {
- MenuService menuService = (MenuService)MonoDevelop.Core.Services.ServiceManager.Services.GetService(typeof(MenuService));
- menuService.ShowContextMenu(this, selectedBrowserNode.ContextmenuAddinTreePath, this);
- }
+ ShowPopup ();
}
+ }
- //base.OnMouseUp(e);
+ void OnPopupMenu (object o, Gtk.PopupMenuArgs args)
+ {
+ if (SelectedNode != null && SelectedNode is AbstractClassScoutNode) {
+ ShowPopup ();
+ }
}
+ void ShowPopup ()
+ {
+ AbstractClassScoutNode selectedBrowserNode = (AbstractClassScoutNode) SelectedNode;
+ if (selectedBrowserNode.ContextmenuAddinTreePath != null && selectedBrowserNode.ContextmenuAddinTreePath.Length > 0) {
+ MenuService menuService = (MenuService) MonoDevelop.Core.Services.ServiceManager.Services.GetService (typeof (MenuService));
+ menuService.ShowContextMenu(this, selectedBrowserNode.ContextmenuAddinTreePath, this);
+ }
+ }
+
protected virtual void OnTitleChanged(EventArgs e)
{
if (TitleChanged != null) {
@@ -387,3 +395,4 @@
}
}
}
+
Modified: trunk/MonoDevelop/src/Main/Base/Gui/Pads/ProjectBrowser/ProjectBrowserView.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Gui/Pads/ProjectBrowser/ProjectBrowserView.cs 2004-04-27 02:53:40 UTC (rev 1518)
+++ trunk/MonoDevelop/src/Main/Base/Gui/Pads/ProjectBrowser/ProjectBrowserView.cs 2004-04-27 04:10:39 UTC (rev 1519)
@@ -81,6 +81,7 @@
//projectBrowserImageList = new ImageList();
//projectBrowserImageList.ColorDepth = ColorDepth.Depth32Bit;
}
+
public ProjectBrowserView() : base (true, TreeNodeComparer.GtkProjectNode)
{
//LabelEdit = true;
@@ -110,6 +111,7 @@
contentPanel.Add(sw);
RowActivated += new Gtk.RowActivatedHandler(OnNodeActivated);
contentPanel.ButtonReleaseEvent += new Gtk.ButtonReleaseEventHandler(OnButtonRelease);
+ contentPanel.PopupMenu += OnPopupMenu;
}
void TrackPropertyChange (object o, MonoDevelop.Core.Properties.PropertyEventArgs e)
@@ -336,22 +338,29 @@
return true;
}
*/
- private void OnButtonRelease(object sender, Gtk.ButtonReleaseEventArgs args)
+ void ShowPopup ()
{
- if (args.Event.Button != 3 || SelectedNode == null) {
- return;
- }
AbstractBrowserNode node = (AbstractBrowserNode) SelectedNode;
-
IProjectService projectService = (IProjectService)MonoDevelop.Core.Services.ServiceManager.Services.GetService(typeof(IProjectService));
-
projectService.CurrentSelectedProject = node.Project;
projectService.CurrentSelectedCombine = node.Combine;
- //PropertyPad.SetDesignableObject(node.UserData);
-
MenuService menuService = (MenuService)MonoDevelop.Core.Services.ServiceManager.Services.GetService(typeof(MenuService));
menuService.ShowContextMenu(this, node.ContextmenuAddinTreePath, this);
+
}
+
+ void OnPopupMenu (object o, Gtk.PopupMenuArgs args)
+ {
+ if (SelectedNode != null)
+ ShowPopup ();
+ }
+
+ private void OnButtonRelease(object sender, Gtk.ButtonReleaseEventArgs args)
+ {
+ if (args.Event.Button == 3 && SelectedNode != null) {
+ ShowPopup ();
+ }
+ }
/*
protected override void OnAfterSelect(TreeViewEventArgs e)
{ // set current project & current combine
More information about the Monodevelop-patches-list
mailing list