[mapguide-commits] r5696 - in trunk/Tools/Maestro/Maestro.Editors: FeatureSource Properties

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Tue Apr 12 07:54:43 EDT 2011


Author: jng
Date: 2011-04-12 04:54:43 -0700 (Tue, 12 Apr 2011)
New Revision: 5696

Modified:
   trunk/Tools/Maestro/Maestro.Editors/FeatureSource/CoordSysOverrideCtrl.Designer.cs
   trunk/Tools/Maestro/Maestro.Editors/FeatureSource/CoordSysOverrideCtrl.cs
   trunk/Tools/Maestro/Maestro.Editors/FeatureSource/CoordSysOverrideCtrl.resx
   trunk/Tools/Maestro/Maestro.Editors/Properties/Resources.Designer.cs
   trunk/Tools/Maestro/Maestro.Editors/Properties/Resources.resx
Log:
#1659: Port over advanced coordinate system override features from Maestro 2.x.


Modified: trunk/Tools/Maestro/Maestro.Editors/FeatureSource/CoordSysOverrideCtrl.Designer.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/FeatureSource/CoordSysOverrideCtrl.Designer.cs	2011-04-12 11:24:26 UTC (rev 5695)
+++ trunk/Tools/Maestro/Maestro.Editors/FeatureSource/CoordSysOverrideCtrl.Designer.cs	2011-04-12 11:54:43 UTC (rev 5696)
@@ -33,6 +33,9 @@
             this.btnAdd = new System.Windows.Forms.ToolStripButton();
             this.btnEdit = new System.Windows.Forms.ToolStripButton();
             this.btnDelete = new System.Windows.Forms.ToolStripButton();
+            this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
+            this.btnApplyAll = new System.Windows.Forms.ToolStripButton();
+            this.btnLoadFromSc = new System.Windows.Forms.ToolStripButton();
             this.grdOverrides = new System.Windows.Forms.DataGridView();
             this.COL_SOURCE = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.COL_TARGET = new System.Windows.Forms.DataGridViewTextBoxColumn();
@@ -52,7 +55,10 @@
             this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
             this.btnAdd,
             this.btnEdit,
-            this.btnDelete});
+            this.btnDelete,
+            this.toolStripSeparator1,
+            this.btnApplyAll,
+            this.btnLoadFromSc});
             resources.ApplyResources(this.toolStrip1, "toolStrip1");
             this.toolStrip1.Name = "toolStrip1";
             // 
@@ -77,6 +83,25 @@
             this.btnDelete.Name = "btnDelete";
             this.btnDelete.Click += new System.EventHandler(this.btnDelete_Click);
             // 
+            // toolStripSeparator1
+            // 
+            this.toolStripSeparator1.Name = "toolStripSeparator1";
+            resources.ApplyResources(this.toolStripSeparator1, "toolStripSeparator1");
+            // 
+            // btnApplyAll
+            // 
+            resources.ApplyResources(this.btnApplyAll, "btnApplyAll");
+            this.btnApplyAll.Image = global::Maestro.Editors.Properties.Resources.globe__arrow;
+            this.btnApplyAll.Name = "btnApplyAll";
+            this.btnApplyAll.Click += new System.EventHandler(this.btnApplyAll_Click);
+            // 
+            // btnLoadFromSc
+            // 
+            this.btnLoadFromSc.Image = global::Maestro.Editors.Properties.Resources.globe__plus;
+            resources.ApplyResources(this.btnLoadFromSc, "btnLoadFromSc");
+            this.btnLoadFromSc.Name = "btnLoadFromSc";
+            this.btnLoadFromSc.Click += new System.EventHandler(this.btnLoadFromSc_Click);
+            // 
             // grdOverrides
             // 
             this.grdOverrides.AllowUserToAddRows = false;
@@ -132,5 +157,8 @@
         private System.Windows.Forms.ToolStripButton btnEdit;
         private System.Windows.Forms.DataGridViewTextBoxColumn COL_SOURCE;
         private System.Windows.Forms.DataGridViewTextBoxColumn COL_TARGET;
+        private System.Windows.Forms.ToolStripButton btnApplyAll;
+        private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
+        private System.Windows.Forms.ToolStripButton btnLoadFromSc;
     }
 }

