[mapguide-commits] r4765 - trunk/Tools/Maestro/Maestro/ResourceEditors

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Wed Apr 7 23:24:16 EDT 2010


Author: jng
Date: 2010-04-07 23:24:16 -0400 (Wed, 07 Apr 2010)
New Revision: 4765

Modified:
   trunk/Tools/Maestro/Maestro/ResourceEditors/MapEditor.cs
Log:
Fix #1311: Route the double click event handlers to open a layer editor for the selected item if the selected item is a layer resource.

Modified: trunk/Tools/Maestro/Maestro/ResourceEditors/MapEditor.cs
===================================================================
--- trunk/Tools/Maestro/Maestro/ResourceEditors/MapEditor.cs	2010-04-08 02:48:10 UTC (rev 4764)
+++ trunk/Tools/Maestro/Maestro/ResourceEditors/MapEditor.cs	2010-04-08 03:24:16 UTC (rev 4765)
@@ -704,6 +704,7 @@
             resources.ApplyResources(this.trvLayerGroups, "trvLayerGroups");
             this.trvLayerGroups.ImageList = this.TreeImages;
             this.trvLayerGroups.Name = "trvLayerGroups";
+            this.trvLayerGroups.NodeMouseDoubleClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.trvLayerGroups_NodeMouseDoubleClick);
             this.trvLayerGroups.DragDrop += new System.Windows.Forms.DragEventHandler(this.trvLayerGroups_DragDrop);
             this.trvLayerGroups.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.trvLayerGroups_AfterSelect);
             this.trvLayerGroups.DragEnter += new System.Windows.Forms.DragEventHandler(this.trvLayerGroups_DragEnter);
@@ -833,6 +834,7 @@
             this.lstDrawOrder.SmallImageList = this.TreeImages;
             this.lstDrawOrder.UseCompatibleStateImageBehavior = false;
             this.lstDrawOrder.View = System.Windows.Forms.View.Details;
+            this.lstDrawOrder.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.lstDrawOrder_MouseDoubleClick);
             this.lstDrawOrder.SelectedIndexChanged += new System.EventHandler(this.lstDrawOrder_SelectedIndexChanged);
             this.lstDrawOrder.SizeChanged += new System.EventHandler(this.lstDrawOrder_SizeChanged);
             // 
@@ -917,6 +919,7 @@
             this.trvBaseLayerGroups.HideSelection = false;
             this.trvBaseLayerGroups.ImageList = this.TreeImages;
             this.trvBaseLayerGroups.Name = "trvBaseLayerGroups";
+            this.trvBaseLayerGroups.NodeMouseDoubleClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.trvBaseLayerGroups_NodeMouseDoubleClick);
             this.trvBaseLayerGroups.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.trvBaseLayerGroups_AfterSelect);
             // 
             // BaseLayerGroupToolStrip
@@ -2383,5 +2386,41 @@
         {
             MoveSelectedLayers(false, true);
         }
+
+        private void trvLayerGroups_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e)
+        {
+            var layer = e.Node.Tag as OSGeo.MapGuide.MaestroAPI.MapLayerType;
+            if (layer != null)
+            {
+                OnLayerDoubleClicked(layer.ResourceId);
+            }
+        }
+
+        private void lstDrawOrder_MouseDoubleClick(object sender, MouseEventArgs e)
+        {
+            if (lstDrawOrder.SelectedItems.Count > 0)
+            {
+                var item = lstDrawOrder.SelectedItems[0];
+                var layer = item.Tag as OSGeo.MapGuide.MaestroAPI.MapLayerType;
+                if (layer != null)
+                {
+                    OnLayerDoubleClicked(layer.ResourceId);
+                }
+            }
+        }
+
+        private void OnLayerDoubleClicked(string layerId)
+        {
+            m_editor.EditItem(layerId);
+        }
+
+        private void trvBaseLayerGroups_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e)
+        {
+            var layer = e.Node.Tag as OSGeo.MapGuide.MaestroAPI.BaseMapLayerType;
+            if (layer != null)
+            {
+                OnLayerDoubleClicked(layer.ResourceId);
+            }
+        }
     }
 }



More information about the mapguide-commits mailing list