[mapguide-commits] r6993 - in trunk/Tools/Maestro: Maestro.Base/Editor Maestro.Editors Maestro.Editors/Generic

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Mon Sep 10 04:45:27 PDT 2012


Author: jng
Date: 2012-09-10 04:45:26 -0700 (Mon, 10 Sep 2012)
New Revision: 6993

Added:
   trunk/Tools/Maestro/Maestro.Editors/Generic/XmlTextEditorControl.cs
Modified:
   trunk/Tools/Maestro/Maestro.Base/Editor/EditorContentBase.cs
   trunk/Tools/Maestro/Maestro.Base/Editor/XmlEditor.resx
   trunk/Tools/Maestro/Maestro.Editors/Generic/XmlEditorCtrl.Designer.cs
   trunk/Tools/Maestro/Maestro.Editors/Generic/XmlEditorCtrl.cs
   trunk/Tools/Maestro/Maestro.Editors/Generic/XmlEditorCtrl.resx
   trunk/Tools/Maestro/Maestro.Editors/Maestro.Editors.csproj
Log:
#2108:
 - Add context menu for common operations (cut/copy/paste/find/find and replace)
 - Add keybindings for find and (find/replace). For this to work, we had to add a new class that extends ICSharpCode.TextEditor to expose a method to add new actions to its editactions dictionary. The existing XmlEditorCtrl has been modified to use this derived class instead.

Modified: trunk/Tools/Maestro/Maestro.Base/Editor/EditorContentBase.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/Editor/EditorContentBase.cs	2012-09-10 02:39:41 UTC (rev 6992)
+++ trunk/Tools/Maestro/Maestro.Base/Editor/EditorContentBase.cs	2012-09-10 11:45:26 UTC (rev 6993)
@@ -51,10 +51,12 @@
             private set { upgradePanel.Visible = value; }
         }
 