Modified: trunk/Tools/Maestro/Maestro.Editors/FeatureSource/CoordSysOverrideCtrl.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/FeatureSource/CoordSysOverrideCtrl.cs	2011-04-12 11:24:26 UTC (rev 5695)
+++ trunk/Tools/Maestro/Maestro.Editors/FeatureSource/CoordSysOverrideCtrl.cs	2011-04-12 11:54:43 UTC (rev 5696)
@@ -76,6 +76,7 @@
             {
                 grdOverrides.Rows[e.RowIndex].Selected = true;
             }
+            btnApplyAll.Enabled = grdOverrides.SelectedRows.Count > 0;
         }
 
         private void grdOverrides_SelectionChanged(object sender, EventArgs e)
@@ -112,5 +113,45 @@
                 OnResourceChanged();
             }
         }
+
+        private void btnApplyAll_Click(object sender, EventArgs e)
+        {
+            string wkt = _ed.GetCoordinateSystem();
+            if (!string.IsNullOrEmpty(wkt))
+            {
+                foreach (DataGridViewRow row in grdOverrides.SelectedRows)
+                {
+                    var sci = (ISpatialContextInfo)row.DataBoundItem;
+                    sci.CoordinateSystem = wkt;
+                }
+                UpdateSpatialContextList();
+            }
+        }
+
+        private void btnLoadFromSc_Click(object sender, EventArgs e)
+        {
+            if (grdOverrides.Rows.Count > 0)
+            {
+                if (MessageBox.Show(Properties.Resources.QuestionResetFsOverrideList, Properties.Resources.TitleQuestion, MessageBoxButtons.YesNo) == DialogResult.Yes)
+                {
+                    var sco = new List<ISpatialContextInfo>(_fs.SupplementalSpatialContextInfo);
+                    foreach (var s in sco)
+                    {
+                        _fs.RemoveSpatialContextOverride(s);
+                    }
+                }
+                else
+                {
+                    return;
+                }
+            }
+
+            var scList = _fs.GetSpatialInfo(false);
+            foreach (var sc in scList.SpatialContext)
+            {
+                _fs.AddSpatialContextOverride(sc.Name, sc.CoordinateSystemWkt);
+            }
+            UpdateSpatialContextList();
+        }
     }
 }

Modified: trunk/Tools/Maestro/Maestro.Editors/FeatureSource/CoordSysOverrideCtrl.resx
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/FeatureSource/CoordSysOverrideCtrl.resx	2011-04-12 11:24:26 UTC (rev 5695)
+++ trunk/Tools/Maestro/Maestro.Editors/FeatureSource/CoordSysOverrideCtrl.resx	2011-04-12 11:54:43 UTC (rev 5696)
@@ -195,6 +195,36 @@
   <data name="btnDelete.Text" xml:space="preserve">
     <value>Delete</value>
   </data>
+  <data name="toolStripSeparator1.Size" type="System.Drawing.Size, System.Drawing">
+    <value>6, 25</value>
+  </data>
+  <data name="btnApplyAll.Enabled" type="System.Boolean, mscorlib">
+    <value>False</value>
+  </data>
+  <data name="btnApplyAll.ImageTransparentColor" type="System.Drawing.Color, System.Drawing">
+    <value>Magenta</value>
+  </data>
+  <data name="btnApplyAll.Size" type="System.Drawing.Size, System.Drawing">
+    <value>104, 22</value>
+  </data>
+  <data name="btnApplyAll.Text" xml:space="preserve">
+    <value>Apply CS to all</value>
+  </data>
+  <data name="btnApplyAll.ToolTipText" xml:space="preserve">
+    <value>Apply the same coordinate system to all selected overrides</value>
+  </data>
+  <data name="btnLoadFromSc.ImageTransparentColor" type="System.Drawing.Color, System.Drawing">
+    <value>Magenta</value>
+  </data>
+  <data name="btnLoadFromSc.Size" type="System.Drawing.Size, System.Drawing">
+    <value>99, 22</value>
+  </data>
+  <data name="btnLoadFromSc.Text" xml:space="preserve">
+    <value>Load Defaults</value>
+  </data>
+  <data name="btnLoadFromSc.ToolTipText" xml:space="preserve">
+    <value>Load overrides from current list of spatial contexts</value>
+  </data>
   <data name="toolStrip1.Location" type="System.Drawing.Point, System.Drawing">
     <value>0, 0</value>
   </data>
