[mapguide-commits] r6505 - in trunk/Tools/Maestro: Maestro.Editors/LayerDefinition/Vector OSGeo.MapGuide.MaestroAPI/ObjectModels

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Mon Feb 13 08:18:01 EST 2012


Author: jng
Date: 2012-02-13 05:18:01 -0800 (Mon, 13 Feb 2012)
New Revision: 6505

Modified:
   trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/VectorLayerSettingsSectionCtrl.Designer.cs
   trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/VectorLayerSettingsSectionCtrl.cs
   trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/VectorLayerSettingsSectionCtrl.resx
   trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/VectorLayerDefinitionImpl.cs
Log:
#1953: Remove empty Url/Tooltip/Filter elements if set to an empty string in the editor

Modified: trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/VectorLayerSettingsSectionCtrl.Designer.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/VectorLayerSettingsSectionCtrl.Designer.cs	2012-02-13 13:17:15 UTC (rev 6504)
+++ trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/VectorLayerSettingsSectionCtrl.Designer.cs	2012-02-13 13:18:01 UTC (rev 6505)
@@ -172,6 +172,7 @@
             // 
             resources.ApplyResources(this.txtTooltip, "txtTooltip");
             this.txtTooltip.Name = "txtTooltip";
+            this.txtTooltip.TextChanged += new System.EventHandler(this.txtTooltip_TextChanged);
             // 
             // txtHyperlink
             // 
@@ -183,6 +184,7 @@
             // 
             resources.ApplyResources(this.txtFilter, "txtFilter");
             this.txtFilter.Name = "txtFilter";
+            this.txtFilter.TextChanged += new System.EventHandler(this.txtFilter_TextChanged);
             // 
             // label6
             // 

Modified: trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/VectorLayerSettingsSectionCtrl.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/VectorLayerSettingsSectionCtrl.cs	2012-02-13 13:17:15 UTC (rev 6504)
+++ trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/VectorLayerSettingsSectionCtrl.cs	2012-02-13 13:18:01 UTC (rev 6505)
@@ -68,13 +68,15 @@
 
                 TextBoxBinder.BindText(txtFeatureClass, _vl, "FeatureName");
                 TextBoxBinder.BindText(txtGeometry, _vl, "Geometry");
-                TextBoxBinder.BindText(txtFilter, _vl, "Filter");
-                
+                //TextBoxBinder.BindText(txtFilter, _vl, "Filter");
+                txtFilter.Text = _vl.Filter;
+
                 //Loose bind this one because 2.4 changes this behaviour making it
                 //unsuitable for databinding via TextBoxBinder
                 txtHyperlink.Text = _vl.Url;
 
-                TextBoxBinder.BindText(txtTooltip, _vl, "ToolTip");
+                //TextBoxBinder.BindText(txtTooltip, _vl, "ToolTip");
+                txtTooltip.Text = _vl.ToolTip;
 
                 //This is not the root object so no change listeners have been subscribed
                 _vl.PropertyChanged += OnVectorLayerPropertyChanged;
@@ -318,9 +320,34 @@
             if (_init)
                 return;
 
-            _vl.Url = txtHyperlink.Text;
+            if (string.IsNullOrEmpty(txtHyperlink.Text))
+                _vl.Url = null;
+            else
+                _vl.Url = txtHyperlink.Text;
         }
 
