[mapguide-commits] r8130 - in trunk/Tools/Maestro/Maestro.Editors: . LayerDefinition/Vector/Scales

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Mon May 12 12:39:07 PDT 2014


Author: jng
Date: 2014-05-12 12:39:07 -0700 (Mon, 12 May 2014)
New Revision: 8130

Modified:
   trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/CompositeStyleListCtrl.cs
   trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/Condition.cs
   trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/ConditionList.cs
   trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/ConditionListButtons.cs
   trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/ItemStyle.cs
   trunk/Tools/Maestro/Maestro.Editors/Strings.Designer.cs
   trunk/Tools/Maestro/Maestro.Editors/Strings.resx
Log:
#2447: Theme offset was also not applied to the classic editor for composite styles.

Also display the proper unsupported message when attempting to theme a composite style with the classic editor.

Modified: trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/CompositeStyleListCtrl.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/CompositeStyleListCtrl.cs	2014-05-12 19:16:57 UTC (rev 8129)
+++ trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/CompositeStyleListCtrl.cs	2014-05-12 19:39:07 UTC (rev 8130)
@@ -95,6 +95,18 @@
                         _controls[style].AddRule();
                 }
 
+                //Update offset
+                if (lstStyles.SelectedIndex >= 0)
+                {
+                    int offset = 0;
+                    for (int i = 0; i < lstStyles.SelectedIndex; i++)
+                    {
+                        var cs = (ICompositeTypeStyle)lstStyles.Items[i];
+                        offset += cs.RuleCount;
+                    }
+                    _controls[style].SetThemeOffset(offset);
+                }
+
                 SetActiveControl(_controls[style]);
             }
         }

Modified: trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/Condition.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/Condition.cs	2014-05-12 19:16:57 UTC (rev 8129)
+++ trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/Condition.cs	2014-05-12 19:39:07 UTC (rev 8130)
@@ -262,5 +262,10 @@
             this.Focus();
         }
 
+
+        internal void SetThemeOffset(int offset)
+        {
+            FeatureStyle.SetThemeOffset(offset);
+        }
     }
 }

Modified: trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/ConditionList.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/ConditionList.cs	2014-05-12 19:16:57 UTC (rev 8129)
+++ trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/ConditionList.cs	2014-05-12 19:39:07 UTC (rev 8130)
@@ -400,5 +400,16 @@
             return minHeight;
         }
 
+
+        internal void SetThemeOffset(int offset)
+        {
+            foreach (var c in this.Controls)
+            {
+                var cond = c as Condition;
+                if (cond == null)
+                    continue;
+                cond.SetThemeOffset(offset);
+            }
+        }
     }
 }

Modified: trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/ConditionListButtons.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/ConditionListButtons.cs	2014-05-12 19:16:57 UTC (rev 8129)
+++ trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/ConditionListButtons.cs	2014-05-12 19:39:07 UTC (rev 8130)
@@ -177,7 +177,15 @@
                     owner = m_line;
                 else if (m_area != null)
                     owner = m_area;
+                else if (m_comp != null)
+                    owner = m_comp;
 
+                if (owner is ICompositeTypeStyle)
+                {
+                    MessageBox.Show(Strings.CannotCreateThemeForCompositeStyleClassicEditor);
+                    return;
+                }
+
                 ILayerDefinition layer = (ILayerDefinition)m_owner.Editor.GetEditedResource();
                 IVectorLayerDefinition vl = (IVectorLayerDefinition)layer.SubLayer;
                 if (string.IsNullOrEmpty(vl.FeatureName))
@@ -355,5 +363,10 @@
             Utility.ExplodeThemeIntoFilteredLayers(options, cb);
             return true;
         }
+
+        internal void SetThemeOffset(int offset)
+        {
+            conditionList.SetThemeOffset(offset);
+        }
     }
 }

Modified: trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/ItemStyle.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/ItemStyle.cs	2014-05-12 19:16:57 UTC (rev 8129)
+++ trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/ItemStyle.cs	2014-05-12 19:39:07 UTC (rev 8130)
@@ -181,7 +181,7 @@
                                                                     80,
                                                                     40,
                                                                     "PNG", //NOXLATE
-                                                                    this.ThemeCategory);
+                                                                    _themeOffset + this.ThemeCategory);
 
             //TODO: This is obviously a mess and could do with some future cleanup, but the idea here should be
             //easy to understand. Each primitive basic style (that's not a label) has 3 actions.
@@ -409,5 +409,12 @@
 
             EditButton_Click(sender, e);
         }
+
+        private int _themeOffset = 0;
+
+        internal void SetThemeOffset(int offset)
+        {
+            _themeOffset = offset;
+        }
     }
 }

Modified: trunk/Tools/Maestro/Maestro.Editors/Strings.Designer.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Strings.Designer.cs	2014-05-12 19:16:57 UTC (rev 8129)
+++ trunk/Tools/Maestro/Maestro.Editors/Strings.Designer.cs	2014-05-12 19:39:07 UTC (rev 8130)
@@ -124,6 +124,15 @@
         }
         
         /// <summary>
+        ///   Looks up a localized string similar to Theming composite styles with this editor is not supported.
+        /// </summary>
+        internal static string CannotCreateThemeForCompositeStyleClassicEditor {
+            get {
+                return ResourceManager.GetString("CannotCreateThemeForCompositeStyleClassicEditor", resourceCulture);
+            }
+        }
+        
+        /// <summary>
         ///   Looks up a localized string similar to Creating themes from a Composite Rule with a Compound Symbol is not supported.
         /// </summary>
         internal static string CannotCreateThemeFromCompoundSymbolInstance {

Modified: trunk/Tools/Maestro/Maestro.Editors/Strings.resx
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Strings.resx	2014-05-12 19:16:57 UTC (rev 8129)
+++ trunk/Tools/Maestro/Maestro.Editors/Strings.resx	2014-05-12 19:39:07 UTC (rev 8130)
@@ -1608,4 +1608,7 @@
   <data name="LayerEditorHasErrors" xml:space="preserve">
     <value>Found errors in the Layer Definition. Please check any errors flagged in the editor.</value>
   </data>
+  <data name="CannotCreateThemeForCompositeStyleClassicEditor" xml:space="preserve">
+    <value>Theming composite styles with this editor is not supported</value>
+  </data>
 </root>
\ No newline at end of file



More information about the mapguide-commits mailing list