@@ -258,6 +288,24 @@
   <data name="&gt;&gt;btnDelete.Type" xml:space="preserve">
     <value>System.Windows.Forms.ToolStripButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </data>
+  <data name="&gt;&gt;toolStripSeparator1.Name" xml:space="preserve">
+    <value>toolStripSeparator1</value>
+  </data>
+  <data name="&gt;&gt;toolStripSeparator1.Type" xml:space="preserve">
+    <value>System.Windows.Forms.ToolStripSeparator, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </data>
+  <data name="&gt;&gt;btnApplyAll.Name" xml:space="preserve">
+    <value>btnApplyAll</value>
+  </data>
+  <data name="&gt;&gt;btnApplyAll.Type" xml:space="preserve">
+    <value>System.Windows.Forms.ToolStripButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </data>
+  <data name="&gt;&gt;btnLoadFromSc.Name" xml:space="preserve">
+    <value>btnLoadFromSc</value>
+  </data>
+  <data name="&gt;&gt;btnLoadFromSc.Type" xml:space="preserve">
+    <value>System.Windows.Forms.ToolStripButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </data>
   <data name="&gt;&gt;COL_SOURCE.Name" xml:space="preserve">
     <value>COL_SOURCE</value>
   </data>
@@ -274,6 +322,6 @@
     <value>CoordSysOverrideCtrl</value>
   </data>
   <data name="&gt;&gt;$this.Type" xml:space="preserve">
-    <value>Maestro.Editors.Common.EditorBindableCollapsiblePanel, Maestro.Editors, Version=3.0.0.5475, Culture=neutral, PublicKeyToken=null</value>
+    <value>Maestro.Editors.Common.EditorBindableCollapsiblePanel, Maestro.Editors, Version=3.0.0.5676, Culture=neutral, PublicKeyToken=null</value>
   </data>
 </root>
\ No newline at end of file

Modified: trunk/Tools/Maestro/Maestro.Editors/Properties/Resources.Designer.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Properties/Resources.Designer.cs	2011-04-12 11:24:26 UTC (rev 5695)
+++ trunk/Tools/Maestro/Maestro.Editors/Properties/Resources.Designer.cs	2011-04-12 11:54:43 UTC (rev 5696)
@@ -2173,6 +2173,15 @@
         }
         
         /// <summary>
+        ///   Looks up a localized string similar to Reset Feature Source override list?.
+        /// </summary>
+        internal static string QuestionResetFsOverrideList {
+            get {
+                return ResourceManager.GetString("QuestionResetFsOverrideList", resourceCulture);
+            }
+        }
+        
+        /// <summary>
         ///   Looks up a localized string similar to RDBMS Feature Source.
         /// </summary>
         internal static string RdbmsFeatureSource {
@@ -2515,6 +2524,15 @@
         }
         
         /// <summary>
+        ///   Looks up a localized string similar to Question.
+        /// </summary>
+        internal static string TitleQuestion {
+            get {
+                return ResourceManager.GetString("TitleQuestion", resourceCulture);
+            }
+        }
+        
+        /// <summary>
         ///   Looks up a localized string similar to The selected column contains more than {0} different values, and thus cannot be used for theming with individual values.
         /// </summary>
         internal static string TooManyIndiviualValuesError {

Modified: trunk/Tools/Maestro/Maestro.Editors/Properties/Resources.resx
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Properties/Resources.resx	2011-04-12 11:24:26 UTC (rev 5695)
+++ trunk/Tools/Maestro/Maestro.Editors/Properties/Resources.resx	2011-04-12 11:54:43 UTC (rev 5696)
@@ -1160,4 +1160,10 @@
   <data name="PreviewUrlNotAvailable" xml:space="preserve">
     <value>The Preview URL is not currently available</value>
   </data>
+  <data name="QuestionResetFsOverrideList" xml:space="preserve">
+    <value>Reset Feature Source override list?</value>
+  </data>
+  <data name="TitleQuestion" xml:space="preserve">
+    <value>Question</value>
+  </data>
 </root>
\ No newline at end of file



More information about the mapguide-commits mailing list