+        [DefaultValue(false)]
+        [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
         public bool RequiresReload
         {
             get { return sessionRestartPanel.Visible; }
-            set { sessionRestartPanel.Visible = true; }
+            set { sessionRestartPanel.Visible = value; }
         }
 
         private IEditorService _svc;

Modified: trunk/Tools/Maestro/Maestro.Base/Editor/XmlEditor.resx
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/Editor/XmlEditor.resx	2012-09-10 02:39:41 UTC (rev 6992)
+++ trunk/Tools/Maestro/Maestro.Base/Editor/XmlEditor.resx	2012-09-10 11:45:26 UTC (rev 6993)
@@ -112,23 +112,23 @@
     <value>2.0</value>
   </resheader>
   <resheader name="reader">
-    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </resheader>
   <resheader name="writer">
-    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </resheader>
-  <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+  <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
   <data name="editor.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
     <value>Fill</value>
   </data>
-  <assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+  <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
   <data name="editor.Location" type="System.Drawing.Point, System.Drawing">
     <value>0, 0</value>
   </data>
   <data name="editor.Size" type="System.Drawing.Size, System.Drawing">
-    <value>584, 425</value>
+    <value>584, 386</value>
   </data>
-  <assembly alias="mscorlib" name="mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+  <assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
   <data name="editor.TabIndex" type="System.Int32, mscorlib">
     <value>0</value>
   </data>
@@ -136,7 +136,7 @@
     <value>editor</value>
   </data>
   <data name=">>editor.Type" xml:space="preserve">
-    <value>Maestro.Editors.Generic.XmlEditorCtrl, Maestro.Editors, Version=3.0.0.5334, Culture=neutral, PublicKeyToken=null</value>
+    <value>Maestro.Editors.Generic.XmlEditorCtrl, Maestro.Editors, Version=5.0.0.6640, Culture=neutral, PublicKeyToken=f526c48929fda856</value>
   </data>
   <data name=">>editor.Parent" xml:space="preserve">
     <value>panelBody</value>
@@ -145,13 +145,13 @@
     <value>0</value>
   </data>
   <data name="panelBody.Size" type="System.Drawing.Size, System.Drawing">
-    <value>584, 425</value>
+    <value>584, 386</value>
   </data>
   <data name=">>panelBody.Name" xml:space="preserve">
     <value>panelBody</value>
   </data>
   <data name=">>panelBody.Type" xml:space="preserve">
-    <value>System.Windows.Forms.Panel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+    <value>System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </data>
   <data name=">>panelBody.Parent" xml:space="preserve">
     <value>$this</value>
@@ -159,7 +159,7 @@
   <data name=">>panelBody.ZOrder" xml:space="preserve">
     <value>0</value>
   </data>
-  <metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+  <metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
   <data name="$this.Size" type="System.Drawing.Size, System.Drawing">
@@ -169,6 +169,6 @@
     <value>XmlEditor</value>
   </data>
   <data name=">>$this.Type" xml:space="preserve">
-    <value>Maestro.Base.Editor.EditorContentBase, Maestro.Base, Version=3.0.0.5334, Culture=neutral, PublicKeyToken=null</value>
+    <value>Maestro.Base.Editor.EditorContentBase, Maestro.Base, Version=5.0.0.6640, Culture=neutral, PublicKeyToken=f526c48929fda856</value>
   </data>
 </root>
\ No newline at end of file

Modified: trunk/Tools/Maestro/Maestro.Editors/Generic/XmlEditorCtrl.Designer.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Generic/XmlEditorCtrl.Designer.cs	2012-09-10 02:39:41 UTC (rev 6992)
+++ trunk/Tools/Maestro/Maestro.Editors/Generic/XmlEditorCtrl.Designer.cs	2012-09-10 11:45:26 UTC (rev 6993)
@@ -28,6 +28,7 @@
         /// </summary>
         private void InitializeComponent()
         {
+            this.components = new System.ComponentModel.Container();
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(XmlEditorCtrl));
             this.toolStrip1 = new System.Windows.Forms.ToolStrip();
             this.btnUndo = new System.Windows.Forms.ToolStripButton();
@@ -44,8 +45,16 @@
             this.btnFindAndReplace = new System.Windows.Forms.ToolStripButton();
             this.resDataCtrl = new Maestro.Editors.Generic.ResourceDataPanel();
             this.nodeNumericUpDown1 = new Aga.Controls.Tree.NodeControls.NodeNumericUpDown();
-            this.txtXmlContent = new ICSharpCode.TextEditor.TextEditorControl();
+            this.txtXmlContent = new XmlTextEditorControl();
+            this.ctxXmlEditor = new System.Windows.Forms.ContextMenuStrip(this.components);
+            this.cutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+            this.copyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+            this.pasteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+            this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator();
+            this.findToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+            this.findReplaceToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
             this.toolStrip1.SuspendLayout();
+            this.ctxXmlEditor.SuspendLayout();
             this.SuspendLayout();
             // 
             // toolStrip1
@@ -181,10 +190,58 @@
             // 
             // txtXmlContent
             // 
+            this.txtXmlContent.ContextMenuStrip = this.ctxXmlEditor;
             resources.ApplyResources(this.txtXmlContent, "txtXmlContent");
             this.txtXmlContent.IsReadOnly = false;
             this.txtXmlContent.Name = "txtXmlContent";
             // 
+            // ctxXmlEditor
+            // 
+            this.ctxXmlEditor.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+            this.cutToolStripMenuItem,
+            this.copyToolStripMenuItem,
+            this.pasteToolStripMenuItem,
+            this.toolStripSeparator4,
+            this.findToolStripMenuItem,
+            this.findReplaceToolStripMenuItem});
+            this.ctxXmlEditor.Name = "ctxXmlEditor";
+            resources.ApplyResources(this.ctxXmlEditor, "ctxXmlEditor");
+            // 
+            // cutToolStripMenuItem
+            // 
+            this.cutToolStripMenuItem.Name = "cutToolStripMenuItem";
+            resources.ApplyResources(this.cutToolStripMenuItem, "cutToolStripMenuItem");
+            this.cutToolStripMenuItem.Click += new System.EventHandler(this.cutToolStripMenuItem_Click);
+            // 
+            // copyToolStripMenuItem
+            // 
+            this.copyToolStripMenuItem.Name = "copyToolStripMenuItem";
+            resources.ApplyResources(this.copyToolStripMenuItem, "copyToolStripMenuItem");
+            this.copyToolStripMenuItem.Click += new System.EventHandler(this.copyToolStripMenuItem_Click);
+            // 
+            // pasteToolStripMenuItem
+            // 
+            this.pasteToolStripMenuItem.Name = "pasteToolStripMenuItem";
+            resources.ApplyResources(this.pasteToolStripMenuItem, "pasteToolStripMenuItem");
+            this.pasteToolStripMenuItem.Click += new System.EventHandler(this.pasteToolStripMenuItem_Click);
+            // 
+            // toolStripSeparator4
+            // 
+            this.toolStripSeparator4.Name = "toolStripSeparator4";
+            resources.ApplyResources(this.toolStripSeparator4, "toolStripSeparator4");
+            // 
+            // findToolStripMenuItem
+            // 
+            this.findToolStripMenuItem.Name = "findToolStripMenuItem";
+            resources.ApplyResources(this.findToolStripMenuItem, "findToolStripMenuItem");
+            this.findToolStripMenuItem.Click += new System.EventHandler(this.findToolStripMenuItem_Click);
+            // 
+            // findReplaceToolStripMenuItem
+            // 
+            this.findReplaceToolStripMenuItem.Name = "findReplaceToolStripMenuItem";
+            resources.ApplyResources(this.findReplaceToolStripMenuItem, "findReplaceToolStripMenuItem");
+            this.findReplaceToolStripMenuItem.Click += new System.EventHandler(this.findReplaceToolStripMenuItem_Click);
+            // 
             // XmlEditorCtrl
             // 
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
@@ -195,6 +252,7 @@
             resources.ApplyResources(this, "$this");
             this.toolStrip1.ResumeLayout(false);
             this.toolStrip1.PerformLayout();
