[mapguide-commits] r6069 - in trunk/Tools/Maestro: Maestro.Editors
Maestro.Editors/LayerDefinition/Vector/Scales
OSGeo.MapGuide.MaestroAPI/ObjectModels
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Mon Aug 15 06:15:07 EDT 2011
Author: jng
Date: 2011-08-15 03:15:07 -0700 (Mon, 15 Aug 2011)
New Revision: 6069
Added:
trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/CompositeStyleListCtrl.Designer.cs
trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/CompositeStyleListCtrl.cs
trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/CompositeStyleListCtrl.resx
Modified:
trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/VectorScaleRangeCtrl.Designer.cs
trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/VectorScaleRangeCtrl.cs
trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/VectorScaleRangeCtrl.resx
trunk/Tools/Maestro/Maestro.Editors/Maestro.Editors.csproj
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/LayerFactory.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/LayerInterfaces.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/VectorLayerDefinitionImpl.cs
Log:
#1776: Add editor support for multiple composite styles per vector scale range
Added: trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/CompositeStyleListCtrl.Designer.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/CompositeStyleListCtrl.Designer.cs (rev 0)
+++ trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/CompositeStyleListCtrl.Designer.cs 2011-08-15 10:15:07 UTC (rev 6069)
@@ -0,0 +1,105 @@
+namespace Maestro.Editors.LayerDefinition.Vector.Scales
+{
+ partial class CompositeStyleListCtrl
+ {
+ /// <summary>
+ /// Required designer variable.
+ /// </summary>
+ private System.ComponentModel.IContainer components = null;
+
+ /// <summary>
+ /// Clean up any resources being used.
+ /// </summary>
+ /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Component Designer generated code
+
+ /// <summary>
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ /// </summary>
+ private void InitializeComponent()
+ {
+ System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CompositeStyleListCtrl));
+ this.splitContainer1 = new System.Windows.Forms.SplitContainer();
+ this.lstStyles = new System.Windows.Forms.ListBox();
+ this.toolStrip1 = new System.Windows.Forms.ToolStrip();
+ this.btnAdd = new System.Windows.Forms.ToolStripButton();
+ this.btnDelete = new System.Windows.Forms.ToolStripButton();
+ this.splitContainer1.Panel1.SuspendLayout();
+ this.splitContainer1.SuspendLayout();
+ this.toolStrip1.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // splitContainer1
+ //
+ resources.ApplyResources(this.splitContainer1, "splitContainer1");
+ this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;
+ this.splitContainer1.Name = "splitContainer1";
+ //
+ // splitContainer1.Panel1
+ //
+ this.splitContainer1.Panel1.Controls.Add(this.lstStyles);
+ this.splitContainer1.Panel1.Controls.Add(this.toolStrip1);
+ //
+ // lstStyles
+ //
+ resources.ApplyResources(this.lstStyles, "lstStyles");
+ this.lstStyles.FormattingEnabled = true;
+ this.lstStyles.Name = "lstStyles";
+ this.lstStyles.SelectedIndexChanged += new System.EventHandler(this.lstStyles_SelectedIndexChanged);
+ //
+ // toolStrip1
+ //
+ this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.btnAdd,
+ this.btnDelete});
+ resources.ApplyResources(this.toolStrip1, "toolStrip1");
+ this.toolStrip1.Name = "toolStrip1";
+ //
+ // btnAdd
+ //
+ this.btnAdd.Image = global::Maestro.Editors.Properties.Resources.plus_circle;
+ resources.ApplyResources(this.btnAdd, "btnAdd");
+ this.btnAdd.Name = "btnAdd";
+ this.btnAdd.Click += new System.EventHandler(this.btnAdd_Click);
+ //
+ // btnDelete
+ //
+ resources.ApplyResources(this.btnDelete, "btnDelete");
+ this.btnDelete.Image = global::Maestro.Editors.Properties.Resources.cross_script;
+ this.btnDelete.Name = "btnDelete";
+ this.btnDelete.Click += new System.EventHandler(this.btnDelete_Click);
+ //
+ // CompositeStyleListCtrl
+ //
+ resources.ApplyResources(this, "$this");
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.Controls.Add(this.splitContainer1);
+ this.Name = "CompositeStyleListCtrl";
+ this.splitContainer1.Panel1.ResumeLayout(false);
+ this.splitContainer1.Panel1.PerformLayout();
+ this.splitContainer1.ResumeLayout(false);
+ this.toolStrip1.ResumeLayout(false);
+ this.toolStrip1.PerformLayout();
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.SplitContainer splitContainer1;
+ private System.Windows.Forms.ListBox lstStyles;
+ private System.Windows.Forms.ToolStrip toolStrip1;
+ private System.Windows.Forms.ToolStripButton btnAdd;
+ private System.Windows.Forms.ToolStripButton btnDelete;
+ }
+}
Added: trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/CompositeStyleListCtrl.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/CompositeStyleListCtrl.cs (rev 0)
+++ trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/CompositeStyleListCtrl.cs 2011-08-15 10:15:07 UTC (rev 6069)
@@ -0,0 +1,117 @@
+#region Disclaimer / License
+// Copyright (C) 2011, 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.ComponentModel;
+using System.Drawing;
+using System.Data;
+using System.Text;
+using System.Windows.Forms;
+using OSGeo.MapGuide.ObjectModels.LayerDefinition;
+
+namespace Maestro.Editors.LayerDefinition.Vector.Scales
+{
+ [ToolboxItem(true)]
+ public partial class CompositeStyleListCtrl : UserControl
+ {
+ public CompositeStyleListCtrl()
+ {
+ InitializeComponent();
+ }
+
+ internal VectorLayerEditorCtrl Owner { get; set; }
+ internal ILayerElementFactory Factory { get; set; }
+
+ private IVectorScaleRange2 _parent;
+ private BindingList<ICompositeTypeStyle> _styles;
+
+ public void Load(IVectorScaleRange2 parent, BindingList<ICompositeTypeStyle> styles)
+ {
+ _parent = parent;
+ foreach (var ctrl in _controls.Values)
+ {
+ ctrl.Dispose();
+ }
+ _controls.Clear();
+ _styles = styles;
+ lstStyles.DataSource = _styles;
+ }
+
+ private Dictionary<ICompositeTypeStyle, ConditionListButtons> _controls = new Dictionary<ICompositeTypeStyle, ConditionListButtons>();
+
+ internal void ResizeAuto()
+ {
+ if (splitContainer1.Panel2.Controls.Count == 1)
+ {
+ var ctrl = splitContainer1.Panel2.Controls[0] as ConditionListButtons;
+ if (ctrl != null)
+ ctrl.ResizeAuto();
+ }
+ }
+
+ private void lstStyles_SelectedIndexChanged(object sender, EventArgs e)
+ {
+ btnDelete.Enabled = false;
+ var style = lstStyles.SelectedItem as ICompositeTypeStyle;
+ if (style != null)
+ {
+ btnDelete.Enabled = true;
+ if (!_controls.ContainsKey(style))
+ {
+ _controls[style] = new ConditionListButtons();
+ _controls[style].Owner = this.Owner;
+ _controls[style].Factory = this.Factory;
+ _controls[style].SetItem(_parent, style);
+
+ if (style.RuleCount == 0)
+ _controls[style].AddRule();
+ }
+
+ SetActiveControl(_controls[style]);
+ }
+ }
+
+ private void SetActiveControl(ConditionListButtons conditionListButtons)
+ {
+ splitContainer1.Panel2.Controls.Clear();
+ conditionListButtons.Dock = DockStyle.Fill;
+ splitContainer1.Panel2.Controls.Add(conditionListButtons);
+ }
+
+ private void btnAdd_Click(object sender, EventArgs e)
+ {
+ _styles.Add(this.Factory.CreateDefaultCompositeStyle());
+ _parent.CompositeStyle = _styles;
+ this.Owner.RaiseResourceChanged();
+ }
+
+ private void btnDelete_Click(object sender, EventArgs e)
+ {
+ var style = lstStyles.SelectedItem as ICompositeTypeStyle;
+ if (style != null)
+ {
+ _styles.Remove(style);
+ _parent.CompositeStyle = _styles;
+ splitContainer1.Panel2.Controls.Clear();
+ this.Owner.RaiseResourceChanged();
+ }
+ }
+ }
+}
Added: trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/CompositeStyleListCtrl.resx
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/CompositeStyleListCtrl.resx (rev 0)
+++ trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/CompositeStyleListCtrl.resx 2011-08-15 10:15:07 UTC (rev 6069)
@@ -0,0 +1,279 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+ <!--
+ Microsoft ResX Schema
+
+ Version 2.0
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
+ associated with the data types.
+
+ Example:
+
+ ... ado.net/XML headers & schema ...
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
+ <resheader name="version">2.0</resheader>
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+ <value>[base64 mime encoded serialized .NET Framework object]</value>
+ </data>
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+ <comment>This is a comment</comment>
+ </data>
+
+ There are any number of "resheader" rows that contain simple
+ name/value pairs.
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
+ mimetype set.
+
+ The mimetype is used for serialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
+ extensible. For a given mimetype the value must be set accordingly:
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
+ read any of the formats listed below.
+
+ mimetype: application/x-microsoft.net.object.binary.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.soap.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.bytearray.base64
+ value : The object must be serialized into a byte array
+ : using a System.ComponentModel.TypeConverter
+ : and then encoded with base64 encoding.
+ -->
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <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>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.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" />
+ <data name="splitContainer1.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" />
+ <data name="splitContainer1.Location" type="System.Drawing.Point, System.Drawing">
+ <value>0, 0</value>
+ </data>
+ <data name="lstStyles.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
+ <value>Fill</value>
+ </data>
+ <data name="lstStyles.Location" type="System.Drawing.Point, System.Drawing">
+ <value>0, 25</value>
+ </data>
+ <data name="lstStyles.Size" type="System.Drawing.Size, System.Drawing">
+ <value>160, 95</value>
+ </data>
+ <assembly alias="mscorlib" name="mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+ <data name="lstStyles.TabIndex" type="System.Int32, mscorlib">
+ <value>1</value>
+ </data>
+ <data name=">>lstStyles.Name" xml:space="preserve">
+ <value>lstStyles</value>
+ </data>
+ <data name=">>lstStyles.Type" xml:space="preserve">
+ <value>System.Windows.Forms.ListBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </data>
+ <data name=">>lstStyles.Parent" xml:space="preserve">
+ <value>splitContainer1.Panel1</value>
+ </data>
+ <data name=">>lstStyles.ZOrder" xml:space="preserve">
+ <value>0</value>
+ </data>
+ <metadata name="toolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <value>0, 0</value>
+ </metadata>
+ <data name="btnAdd.ImageTransparentColor" type="System.Drawing.Color, System.Drawing">
+ <value>Magenta</value>
+ </data>
+ <data name="btnAdd.Size" type="System.Drawing.Size, System.Drawing">
+ <value>49, 22</value>
+ </data>
+ <data name="btnAdd.Text" xml:space="preserve">
+ <value>Add</value>
+ </data>
+ <data name="btnAdd.ToolTipText" xml:space="preserve">
+ <value>Add a Composite Style</value>
+ </data>
+ <data name="btnDelete.Enabled" type="System.Boolean, mscorlib">
+ <value>False</value>
+ </data>
+ <data name="btnDelete.ImageTransparentColor" type="System.Drawing.Color, System.Drawing">
+ <value>Magenta</value>
+ </data>
+ <data name="btnDelete.Size" type="System.Drawing.Size, System.Drawing">
+ <value>60, 22</value>
+ </data>
+ <data name="btnDelete.Text" xml:space="preserve">
+ <value>Delete</value>
+ </data>
+ <data name="btnDelete.ToolTipText" xml:space="preserve">
+ <value>Delete this Composite Style</value>
+ </data>
+ <data name="toolStrip1.Location" type="System.Drawing.Point, System.Drawing">
+ <value>0, 0</value>
+ </data>
+ <data name="toolStrip1.Size" type="System.Drawing.Size, System.Drawing">
+ <value>160, 25</value>
+ </data>
+ <data name="toolStrip1.TabIndex" type="System.Int32, mscorlib">
+ <value>0</value>
+ </data>
+ <data name="toolStrip1.Text" xml:space="preserve">
+ <value>toolStrip1</value>
+ </data>
+ <data name=">>toolStrip1.Name" xml:space="preserve">
+ <value>toolStrip1</value>
+ </data>
+ <data name=">>toolStrip1.Type" xml:space="preserve">
+ <value>System.Windows.Forms.ToolStrip, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </data>
+ <data name=">>toolStrip1.Parent" xml:space="preserve">
+ <value>splitContainer1.Panel1</value>
+ </data>
+ <data name=">>toolStrip1.ZOrder" xml:space="preserve">
+ <value>1</value>
+ </data>
+ <data name=">>splitContainer1.Panel1.Name" xml:space="preserve">
+ <value>splitContainer1.Panel1</value>
+ </data>
+ <data name=">>splitContainer1.Panel1.Type" xml:space="preserve">
+ <value>System.Windows.Forms.SplitterPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </data>
+ <data name=">>splitContainer1.Panel1.Parent" xml:space="preserve">
+ <value>splitContainer1</value>
+ </data>
+ <data name=">>splitContainer1.Panel1.ZOrder" xml:space="preserve">
+ <value>0</value>
+ </data>
+ <data name=">>splitContainer1.Panel2.Name" xml:space="preserve">
+ <value>splitContainer1.Panel2</value>
+ </data>
+ <data name=">>splitContainer1.Panel2.Type" xml:space="preserve">
+ <value>System.Windows.Forms.SplitterPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </data>
+ <data name=">>splitContainer1.Panel2.Parent" xml:space="preserve">
+ <value>splitContainer1</value>
+ </data>
+ <data name=">>splitContainer1.Panel2.ZOrder" xml:space="preserve">
+ <value>1</value>
+ </data>
+ <data name="splitContainer1.Size" type="System.Drawing.Size, System.Drawing">
+ <value>855, 130</value>
+ </data>
+ <data name="splitContainer1.SplitterDistance" type="System.Int32, mscorlib">
+ <value>160</value>
+ </data>
+ <data name="splitContainer1.TabIndex" type="System.Int32, mscorlib">
+ <value>0</value>
+ </data>
+ <data name=">>splitContainer1.Name" xml:space="preserve">
+ <value>splitContainer1</value>
+ </data>
+ <data name=">>splitContainer1.Type" xml:space="preserve">
+ <value>System.Windows.Forms.SplitContainer, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </data>
+ <data name=">>splitContainer1.Parent" xml:space="preserve">
+ <value>$this</value>
+ </data>
+ <data name=">>splitContainer1.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">
+ <value>True</value>
+ </metadata>
+ <data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
+ <value>6, 13</value>
+ </data>
+ <data name="$this.Size" type="System.Drawing.Size, System.Drawing">
+ <value>855, 130</value>
+ </data>
+ <data name=">>btnAdd.Name" xml:space="preserve">
+ <value>btnAdd</value>
+ </data>
+ <data name=">>btnAdd.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=">>btnDelete.Name" xml:space="preserve">
+ <value>btnDelete</value>
+ </data>
+ <data name=">>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=">>$this.Name" xml:space="preserve">
+ <value>CompositeStyleListCtrl</value>
+ </data>
+ <data name=">>$this.Type" xml:space="preserve">
+ <value>System.Windows.Forms.UserControl, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </data>
+</root>
\ No newline at end of file
Modified: trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/VectorScaleRangeCtrl.Designer.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/VectorScaleRangeCtrl.Designer.cs 2011-08-15 06:59:21 UTC (rev 6068)
+++ trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/VectorScaleRangeCtrl.Designer.cs 2011-08-15 10:15:07 UTC (rev 6069)
@@ -33,10 +33,10 @@
this.chkLine = new System.Windows.Forms.CheckBox();
this.chkArea = new System.Windows.Forms.CheckBox();
this.chkComposite = new System.Windows.Forms.CheckBox();
- this.compList = new Maestro.Editors.LayerDefinition.Vector.Scales.ConditionListButtons();
this.areaList = new Maestro.Editors.LayerDefinition.Vector.Scales.ConditionListButtons();
this.lineList = new Maestro.Editors.LayerDefinition.Vector.Scales.ConditionListButtons();
this.pointList = new Maestro.Editors.LayerDefinition.Vector.Scales.ConditionListButtons();
+ this.compList = new Maestro.Editors.LayerDefinition.Vector.Scales.CompositeStyleListCtrl();
this.SuspendLayout();
//
// chkPoint
@@ -67,12 +67,6 @@
this.chkComposite.UseVisualStyleBackColor = true;
this.chkComposite.CheckedChanged += new System.EventHandler(this.chkComposite_CheckedChanged);
//
- // compList
- //
- resources.ApplyResources(this.compList, "compList");
- this.compList.Name = "compList";
- this.compList.ItemChanged += new System.EventHandler(this.OnItemChanged);
- //
// areaList
//
resources.ApplyResources(this.areaList, "areaList");
@@ -91,6 +85,11 @@
this.pointList.Name = "pointList";
this.pointList.ItemChanged += new System.EventHandler(this.OnItemChanged);
//
+ // compList
+ //
+ resources.ApplyResources(this.compList, "compList");
+ this.compList.Name = "compList";
+ //
// VectorScaleRangeCtrl
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
@@ -117,7 +116,7 @@
private System.Windows.Forms.CheckBox chkArea;
private ConditionListButtons areaList;
private System.Windows.Forms.CheckBox chkComposite;
- private ConditionListButtons compList;
+ private CompositeStyleListCtrl compList;
}
Modified: trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/VectorScaleRangeCtrl.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/VectorScaleRangeCtrl.cs 2011-08-15 06:59:21 UTC (rev 6068)
+++ trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/VectorScaleRangeCtrl.cs 2011-08-15 10:15:07 UTC (rev 6069)
@@ -34,7 +34,7 @@
private IPointVectorStyle _pts;
private ILineVectorStyle _lns;
private IAreaVectorStyle _ars;
- private ICompositeTypeStyle _cts;
+ private BindingList<ICompositeTypeStyle> _cts;
private VectorLayerStyleSectionCtrl _parent;
@@ -97,17 +97,18 @@
var vsr2 = vsr as IVectorScaleRange2;
if (vsr2 != null)
{
- _cts = vsr2.CompositeStyle;
- chkComposite.Checked = (_cts != null);
+ _cts = new BindingList<ICompositeTypeStyle>();
+ foreach (var c in vsr2.CompositeStyle)
+ _cts.Add(c);
+ chkComposite.Checked = (_cts.Count > 0);
+
compList.Owner = parent.Owner;
compList.Factory = parent.Factory;
- if (_cts == null)
- _cts = parent.Factory.CreateDefaultCompositeStyle();
+ if (_cts.Count == 0)
+ _cts.Add(parent.Factory.CreateDefaultCompositeStyle());
- compList.SetItem(vsr, _cts);
- if (_cts.RuleCount == 0)
- compList.AddRule();
+ compList.Load(vsr2, _cts);
}
else
{
Modified: trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/VectorScaleRangeCtrl.resx
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/VectorScaleRangeCtrl.resx 2011-08-15 06:59:21 UTC (rev 6068)
+++ trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/VectorScaleRangeCtrl.resx 2011-08-15 10:15:07 UTC (rev 6069)
@@ -214,7 +214,7 @@
<value>6</value>
</data>
<data name="chkComposite.Text" xml:space="preserve">
- <value>Display Composite</value>
+ <value>Display Composite (Note: Previews currently not supported)</value>
</data>
<data name=">>chkComposite.Name" xml:space="preserve">
<value>chkComposite</value>
@@ -228,30 +228,6 @@
<data name=">>chkComposite.ZOrder" xml:space="preserve">
<value>1</value>
</data>
- <data name="compList.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
- <value>Fill</value>
- </data>
- <data name="compList.Location" type="System.Drawing.Point, System.Drawing">
- <value>0, 387</value>
- </data>
- <data name="compList.Size" type="System.Drawing.Size, System.Drawing">
- <value>598, 108</value>
- </data>
- <data name="compList.TabIndex" type="System.Int32, mscorlib">
- <value>7</value>
- </data>
- <data name=">>compList.Name" xml:space="preserve">
- <value>compList</value>
- </data>
- <data name=">>compList.Type" xml:space="preserve">
- <value>Maestro.Editors.LayerDefinition.Vector.Scales.ConditionListButtons, Maestro.Editors, Version=3.1.0.5859, Culture=neutral, PublicKeyToken=null</value>
- </data>
- <data name=">>compList.Parent" xml:space="preserve">
- <value>$this</value>
- </data>
- <data name=">>compList.ZOrder" xml:space="preserve">
- <value>0</value>
- </data>
<data name="areaList.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Top</value>
</data>
@@ -268,7 +244,7 @@
<value>areaList</value>
</data>
<data name=">>areaList.Type" xml:space="preserve">
- <value>Maestro.Editors.LayerDefinition.Vector.Scales.ConditionListButtons, Maestro.Editors, Version=3.1.0.5859, Culture=neutral, PublicKeyToken=null</value>
+ <value>Maestro.Editors.LayerDefinition.Vector.Scales.ConditionListButtons, Maestro.Editors, Version=3.5.0.6040, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name=">>areaList.Parent" xml:space="preserve">
<value>$this</value>
@@ -292,7 +268,7 @@
<value>lineList</value>
</data>
<data name=">>lineList.Type" xml:space="preserve">
- <value>Maestro.Editors.LayerDefinition.Vector.Scales.ConditionListButtons, Maestro.Editors, Version=3.1.0.5859, Culture=neutral, PublicKeyToken=null</value>
+ <value>Maestro.Editors.LayerDefinition.Vector.Scales.ConditionListButtons, Maestro.Editors, Version=3.5.0.6040, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name=">>lineList.Parent" xml:space="preserve">
<value>$this</value>
@@ -316,7 +292,7 @@
<value>pointList</value>
</data>
<data name=">>pointList.Type" xml:space="preserve">
- <value>Maestro.Editors.LayerDefinition.Vector.Scales.ConditionListButtons, Maestro.Editors, Version=3.1.0.5859, Culture=neutral, PublicKeyToken=null</value>
+ <value>Maestro.Editors.LayerDefinition.Vector.Scales.ConditionListButtons, Maestro.Editors, Version=3.5.0.6040, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name=">>pointList.Parent" xml:space="preserve">
<value>$this</value>
@@ -324,6 +300,30 @@
<data name=">>pointList.ZOrder" xml:space="preserve">
<value>6</value>
</data>
+ <data name="compList.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
+ <value>Fill</value>
+ </data>
+ <data name="compList.Location" type="System.Drawing.Point, System.Drawing">
+ <value>0, 387</value>
+ </data>
+ <data name="compList.Size" type="System.Drawing.Size, System.Drawing">
+ <value>598, 108</value>
+ </data>
+ <data name="compList.TabIndex" type="System.Int32, mscorlib">
+ <value>7</value>
+ </data>
+ <data name=">>compList.Name" xml:space="preserve">
+ <value>compList</value>
+ </data>
+ <data name=">>compList.Type" xml:space="preserve">
+ <value>Maestro.Editors.LayerDefinition.Vector.Scales.CompositeStyleListCtrl, Maestro.Editors, Version=3.5.0.6040, Culture=neutral, PublicKeyToken=null</value>
+ </data>
+ <data name=">>compList.Parent" xml:space="preserve">
+ <value>$this</value>
+ </data>
+ <data name=">>compList.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">
<value>True</value>
</metadata>
Modified: trunk/Tools/Maestro/Maestro.Editors/Maestro.Editors.csproj
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Maestro.Editors.csproj 2011-08-15 06:59:21 UTC (rev 6068)
+++ trunk/Tools/Maestro/Maestro.Editors/Maestro.Editors.csproj 2011-08-15 10:15:07 UTC (rev 6069)
@@ -657,6 +657,12 @@
<DependentUpon>VectorLayerEditorCtrl.cs</DependentUpon>
</Compile>
<Compile Include="LayerDefinition\Vector\FeaturePreviewRender.cs" />
+ <Compile Include="LayerDefinition\Vector\Scales\CompositeStyleListCtrl.cs">
+ <SubType>UserControl</SubType>
+ </Compile>
+ <Compile Include="LayerDefinition\Vector\Scales\CompositeStyleListCtrl.Designer.cs">
+ <DependentUpon>CompositeStyleListCtrl.cs</DependentUpon>
+ </Compile>
<Compile Include="LayerDefinition\Vector\Scales\Condition.cs">
<SubType>UserControl</SubType>
</Compile>
@@ -2184,6 +2190,9 @@
<Content Include="OdbcDriverMap.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
+ <EmbeddedResource Include="LayerDefinition\Vector\Scales\CompositeStyleListCtrl.resx">
+ <DependentUpon>CompositeStyleListCtrl.cs</DependentUpon>
+ </EmbeddedResource>
<EmbeddedResource Include="MapDefinition\ExtentCalculationDialog.resx">
<DependentUpon>ExtentCalculationDialog.cs</DependentUpon>
</EmbeddedResource>
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/LayerFactory.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/LayerFactory.cs 2011-08-15 06:59:21 UTC (rev 6068)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/LayerFactory.cs 2011-08-15 10:15:07 UTC (rev 6069)
@@ -68,22 +68,23 @@
var vsr2 = vsr as IVectorScaleRange2;
if (vsr2 != null)
{
- //FIXME: API is designed on wrong assumptions.
- //http://trac.osgeo.org/mapguide/ticket/1776
- var cts = vsr2.CompositeStyle;
- if (cts != null)
+ var ctss = vsr2.CompositeStyle;
+ if (ctss != null)
{
- foreach (var crs in cts.CompositeRule)
+ foreach (var cts in ctss)
{
- var csym = crs.CompositeSymbolization;
- if (csym != null)
+ foreach (var crs in cts.CompositeRule)
{
- foreach (var si in csym.SymbolInstance)
+ var csym = crs.CompositeSymbolization;
+ if (csym != null)
{
- if (si.Reference.Type == OSGeo.MapGuide.ObjectModels.SymbolDefinition.SymbolInstanceType.Inline)
+ foreach (var si in csym.SymbolInstance)
{
- var symBase = ((ISymbolInstanceReferenceInline)si.Reference).SymbolDefinition;
- symBase.RemoveSchemaAttributes();
+ if (si.Reference.Type == OSGeo.MapGuide.ObjectModels.SymbolDefinition.SymbolInstanceType.Inline)
+ {
+ var symBase = ((ISymbolInstanceReferenceInline)si.Reference).SymbolDefinition;
+ symBase.RemoveSchemaAttributes();
+ }
}
}
}
@@ -137,7 +138,7 @@
PointStyle = CreateDefaultPointStyle(),
#if LDF_100 || LDF_110
#else
- CompositeStyle = CreateDefaultCompositeStyle()
+ CompositeStyle = new ICompositeTypeStyle[] { CreateDefaultCompositeStyle() }
#endif
};
vl.VectorScaleRange.Add(defaultRange);
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/LayerInterfaces.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/LayerInterfaces.cs 2011-08-15 06:59:21 UTC (rev 6068)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/LayerInterfaces.cs 2011-08-15 10:15:07 UTC (rev 6069)
@@ -623,9 +623,9 @@
IElevationSettings ElevationSettings { get; set; }
/// <summary>
- /// Gets or sets the composite style for this scale range
+ /// Gets or sets the composite styles for this scale range
/// </summary>
- ICompositeTypeStyle CompositeStyle { get; set; }
+ IEnumerable<ICompositeTypeStyle> CompositeStyle { get; set; }
}
/// <summary>
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/VectorLayerDefinitionImpl.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/VectorLayerDefinitionImpl.cs 2011-08-15 06:59:21 UTC (rev 6068)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/VectorLayerDefinitionImpl.cs 2011-08-15 10:15:07 UTC (rev 6069)
@@ -286,62 +286,81 @@
#if LDF_110 || LDF_120
[XmlIgnore]
- public ICompositeTypeStyle CompositeStyle
+ public IEnumerable<ICompositeTypeStyle> CompositeStyle
{
get
{
foreach (var item in this.itemsField)
{
if (typeof(ICompositeTypeStyle).IsAssignableFrom(item.GetType()))
- return (ICompositeTypeStyle)item;
+ yield return (ICompositeTypeStyle)item;
}
-
- return null;
}
set
{
- //Remove old one if it exists
- var item = this.CompositeStyle;
- if (item != null)
+ //Clear old ones
+ var remove = new List<object>();
+ foreach (var item in this.itemsField)
{
- this.itemsField.Remove(item);
+ if (typeof(ICompositeTypeStyle).IsAssignableFrom(item.GetType()))
+ remove.Add(item);
}
- //Put the new one in if it is not null
+
+ foreach(var obj in remove)
+ {
+ this.itemsField.Remove(obj);
+ }
+
+ //Put the new ones in if it is not null
if (value != null)
{
- this.itemsField.Add(value);
+ foreach (var item in value)
+ {
+ if (!typeof(ICompositeTypeStyle).IsAssignableFrom(item.GetType()))
+ throw new InvalidOperationException("Assigned value does not implement ICompositeTypeStyle");
+
+ this.itemsField.Add(item);
+ }
}
}
}
#elif LDF_130 || LDF_230
[XmlIgnore]
- public ICompositeTypeStyle CompositeStyle
+ public IEnumerable<ICompositeTypeStyle> CompositeStyle
{
get
{
foreach (var item in this.itemsField)
{
if (typeof(ICompositeTypeStyle2).IsAssignableFrom(item.GetType()))
- return (ICompositeTypeStyle2)item;
+ yield return (ICompositeTypeStyle2)item;
}
-
- return null;
}
set
{
- //Remove old one if it exists
- var item = this.CompositeStyle;
- if (item != null)
+ //Clear old ones
+ var remove = new List<object>();
+ foreach (var item in this.itemsField)
{
- this.itemsField.Remove(item);
+ if (typeof(ICompositeTypeStyle2).IsAssignableFrom(item.GetType()))
+ remove.Add(item);
}
- //Put the new one in if it is not null
+
+ foreach(var obj in remove)
+ {
+ this.itemsField.Remove(obj);
+ }
+
+ //Put the new ones in if it is not null
if (value != null)
{
- if (!typeof(ICompositeTypeStyle2).IsAssignableFrom(value.GetType()))
- throw new InvalidOperationException("Assigned value does not implement ICompositeTypeStyle2");
+ foreach (var item in value)
+ {
+ if (!typeof(ICompositeTypeStyle2).IsAssignableFrom(item.GetType()))
+ throw new InvalidOperationException("Assigned value does not implement ICompositeTypeStyle2");
- this.itemsField.Add(value);
+ this.itemsField.Add(item);
+ }
}
}
}
More information about the mapguide-commits
mailing list