+        private void txtFilter_TextChanged(object sender, EventArgs e)
+        {
+            if (_init)
+                return;
+
+            if (string.IsNullOrEmpty(txtFilter.Text))
+                _vl.Filter = null;
+            else
+                _vl.Filter = txtFilter.Text;
+        }
+
+        private void txtTooltip_TextChanged(object sender, EventArgs e)
+        {
+            if (_init)
+                return;
+
+            if (string.IsNullOrEmpty(txtTooltip.Text))
+                _vl.ToolTip = null;
+            else
+                _vl.ToolTip = txtTooltip.Text;
+        }
+
         private void btnGoToFeatureSource_Click(object sender, EventArgs e)
         {
             _edsvc.OpenResource(txtFeatureSource.Text);

Modified: trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/VectorLayerSettingsSectionCtrl.resx
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/VectorLayerSettingsSectionCtrl.resx	2012-02-13 13:17:15 UTC (rev 6504)
+++ trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/VectorLayerSettingsSectionCtrl.resx	2012-02-13 13:18:01 UTC (rev 6505)
@@ -411,21 +411,6 @@
   <data name="grpFeatureClass.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
     <value>Top, Left, Right</value>
   </data>
-  <data name="btnBrowseGeometry.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
-    <value>Top, Right</value>
-  </data>
-  <data name="btnBrowseGeometry.Location" type="System.Drawing.Point, System.Drawing">
-    <value>377, 42</value>
-  </data>
-  <data name="btnBrowseGeometry.Size" type="System.Drawing.Size, System.Drawing">
-    <value>30, 23</value>
-  </data>
-  <data name="btnBrowseGeometry.TabIndex" type="System.Int32, mscorlib">
-    <value>12</value>
-  </data>
-  <data name="btnBrowseGeometry.Text" xml:space="preserve">
-    <value>...</value>
-  </data>
   <data name="&gt;&gt;btnBrowseGeometry.Name" xml:space="preserve">
     <value>btnBrowseGeometry</value>
   </data>
@@ -438,21 +423,6 @@
   <data name="&gt;&gt;btnBrowseGeometry.ZOrder" xml:space="preserve">
     <value>0</value>
   </data>
-  <data name="label3.AutoSize" type="System.Boolean, mscorlib">
-    <value>True</value>
-  </data>
-  <data name="label3.Location" type="System.Drawing.Point, System.Drawing">
-    <value>15, 47</value>
-  </data>
-  <data name="label3.Size" type="System.Drawing.Size, System.Drawing">
-    <value>94, 13</value>
-  </data>
-  <data name="label3.TabIndex" type="System.Int32, mscorlib">
-    <value>1</value>
-  </data>
-  <data name="label3.Text" xml:space="preserve">
-    <value>Geometry Property</value>
-  </data>
   <data name="&gt;&gt;label3.Name" xml:space="preserve">
     <value>label3</value>
   </data>
@@ -465,21 +435,6 @@
   <data name="&gt;&gt;label3.ZOrder" xml:space="preserve">
     <value>1</value>
   </data>
-  <data name="btnBrowseSchema.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
-    <value>Top, Right</value>
-  </data>
-  <data name="btnBrowseSchema.Location" type="System.Drawing.Point, System.Drawing">
-    <value>377, 17</value>
-  </data>
-  <data name="btnBrowseSchema.Size" type="System.Drawing.Size, System.Drawing">
-    <value>30, 23</value>
-  </data>
-  <data name="btnBrowseSchema.TabIndex" type="System.Int32, mscorlib">
-    <value>11</value>
-  </data>
-  <data name="btnBrowseSchema.Text" xml:space="preserve">
-    <value>...</value>
-  </data>
   <data name="&gt;&gt;btnBrowseSchema.Name" xml:space="preserve">
     <value>btnBrowseSchema</value>
   </data>
@@ -492,21 +447,6 @@
   <data name="&gt;&gt;btnBrowseSchema.ZOrder" xml:space="preserve">
     <value>2</value>
   </data>
-  <data name="label2.AutoSize" type="System.Boolean, mscorlib">
-    <value>True</value>
-  </data>
-  <data name="label2.Location" type="System.Drawing.Point, System.Drawing">
-    <value>15, 22</value>
-  </data>
-  <data name="label2.Size" type="System.Drawing.Size, System.Drawing">
-    <value>71, 13</value>
-  </data>
-  <data name="label2.TabIndex" type="System.Int32, mscorlib">
-    <value>0</value>
-  </data>
-  <data name="label2.Text" xml:space="preserve">
-    <value>Feature Class</value>
-  </data>
   <data name="&gt;&gt;label2.Name" xml:space="preserve">
     <value>label2</value>
   </data>
@@ -519,18 +459,6 @@
   <data name="&gt;&gt;label2.ZOrder" xml:space="preserve">
     <value>3</value>
   </data>
-  <data name="txtGeometry.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
-    <value>Top, Left, Right</value>
-  </data>
-  <data name="txtGeometry.Location" type="System.Drawing.Point, System.Drawing">
-    <value>121, 44</value>
-  </data>
-  <data name="txtGeometry.Size" type="System.Drawing.Size, System.Drawing">
-    <value>250, 20</value>
-  </data>
-  <data name="txtGeometry.TabIndex" type="System.Int32, mscorlib">
-    <value>10</value>
-  </data>
   <data name="&gt;&gt;txtGeometry.Name" xml:space="preserve">
     <value>txtGeometry</value>
   </data>
@@ -543,18 +471,6 @@
   <data name="&gt;&gt;txtGeometry.ZOrder" xml:space="preserve">
     <value>4</value>
   </data>
-  <data name="txtFeatureClass.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
-    <value>Top, Left, Right</value>
-  </data>
-  <data name="txtFeatureClass.Location" type="System.Drawing.Point, System.Drawing">
-    <value>121, 19</value>
-  </data>
-  <data name="txtFeatureClass.Size" type="System.Drawing.Size, System.Drawing">
-    <value>250, 20</value>
-  </data>
-  <data name="txtFeatureClass.TabIndex" type="System.Int32, mscorlib">
-    <value>9</value>
-  </data>
   <data name="&gt;&gt;txtFeatureClass.Name" xml:space="preserve">
     <value>txtFeatureClass</value>
   </data>
@@ -684,6 +600,162 @@
   <data name="&gt;&gt;contentPanel.ZOrder" xml:space="preserve">
     <value>0</value>
   </data>
+  <data name="btnBrowseGeometry.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
+    <value>Top, Right</value>
+  </data>
+  <data name="btnBrowseGeometry.Location" type="System.Drawing.Point, System.Drawing">
+    <value>377, 42</value>
+  </data>
+  <data name="btnBrowseGeometry.Size" type="System.Drawing.Size, System.Drawing">
+    <value>30, 23</value>
+  </data>
+  <data name="btnBrowseGeometry.TabIndex" type="System.Int32, mscorlib">
+    <value>12</value>
+  </data>
+  <data name="btnBrowseGeometry.Text" xml:space="preserve">
+    <value>...</value>
+  </data>
+  <data name="&gt;&gt;btnBrowseGeometry.Name" xml:space="preserve">
+    <value>btnBrowseGeometry</value>
+  </data>
+  <data name="&gt;&gt;btnBrowseGeometry.Type" xml:space="preserve">
+    <value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </data>
+  <data name="&gt;&gt;btnBrowseGeometry.Parent" xml:space="preserve">
+    <value>grpFeatureClass</value>
+  </data>
+  <data name="&gt;&gt;btnBrowseGeometry.ZOrder" xml:space="preserve">
+    <value>0</value>
+  </data>
+  <data name="label3.AutoSize" type="System.Boolean, mscorlib">
+    <value>True</value>
+  </data>
+  <data name="label3.Location" type="System.Drawing.Point, System.Drawing">
+    <value>15, 47</value>
+  </data>
+  <data name="label3.Size" type="System.Drawing.Size, System.Drawing">
+    <value>94, 13</value>
+  </data>
+  <data name="label3.TabIndex" type="System.Int32, mscorlib">
+    <value>1</value>
+  </data>
+  <data name="label3.Text" xml:space="preserve">
+    <value>Geometry Property</value>
+  </data>
+  <data name="&gt;&gt;label3.Name" xml:space="preserve">
+    <value>label3</value>
+  </data>
+  <data name="&gt;&gt;label3.Type" xml:space="preserve">
+    <value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </data>
+  <data name="&gt;&gt;label3.Parent" xml:space="preserve">
+    <value>grpFeatureClass</value>
+  </data>
+  <data name="&gt;&gt;label3.ZOrder" xml:space="preserve">
+    <value>1</value>
+  </data>
+  <data name="btnBrowseSchema.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
+    <value>Top, Right</value>
+  </data>
+  <data name="btnBrowseSchema.Location" type="System.Drawing.Point, System.Drawing">
+    <value>377, 17</value>
+  </data>
+  <data name="btnBrowseSchema.Size" type="System.Drawing.Size, System.Drawing">
+    <value>30, 23</value>
+  </data>
+  <data name="btnBrowseSchema.TabIndex" type="System.Int32, mscorlib">
+    <value>11</value>
+  </data>
+  <data name="btnBrowseSchema.Text" xml:space="preserve">
+    <value>...</value>
+  </data>
+  <data name="&gt;&gt;btnBrowseSchema.Name" xml:space="preserve">
+    <value>btnBrowseSchema</value>
+  </data>
+  <data name="&gt;&gt;btnBrowseSchema.Type" xml:space="preserve">
+    <value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </data>
+  <data name="&gt;&gt;btnBrowseSchema.Parent" xml:space="preserve">
+    <value>grpFeatureClass</value>
+  </data>
+  <data name="&gt;&gt;btnBrowseSchema.ZOrder" xml:space="preserve">
+    <value>2</value>
+  </data>
+  <data name="label2.AutoSize" type="System.Boolean, mscorlib">
+    <value>True</value>
+  </data>
+  <data name="label2.Location" type="System.Drawing.Point, System.Drawing">
+    <value>15, 22</value>
+  </data>
+  <data name="label2.Size" type="System.Drawing.Size, System.Drawing">
+    <value>71, 13</value>
+  </data>
+  <data name="label2.TabIndex" type="System.Int32, mscorlib">
+    <value>0</value>
+  </data>
+  <data name="label2.Text" xml:space="preserve">
+    <value>Feature Class</value>
+  </data>
+  <data name="&gt;&gt;label2.Name" xml:space="preserve">
+    <value>label2</value>
+  </data>
+  <data name="&gt;&gt;label2.Type" xml:space="preserve">
+    <value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </data>
+  <data name="&gt;&gt;label2.Parent" xml:space="preserve">
+    <value>grpFeatureClass</value>
+  </data>
+  <data name="&gt;&gt;label2.ZOrder" xml:space="preserve">
+    <value>3</value>
+  </data>
+  <data name="txtGeometry.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
+    <value>Top, Left, Right</value>
+  </data>
+  <data name="txtGeometry.Location" type="System.Drawing.Point, System.Drawing">
+    <value>121, 44</value>
+  </data>
+  <data name="txtGeometry.Size" type="System.Drawing.Size, System.Drawing">
+    <value>250, 20</value>
+  </data>
+  <data name="txtGeometry.TabIndex" type="System.Int32, mscorlib">
+    <value>10</value>
+  </data>
+  <data name="&gt;&gt;txtGeometry.Name" xml:space="preserve">
+    <value>txtGeometry</value>
+  </data>
+  <data name="&gt;&gt;txtGeometry.Type" xml:space="preserve">
+    <value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </data>
+  <data name="&gt;&gt;txtGeometry.Parent" xml:space="preserve">
+    <value>grpFeatureClass</value>
+  </data>
+  <data name="&gt;&gt;txtGeometry.ZOrder" xml:space="preserve">
+    <value>4</value>
+  </data>
+  <data name="txtFeatureClass.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
+    <value>Top, Left, Right</value>
+  </data>
+  <data name="txtFeatureClass.Location" type="System.Drawing.Point, System.Drawing">
+    <value>121, 19</value>
+  </data>
+  <data name="txtFeatureClass.Size" type="System.Drawing.Size, System.Drawing">
+    <value>250, 20</value>
+  </data>
+  <data name="txtFeatureClass.TabIndex" type="System.Int32, mscorlib">
+    <value>9</value>
+  </data>
+  <data name="&gt;&gt;txtFeatureClass.Name" xml:space="preserve">
+    <value>txtFeatureClass</value>
+  </data>
+  <data name="&gt;&gt;txtFeatureClass.Type" xml:space="preserve">
+    <value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </data>
+  <data name="&gt;&gt;txtFeatureClass.Parent" xml:space="preserve">
+    <value>grpFeatureClass</value>
+  </data>
+  <data name="&gt;&gt;txtFeatureClass.ZOrder" xml:space="preserve">
+    <value>5</value>
+  </data>
   <metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>

Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/VectorLayerDefinitionImpl.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/VectorLayerDefinitionImpl.cs	2012-02-13 13:17:15 UTC (rev 6504)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/VectorLayerDefinitionImpl.cs	2012-02-13 13:18:01 UTC (rev 6505)
@@ -1718,9 +1718,20 @@
             }
             set
             {
-                if (this.urlDataField == null)
-                    this.urlDataField = new URLDataType();
-                this.urlDataField.Content = value;
+                if (!string.IsNullOrEmpty(value))
+                {
+                    if (this.urlDataField == null)
+                        this.urlDataField = new URLDataType();
+                    this.urlDataField.Content = value;
+                    OnPropertyChanged("Url");
+                }
+                else 
+                {
+                    //NOTE: None of the other URLData properties seem to be used atm
+                    //hence why we are nulling this
+                    this.urlDataField = null;
+                    OnPropertyChanged("Url");
+                }
             }
 #else
             get { return this.Url; }



More information about the mapguide-commits mailing list