+            this.ctxXmlEditor.ResumeLayout(false);
             this.ResumeLayout(false);
             this.PerformLayout();
 
@@ -205,7 +263,7 @@
 
         private System.Windows.Forms.ToolStrip toolStrip1;
         private ResourceDataPanel resDataCtrl;
-        private ICSharpCode.TextEditor.TextEditorControl txtXmlContent;
+        private XmlTextEditorControl txtXmlContent;
         private System.Windows.Forms.ToolStripButton btnCopy;
         private System.Windows.Forms.ToolStripButton btnCut;
         private System.Windows.Forms.ToolStripButton btnPaste;
@@ -218,5 +276,12 @@
         private System.Windows.Forms.ToolStripButton btnFormat;
         private System.Windows.Forms.ToolStripButton btnFind;
         private System.Windows.Forms.ToolStripButton btnFindAndReplace;
+        private System.Windows.Forms.ContextMenuStrip ctxXmlEditor;
+        private System.Windows.Forms.ToolStripMenuItem cutToolStripMenuItem;
+        private System.Windows.Forms.ToolStripMenuItem copyToolStripMenuItem;
+        private System.Windows.Forms.ToolStripMenuItem pasteToolStripMenuItem;
+        private System.Windows.Forms.ToolStripSeparator toolStripSeparator4;
+        private System.Windows.Forms.ToolStripMenuItem findToolStripMenuItem;
+        private System.Windows.Forms.ToolStripMenuItem findReplaceToolStripMenuItem;
     }
 }

Modified: trunk/Tools/Maestro/Maestro.Editors/Generic/XmlEditorCtrl.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Generic/XmlEditorCtrl.cs	2012-09-10 02:39:41 UTC (rev 6992)
+++ trunk/Tools/Maestro/Maestro.Editors/Generic/XmlEditorCtrl.cs	2012-09-10 11:45:26 UTC (rev 6993)
@@ -33,6 +33,7 @@
 using OSGeo.MapGuide.MaestroAPI.Exceptions;
 using OSGeo.MapGuide.MaestroAPI.Resource;
 using OSGeo.MapGuide.ObjectModels;
+using ICSharpCode.TextEditor.Actions;
 
 namespace Maestro.Editors.Generic
 {
@@ -49,6 +50,33 @@
     /// </summary>
     public partial class XmlEditorCtrl : EditorBase, INotifyResourceChanged
     {
+        class FindAction : AbstractEditAction
+        {
+            private XmlEditorCtrl _parent;
+
+            public FindAction(XmlEditorCtrl parent)
+            {
+                _parent = parent;
+            }
+
+            public override void Execute(ICSharpCode.TextEditor.TextArea textArea)
+            {
+                _parent.DoFind();
+            }
+        }
+
+        class FindAndReplaceAction : AbstractEditAction
+        {
+            private XmlEditorCtrl _parent;
+
+            public FindAndReplaceAction(XmlEditorCtrl parent) { _parent = parent; }
+
+            public override void Execute(ICSharpCode.TextEditor.TextArea textArea)
+            {
+                _parent.DoFindReplace();
+            }
+        }
+
         private bool _ready = false;
 
         /// <summary>
@@ -57,6 +85,8 @@
         public XmlEditorCtrl()
         {
             InitializeComponent();
+            txtXmlContent.RegisterAction(Keys.Control | Keys.F, new FindAction(this));
+            txtXmlContent.RegisterAction(Keys.Control | Keys.H, new FindAndReplaceAction(this));
             txtXmlContent.SetHighlighting("XML");
             txtXmlContent.EnableFolding = true;
             txtXmlContent.ShowInvalidLines = true;
@@ -136,9 +166,9 @@
         private void EvaluateCommands()
         {
             btnUndo.Enabled = txtXmlContent.EnableUndo;
-            btnCut.Enabled = txtXmlContent.ActiveTextAreaControl.TextArea.ClipboardHandler.EnableCut;
-            btnCopy.Enabled = txtXmlContent.ActiveTextAreaControl.TextArea.ClipboardHandler.EnableCopy;
-            btnPaste.Enabled = Clipboard.ContainsText();
+            cutToolStripMenuItem.Enabled = btnCut.Enabled = txtXmlContent.ActiveTextAreaControl.TextArea.ClipboardHandler.EnableCut;
+            copyToolStripMenuItem.Enabled = btnCopy.Enabled = txtXmlContent.ActiveTextAreaControl.TextArea.ClipboardHandler.EnableCopy;
+            pasteToolStripMenuItem.Enabled = btnPaste.Enabled = Clipboard.ContainsText();
             btnValidate.Enabled = (this.Validator != null);
         }
 
@@ -306,6 +336,11 @@
 
         private void btnFind_Click(object sender, EventArgs e)
         {
+            DoFind();
+        }
+
+        private void DoFind()
+        {
             var editor = txtXmlContent;
             if (editor == null) return;
             _findForm.ShowFor(editor, false);
@@ -313,6 +348,11 @@
 
         private void btnFindAndReplace_Click(object sender, EventArgs e)
         {
+            DoFindReplace();
+        }
+
+        private void DoFindReplace()
+        {
             var editor = txtXmlContent;
             if (editor == null) return;
             _findForm.ShowFor(editor, true);
@@ -323,69 +363,94 @@
             _findForm.ShowFor(txtXmlContent, true, false); //This is just to initialize it just in case
             _findForm.FindAndReplace(find, replace);
         }
+
+        private void cutToolStripMenuItem_Click(object sender, EventArgs e)
+        {
+            txtXmlContent.ActiveTextAreaControl.TextArea.ClipboardHandler.Cut(this, EventArgs.Empty);
+        }
+
+        private void copyToolStripMenuItem_Click(object sender, EventArgs e)
+        {
+            txtXmlContent.ActiveTextAreaControl.TextArea.ClipboardHandler.Copy(this, EventArgs.Empty);
+        }
+
+        private void pasteToolStripMenuItem_Click(object sender, EventArgs e)
+        {
+            txtXmlContent.ActiveTextAreaControl.TextArea.ClipboardHandler.Paste(this, EventArgs.Empty);
+        }
+
+        private void findToolStripMenuItem_Click(object sender, EventArgs e)
+        {
+            DoFind();
+        }
+
+        private void findReplaceToolStripMenuItem_Click(object sender, EventArgs e)
+        {
+            DoFindReplace();
+        }
     }
     
-	/// <summary>
-	/// Holds information about the start of a fold in an xml string.
-	/// </summary>
-	internal class XmlFoldStart
-	{
-		int line = 0;
-		int col = 0;
-		string prefix = String.Empty;
-		string name = String.Empty;
-		string foldText = String.Empty;
-		
-		public XmlFoldStart(string prefix, string name, int line, int col)
-		{
-			this.line = line;
-			this.col = col;
-			this.prefix = prefix;
-			this.name = name;
-		}
-		
-		/// <summary>
-		/// The line where the fold should start.  Lines start from 0.
-		/// </summary>
-		public int Line {
-			get {
-				return line;
-			}
-		}
-		
-		/// <summary>
-		/// The column where the fold should start.  Columns start from 0.
-		/// </summary>
-		public int Column {
-			get {
-				return col;
-			}
-		}	
-		
-		/// <summary>
-		/// The name of the xml item with its prefix if it has one.
-		/// </summary>
-		public string Name {
-			get {
-				if (prefix.Length > 0) {
-					return String.Concat(prefix, ":", name);
-				} else {
-					return name;
-				}
-			}
-		}
-		
-		/// <summary>
-		/// The text to be displayed when the item is folded.
-		/// </summary>
-		public string FoldText {
-			get {
-				return foldText;
-			}
-			
-			set {
-				foldText = value;
-			}
-		}
-	}
+    /// <summary>
+    /// Holds information about the start of a fold in an xml string.
+    /// </summary>
+    internal class XmlFoldStart
+    {
+        int line = 0;
+        int col = 0;
+        string prefix = String.Empty;
+        string name = String.Empty;
+        string foldText = String.Empty;
+        
+        public XmlFoldStart(string prefix, string name, int line, int col)
+        {
+            this.line = line;
+            this.col = col;
+            this.prefix = prefix;
+            this.name = name;
+        }
+        
+        /// <summary>
+        /// The line where the fold should start.  Lines start from 0.
+        /// </summary>
+        public int Line {
+            get {
+                return line;
+            }
+        }
+        
+        /// <summary>
+        /// The column where the fold should start.  Columns start from 0.
+        /// </summary>
+        public int Column {
+            get {
+                return col;
+            }
+        }	
+        
+        /// <summary>
+        /// The name of the xml item with its prefix if it has one.
+        /// </summary>
+        public string Name {
+            get {
+                if (prefix.Length > 0) {
+                    return String.Concat(prefix, ":", name);
+                } else {
+                    return name;
+                }
+            }
+        }
+        
+        /// <summary>
+        /// The text to be displayed when the item is folded.
+        /// </summary>
+        public string FoldText {
+            get {
+                return foldText;
+            }
+            
+            set {
+                foldText = value;
+            }
+        }
+    }
 }

Modified: trunk/Tools/Maestro/Maestro.Editors/Generic/XmlEditorCtrl.resx
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Generic/XmlEditorCtrl.resx	2012-09-10 02:39:41 UTC (rev 6992)
+++ trunk/Tools/Maestro/Maestro.Editors/Generic/XmlEditorCtrl.resx	2012-09-10 11:45:26 UTC (rev 6993)
@@ -228,7 +228,7 @@
     <value>$this</value>
   </data>
   <data name=">>toolStrip1.ZOrder" xml:space="preserve">
-    <value>2</value>
+    <value>3</value>
   </data>
   <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
   <data name="resDataCtrl.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
@@ -256,8 +256,53 @@
     <value>$this</value>
   </data>
   <data name=">>resDataCtrl.ZOrder" xml:space="preserve">
-    <value>1</value>
+    <value>2</value>
   </data>
+  <metadata name="ctxXmlEditor.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>105, 0</value>
+  </metadata>
+  <data name="cutToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
+    <value>152, 22</value>
+  </data>
+  <data name="cutToolStripMenuItem.Text" xml:space="preserve">
+    <value>Cut</value>
+  </data>
+  <data name="copyToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
+    <value>152, 22</value>
+  </data>
+  <data name="copyToolStripMenuItem.Text" xml:space="preserve">
+    <value>Copy</value>
+  </data>
+  <data name="pasteToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
+    <value>152, 22</value>
+  </data>
+  <data name="pasteToolStripMenuItem.Text" xml:space="preserve">
+    <value>Paste</value>
+  </data>
+  <data name="toolStripSeparator4.Size" type="System.Drawing.Size, System.Drawing">
+    <value>149, 6</value>
+  </data>
+  <data name="findToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
+    <value>152, 22</value>
+  </data>
+  <data name="findToolStripMenuItem.Text" xml:space="preserve">
+    <value>Find</value>
+  </data>
+  <data name="findReplaceToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
+    <value>152, 22</value>
+  </data>
+  <data name="findReplaceToolStripMenuItem.Text" xml:space="preserve">
+    <value>Find/Replace</value>
+  </data>
+  <data name="ctxXmlEditor.Size" type="System.Drawing.Size, System.Drawing">
+    <value>153, 142</value>
+  </data>
+  <data name=">>ctxXmlEditor.Name" xml:space="preserve">
+    <value>ctxXmlEditor</value>
+  </data>
+  <data name=">>ctxXmlEditor.Type" xml:space="preserve">
+    <value>System.Windows.Forms.ContextMenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </data>
   <data name="txtXmlContent.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
     <value>Fill</value>
   </data>
@@ -280,7 +325,7 @@
     <value>$this</value>
   </data>
   <data name=">>txtXmlContent.ZOrder" xml:space="preserve">
-    <value>0</value>
+    <value>1</value>
   </data>
   <metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
@@ -366,6 +411,42 @@
   <data name=">>nodeNumericUpDown1.Type" xml:space="preserve">
     <value>Aga.Controls.Tree.NodeControls.NodeNumericUpDown, Aga.Controls, Version=1.7.0.0, Culture=neutral, PublicKeyToken=fcc90fbf924463a3</value>
   </data>
+  <data name=">>cutToolStripMenuItem.Name" xml:space="preserve">
+    <value>cutToolStripMenuItem</value>
+  </data>
+  <data name=">>cutToolStripMenuItem.Type" xml:space="preserve">
+    <value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </data>
+  <data name=">>copyToolStripMenuItem.Name" xml:space="preserve">
+    <value>copyToolStripMenuItem</value>
+  </data>
+  <data name=">>copyToolStripMenuItem.Type" xml:space="preserve">
+    <value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </data>
+  <data name=">>pasteToolStripMenuItem.Name" xml:space="preserve">
+    <value>pasteToolStripMenuItem</value>
+  </data>
+  <data name=">>pasteToolStripMenuItem.Type" xml:space="preserve">
+    <value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </data>
+  <data name=">>toolStripSeparator4.Name" xml:space="preserve">
+    <value>toolStripSeparator4</value>
+  </data>
+  <data name=">>toolStripSeparator4.Type" xml:space="preserve">
+    <value>System.Windows.Forms.ToolStripSeparator, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </data>
+  <data name=">>findToolStripMenuItem.Name" xml:space="preserve">
+    <value>findToolStripMenuItem</value>
+  </data>
+  <data name=">>findToolStripMenuItem.Type" xml:space="preserve">
+    <value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </data>
+  <data name=">>findReplaceToolStripMenuItem.Name" xml:space="preserve">
+    <value>findReplaceToolStripMenuItem</value>
+  </data>
+  <data name=">>findReplaceToolStripMenuItem.Type" xml:space="preserve">
+    <value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </data>
   <data name=">>$this.Name" xml:space="preserve">
     <value>XmlEditorCtrl</value>
   </data>

Added: trunk/Tools/Maestro/Maestro.Editors/Generic/XmlTextEditorControl.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Generic/XmlTextEditorControl.cs	                        (rev 0)
+++ trunk/Tools/Maestro/Maestro.Editors/Generic/XmlTextEditorControl.cs	2012-09-10 11:45:26 UTC (rev 6993)
@@ -0,0 +1,47 @@
+#region Disclaimer / License
+// Copyright (C) 2012, Jackie Ng
+// http://trac.osgeo.org/mapguide/wiki/maestro, jumpinjackie at gmail.com
+// 
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// 
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+// 
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+// 
+#endregion
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using ICSharpCode.TextEditor;
+using ICSharpCode.TextEditor.Actions;
+using System.Windows.Forms;
+using System.ComponentModel;
+
+namespace Maestro.Editors.Generic
+{
+    /// <summary>
+    /// An extension of TextEditorControl for use by the generic XML editor control
+    /// </summary>
+    [ToolboxItem(false)]
+    public class XmlTextEditorControl : TextEditorControl
+    {
+        public XmlTextEditorControl()
+        { 
+        
+        }
+
+        internal void RegisterAction(Keys k, IEditAction action)
+        {
+            editactions[k] = action;
+        }
+    }
+}

Modified: trunk/Tools/Maestro/Maestro.Editors/Maestro.Editors.csproj
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Maestro.Editors.csproj	2012-09-10 02:39:41 UTC (rev 6992)
+++ trunk/Tools/Maestro/Maestro.Editors/Maestro.Editors.csproj	2012-09-10 11:45:26 UTC (rev 6993)
@@ -647,6 +647,9 @@
     <Compile Include="Fusion\WidgetSettingsCtrl.Designer.cs">
       <DependentUpon>WidgetSettingsCtrl.cs</DependentUpon>
     </Compile>
+    <Compile Include="Generic\XmlTextEditorControl.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
     <Compile Include="Generic\NsDoc.cs" />
     <Compile Include="Generic\ResourceDataPanel.cs">
       <SubType>UserControl</SubType>



More information about the mapguide-commits mailing list