[mapguide-commits] r5968 - in trunk/Tools/Maestro: Generated Maestro.Editors Maestro.Editors/WatermarkDefinition OSGeo.MapGuide.MaestroAPI/ObjectModels

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Tue Jul 5 10:01:36 EDT 2011


Author: jng
Date: 2011-07-05 07:01:35 -0700 (Tue, 05 Jul 2011)
New Revision: 5968

Added:
   trunk/Tools/Maestro/Maestro.Editors/WatermarkDefinition/WatermarkContentCtrl.Designer.cs
   trunk/Tools/Maestro/Maestro.Editors/WatermarkDefinition/WatermarkContentCtrl.cs
   trunk/Tools/Maestro/Maestro.Editors/WatermarkDefinition/WatermarkContentCtrl.resx
Modified:
   trunk/Tools/Maestro/Generated/SymbolDefinition-1.0.0.designer.cs
   trunk/Tools/Maestro/Generated/SymbolDefinition-1.1.0.designer.cs
   trunk/Tools/Maestro/Maestro.Editors/Maestro.Editors.csproj
   trunk/Tools/Maestro/Maestro.Editors/WatermarkDefinition/TilePositionEditor.cs
   trunk/Tools/Maestro/Maestro.Editors/WatermarkDefinition/WatermarkCollectionEditorCtrl.Designer.cs
   trunk/Tools/Maestro/Maestro.Editors/WatermarkDefinition/WatermarkCollectionEditorCtrl.cs
   trunk/Tools/Maestro/Maestro.Editors/WatermarkDefinition/WatermarkCollectionEditorCtrl.resx
   trunk/Tools/Maestro/Maestro.Editors/WatermarkDefinition/WatermarkEditorCtrl.Designer.cs
   trunk/Tools/Maestro/Maestro.Editors/WatermarkDefinition/WatermarkEditorCtrl.cs
   trunk/Tools/Maestro/Maestro.Editors/WatermarkDefinition/WatermarkEditorCtrl.resx
   trunk/Tools/Maestro/Maestro.Editors/WatermarkDefinition/WatermarkInstanceEditor.cs
   trunk/Tools/Maestro/Maestro.Editors/WatermarkDefinition/WatermarkSettingsCtrl.cs
   trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/SymbolDefinition.cs
   trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/SymbolInterfaces.cs
Log:
#1707: Change the watermark content editor to be a simple text/image element settings editor instead of being a literal symbol definition editor (on the assumption that MapGuide will probably not even utilise the whole feature set of the Symbol Definition when used in a watermark context)


Modified: trunk/Tools/Maestro/Generated/SymbolDefinition-1.0.0.designer.cs
===================================================================
--- trunk/Tools/Maestro/Generated/SymbolDefinition-1.0.0.designer.cs	2011-07-05 12:08:46 UTC (rev 5967)
+++ trunk/Tools/Maestro/Generated/SymbolDefinition-1.0.0.designer.cs	2011-07-05 14:01:35 UTC (rev 5968)
@@ -3124,7 +3124,7 @@
         private static System.Xml.Serialization.XmlSerializer serializer;
         
         public GraphicBase() {
-            this.resizeControlField = "\'ResizeNone\'";
+            //this.resizeControlField = "\'ResizeNone\'";
         }
         
         //[System.ComponentModel.DefaultValueAttribute("\'ResizeNone\'")]

Modified: trunk/Tools/Maestro/Generated/SymbolDefinition-1.1.0.designer.cs
===================================================================
--- trunk/Tools/Maestro/Generated/SymbolDefinition-1.1.0.designer.cs	2011-07-05 12:08:46 UTC (rev 5967)
+++ trunk/Tools/Maestro/Generated/SymbolDefinition-1.1.0.designer.cs	2011-07-05 14:01:35 UTC (rev 5968)
@@ -3120,7 +3120,7 @@
         private static System.Xml.Serialization.XmlSerializer serializer;
         
         public GraphicBase() {
-            this.resizeControlField = "\'ResizeNone\'";
+            //this.resizeControlField = "\'ResizeNone\'";
         }
         
         //[System.ComponentModel.DefaultValueAttribute("\'ResizeNone\'")]

Modified: trunk/Tools/Maestro/Maestro.Editors/Maestro.Editors.csproj
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Maestro.Editors.csproj	2011-07-05 12:08:46 UTC (rev 5967)
+++ trunk/Tools/Maestro/Maestro.Editors/Maestro.Editors.csproj	2011-07-05 14:01:35 UTC (rev 5968)
@@ -1019,6 +1019,12 @@
     <Compile Include="WatermarkDefinition\WatermarkCollectionEditorCtrl.Designer.cs">
       <DependentUpon>WatermarkCollectionEditorCtrl.cs</DependentUpon>
     </Compile>
+    <Compile Include="WatermarkDefinition\WatermarkContentCtrl.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="WatermarkDefinition\WatermarkContentCtrl.Designer.cs">
+      <DependentUpon>WatermarkContentCtrl.cs</DependentUpon>
+    </Compile>
     <Compile Include="WatermarkDefinition\WatermarkEditorCtrl.cs">
       <SubType>UserControl</SubType>
     </Compile>
@@ -2382,6 +2388,9 @@
     <EmbeddedResource Include="Resources\points\star.png" />
     <EmbeddedResource Include="Resources\points\triangle.png" />
     <EmbeddedResource Include="Resources\points\x.png" />
+    <EmbeddedResource Include="WatermarkDefinition\WatermarkContentCtrl.resx">
+      <DependentUpon>WatermarkContentCtrl.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="WatermarkDefinition\WatermarkSettingsCtrl.resx">
       <DependentUpon>WatermarkSettingsCtrl.cs</DependentUpon>
     </EmbeddedResource>

Modified: trunk/Tools/Maestro/Maestro.Editors/WatermarkDefinition/TilePositionEditor.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/WatermarkDefinition/TilePositionEditor.cs	2011-07-05 12:08:46 UTC (rev 5967)
+++ trunk/Tools/Maestro/Maestro.Editors/WatermarkDefinition/TilePositionEditor.cs	2011-07-05 14:01:35 UTC (rev 5968)
@@ -39,15 +39,15 @@
             InitializeComponent();
             _pos = pos;
 
-            cmbHorizontalAlignment.DataSource = Enum.GetValues(typeof(HorizontalAlignmentType));
-            cmbVerticalAlignment.DataSource = Enum.GetValues(typeof(VerticalAlignmentType));
-            cmbHorizontalUnits.DataSource = Enum.GetValues(typeof(UnitType));
-            cmbVerticalUnits.DataSource = Enum.GetValues(typeof(UnitType));
-
             try
             {
                 _init = true;
 
+                cmbHorizontalAlignment.DataSource = Enum.GetValues(typeof(HorizontalAlignmentType));
+                cmbVerticalAlignment.DataSource = Enum.GetValues(typeof(VerticalAlignmentType));
+                cmbHorizontalUnits.DataSource = Enum.GetValues(typeof(UnitType));
+                cmbVerticalUnits.DataSource = Enum.GetValues(typeof(UnitType));
+
                 numTileWidth.Value = Convert.ToDecimal(_pos.TileWidth);
                 numTileHeight.Value = Convert.ToDecimal(_pos.TileHeight);
 

Modified: trunk/Tools/Maestro/Maestro.Editors/WatermarkDefinition/WatermarkCollectionEditorCtrl.Designer.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/WatermarkDefinition/WatermarkCollectionEditorCtrl.Designer.cs	2011-07-05 12:08:46 UTC (rev 5967)
+++ trunk/Tools/Maestro/Maestro.Editors/WatermarkDefinition/WatermarkCollectionEditorCtrl.Designer.cs	2011-07-05 14:01:35 UTC (rev 5968)
@@ -88,9 +88,11 @@
             resources.ApplyResources(this.grdWatermarks, "grdWatermarks");
             this.grdWatermarks.Name = "grdWatermarks";
             this.grdWatermarks.ReadOnly = true;
+            this.grdWatermarks.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.grdWatermarks_CellClick);
             // 
             // COL_NAME
             // 
+            this.COL_NAME.DataPropertyName = "Name";
             resources.ApplyResources(this.COL_NAME, "COL_NAME");
             this.COL_NAME.Name = "COL_NAME";
             this.COL_NAME.ReadOnly = true;
@@ -98,6 +100,7 @@
             // COL_RESID
             // 
             this.COL_RESID.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
+            this.COL_RESID.DataPropertyName = "ResourceId";
             resources.ApplyResources(this.COL_RESID, "COL_RESID");
             this.COL_RESID.Name = "COL_RESID";
             this.COL_RESID.ReadOnly = true;
@@ -105,9 +108,8 @@
             // WatermarkCollectionEditorCtrl
             // 
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
-            this.HeaderText = "Watermarks";
+            resources.ApplyResources(this, "$this");
             this.Name = "WatermarkCollectionEditorCtrl";
-            resources.ApplyResources(this, "$this");
             this.contentPanel.ResumeLayout(false);
             this.contentPanel.PerformLayout();
             this.toolStrip1.ResumeLayout(false);
@@ -120,11 +122,11 @@
         #endregion
 
         private System.Windows.Forms.DataGridView grdWatermarks;
-        private System.Windows.Forms.DataGridViewTextBoxColumn COL_NAME;
-        private System.Windows.Forms.DataGridViewTextBoxColumn COL_RESID;
         private System.Windows.Forms.ToolStrip toolStrip1;
         private System.Windows.Forms.ToolStripButton btnAdd;
         private System.Windows.Forms.ToolStripButton btnEdit;
         private System.Windows.Forms.ToolStripButton btnRemove;
+        private System.Windows.Forms.DataGridViewTextBoxColumn COL_NAME;
+        private System.Windows.Forms.DataGridViewTextBoxColumn COL_RESID;
     }
 }

Modified: trunk/Tools/Maestro/Maestro.Editors/WatermarkDefinition/WatermarkCollectionEditorCtrl.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/WatermarkDefinition/WatermarkCollectionEditorCtrl.cs	2011-07-05 12:08:46 UTC (rev 5967)
+++ trunk/Tools/Maestro/Maestro.Editors/WatermarkDefinition/WatermarkCollectionEditorCtrl.cs	2011-07-05 14:01:35 UTC (rev 5968)
@@ -98,5 +98,15 @@
                 }
             }
         }
+
+        private void grdWatermarks_CellClick(object sender, DataGridViewCellEventArgs e)
+        {
+            btnEdit.Enabled = btnRemove.Enabled = false;
+            if (e.RowIndex >= 0)
+            {
+                grdWatermarks.Rows[e.RowIndex].Selected = true;
+                btnEdit.Enabled = btnRemove.Enabled = true;
+            }
+        }
     }
 }

Modified: trunk/Tools/Maestro/Maestro.Editors/WatermarkDefinition/WatermarkCollectionEditorCtrl.resx
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/WatermarkDefinition/WatermarkCollectionEditorCtrl.resx	2011-07-05 12:08:46 UTC (rev 5967)
+++ trunk/Tools/Maestro/Maestro.Editors/WatermarkDefinition/WatermarkCollectionEditorCtrl.resx	2011-07-05 14:01:35 UTC (rev 5968)
@@ -162,39 +162,6 @@
   <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="btnEdit.Enabled" type="System.Boolean, mscorlib">
-    <value>False</value>
-  </data>
-  <data name="btnEdit.ImageTransparentColor" type="System.Drawing.Color, System.Drawing">
-    <value>Magenta</value>
-  </data>
-  <data name="btnEdit.Size" type="System.Drawing.Size, System.Drawing">
-    <value>47, 22</value>
-  </data>
-  <data name="btnEdit.Text" xml:space="preserve">
-    <value>Edit</value>
-  </data>
-  <data name="btnRemove.Enabled" type="System.Boolean, mscorlib">
-    <value>False</value>
-  </data>
-  <data name="btnRemove.ImageTransparentColor" type="System.Drawing.Color, System.Drawing">
-    <value>Magenta</value>
-  </data>
-  <data name="btnRemove.Size" type="System.Drawing.Size, System.Drawing">
-    <value>70, 22</value>
-  </data>
-  <data name="btnRemove.Text" xml:space="preserve">
-    <value>Remove</value>
-  </data>
   <data name="toolStrip1.Location" type="System.Drawing.Point, System.Drawing">
     <value>0, 0</value>
   </data>
@@ -234,9 +201,45 @@
   <data name="&gt;&gt;contentPanel.ZOrder" xml:space="preserve">
     <value>0</value>
   </data>
+  <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="btnEdit.Enabled" type="System.Boolean, mscorlib">
+    <value>False</value>
+  </data>
+  <data name="btnEdit.ImageTransparentColor" type="System.Drawing.Color, System.Drawing">
+    <value>Magenta</value>
+  </data>
+  <data name="btnEdit.Size" type="System.Drawing.Size, System.Drawing">
+    <value>47, 22</value>
+  </data>
+  <data name="btnEdit.Text" xml:space="preserve">
+    <value>Edit</value>
+  </data>
+  <data name="btnRemove.Enabled" type="System.Boolean, mscorlib">
+    <value>False</value>
+  </data>
+  <data name="btnRemove.ImageTransparentColor" type="System.Drawing.Color, System.Drawing">
+    <value>Magenta</value>
+  </data>
+  <data name="btnRemove.Size" type="System.Drawing.Size, System.Drawing">
+    <value>70, 22</value>
+  </data>
+  <data name="btnRemove.Text" xml:space="preserve">
+    <value>Remove</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.HeaderText" xml:space="preserve">
+    <value>Watermarks</value>
+  </data>
   <data name="$this.Size" type="System.Drawing.Size, System.Drawing">
     <value>666, 145</value>
   </data>

Added: trunk/Tools/Maestro/Maestro.Editors/WatermarkDefinition/WatermarkContentCtrl.Designer.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/WatermarkDefinition/WatermarkContentCtrl.Designer.cs	                        (rev 0)
+++ trunk/Tools/Maestro/Maestro.Editors/WatermarkDefinition/WatermarkContentCtrl.Designer.cs	2011-07-05 14:01:35 UTC (rev 5968)
@@ -0,0 +1,107 @@
+namespace Maestro.Editors.WatermarkDefinition
+{
+    partial class WatermarkContentCtrl
+    {
+        /// <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(WatermarkContentCtrl));
+            this.rdText = new System.Windows.Forms.RadioButton();
+            this.rdImage = new System.Windows.Forms.RadioButton();
+            this.groupBox1 = new System.Windows.Forms.GroupBox();
+            this.btnEditText = new System.Windows.Forms.Button();
+            this.btnEditImage = new System.Windows.Forms.Button();
+            this.contentPanel.SuspendLayout();
+            this.groupBox1.SuspendLayout();
+            this.SuspendLayout();
+            // 
+            // contentPanel
+            // 
+            this.contentPanel.Controls.Add(this.groupBox1);
+            resources.ApplyResources(this.contentPanel, "contentPanel");
+            // 
+            // rdText
+            // 
+            resources.ApplyResources(this.rdText, "rdText");
+            this.rdText.Name = "rdText";
+            this.rdText.TabStop = true;
+            this.rdText.UseVisualStyleBackColor = true;
+            this.rdText.CheckedChanged += new System.EventHandler(this.wmdTypeCheckedChanged);
+            // 
+            // rdImage
+            // 
+            resources.ApplyResources(this.rdImage, "rdImage");
+            this.rdImage.Name = "rdImage";
+            this.rdImage.TabStop = true;
+            this.rdImage.UseVisualStyleBackColor = true;
+            this.rdImage.CheckedChanged += new System.EventHandler(this.wmdTypeCheckedChanged);
+            // 
+            // groupBox1
+            // 
+            this.groupBox1.Controls.Add(this.btnEditImage);
+            this.groupBox1.Controls.Add(this.btnEditText);
+            this.groupBox1.Controls.Add(this.rdText);
+            this.groupBox1.Controls.Add(this.rdImage);
+            resources.ApplyResources(this.groupBox1, "groupBox1");
+            this.groupBox1.Name = "groupBox1";
+            this.groupBox1.TabStop = false;
+            // 
+            // btnEditText
+            // 
+            resources.ApplyResources(this.btnEditText, "btnEditText");
+            this.btnEditText.Name = "btnEditText";
+            this.btnEditText.UseVisualStyleBackColor = true;
+            this.btnEditText.Click += new System.EventHandler(this.btnEditText_Click);
+            // 
+            // btnEditImage
+            // 
+            resources.ApplyResources(this.btnEditImage, "btnEditImage");
+            this.btnEditImage.Name = "btnEditImage";
+            this.btnEditImage.UseVisualStyleBackColor = true;
+            this.btnEditImage.Click += new System.EventHandler(this.btnEditImage_Click);
+            // 
+            // WatermarkContentCtrl
+            // 
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
+            resources.ApplyResources(this, "$this");
+            this.Name = "WatermarkContentCtrl";
+            this.contentPanel.ResumeLayout(false);
+            this.groupBox1.ResumeLayout(false);
+            this.groupBox1.PerformLayout();
+            this.ResumeLayout(false);
+
+        }
+
+        #endregion
+
+        private System.Windows.Forms.GroupBox groupBox1;
+        private System.Windows.Forms.RadioButton rdText;
+        private System.Windows.Forms.RadioButton rdImage;
+        private System.Windows.Forms.Button btnEditImage;
+        private System.Windows.Forms.Button btnEditText;
+
+    }
+}

Added: trunk/Tools/Maestro/Maestro.Editors/WatermarkDefinition/WatermarkContentCtrl.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/WatermarkDefinition/WatermarkContentCtrl.cs	                        (rev 0)
+++ trunk/Tools/Maestro/Maestro.Editors/WatermarkDefinition/WatermarkContentCtrl.cs	2011-07-05 14:01:35 UTC (rev 5968)
@@ -0,0 +1,136 @@
+#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 Maestro.Editors.Common;
+using OSGeo.MapGuide.ObjectModels.WatermarkDefinition;
+using OSGeo.MapGuide.ObjectModels.SymbolDefinition;
+using Maestro.Editors.SymbolDefinition.GraphicsEditors;
+
+namespace Maestro.Editors.WatermarkDefinition
+{
+    [ToolboxItem(true)]
+    public partial class WatermarkContentCtrl : EditorBindableCollapsiblePanel
+    {
+        public WatermarkContentCtrl()
+        {
+            InitializeComponent();
+        }
+
+        private IWatermarkDefinition _wmd;
+        private ISimpleSymbolDefinition _sym;
+
+        private ITextGraphic _text;
+        private IImageGraphic _image;
+
+        private bool _init = false;
+
+        public override void Bind(IEditorService service)
+        {
+            service.RegisterCustomNotifier(this);
+            _init = true;
+            try
+            {
+                _wmd = (IWatermarkDefinition)service.GetEditedResource();
+                _sym = (ISimpleSymbolDefinition)_wmd.Content;
+
+                //NOTE: We are assuming there is only one graphic element here.
+                foreach (var g in _sym.Graphics)
+                {
+                    if (g.Type == GraphicElementType.Text)
+                        _text = (ITextGraphic)g;
+                    else if (g.Type == GraphicElementType.Image)
+                        _image = (IImageGraphic)g;
+                }
+
+                if (_text != null || _image != null)
+                {
+                    if (_text != null)
+                        rdText.Checked = true;
+                    else if (_image != null)
+                        rdImage.Checked = true;
+
+                    CheckEditStates();
+                }
+                else
+                {
+                    //Text, I choose you
+                    rdText.Checked = true;
+                    CheckEditStates();
+                    
+                    _text = _sym.CreateTextGraphics();
+                    _image = _sym.CreateImageGraphics();
+                    SetActiveGraphicElement(_text);
+                }
+            }
+            finally
+            {
+                _init = false;
+            }
+        }
+
+        private void wmdTypeCheckedChanged(object sender, EventArgs e)
+        {
+            if (_init)
+                return;
+
+            CheckEditStates();
+            if (rdText.Checked)
+                SetActiveGraphicElement(_text);
+            else if (rdImage.Checked)
+                SetActiveGraphicElement(_image);
+        }
+
+        private void CheckEditStates()
+        {
+            btnEditImage.Enabled = btnEditText.Enabled = false;
+            if (rdText.Checked)
+                btnEditText.Enabled = true;
+            else if (rdImage.Checked)
+                btnEditImage.Enabled = true;
+        }
+
+        private void SetActiveGraphicElement(IGraphicBase g)
+        {
+            _sym.ClearGraphics();
+            _sym.AddGraphics(g);
+            OnResourceChanged();
+        }
+
+        private void btnEditText_Click(object sender, EventArgs e)
+        {
+            var diag = new TextDialog(this, _sym, _text);
+            diag.ShowDialog(this);
+            OnResourceChanged();
+        }
+
+        private void btnEditImage_Click(object sender, EventArgs e)
+        {
+            var diag = new ImageDialog(this, _sym, _image);
+            diag.ShowDialog(this);
+            OnResourceChanged();
+        }
+    }
+}

Added: trunk/Tools/Maestro/Maestro.Editors/WatermarkDefinition/WatermarkContentCtrl.resx
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/WatermarkDefinition/WatermarkContentCtrl.resx	                        (rev 0)
+++ trunk/Tools/Maestro/Maestro.Editors/WatermarkDefinition/WatermarkContentCtrl.resx	2011-07-05 14:01:35 UTC (rev 5968)
@@ -0,0 +1,285 @@
+<?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.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+  <data name="btnEditImage.Location" type="System.Drawing.Point, System.Drawing">
+    <value>161, 65</value>
+  </data>
+  <data name="btnEditImage.Size" type="System.Drawing.Size, System.Drawing">
+    <value>75, 23</value>
+  </data>
+  <assembly alias="mscorlib" name="mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+  <data name="btnEditImage.TabIndex" type="System.Int32, mscorlib">
+    <value>5</value>
+  </data>
+  <data name="btnEditImage.Text" xml:space="preserve">
+    <value>Edit</value>
+  </data>
+  <data name="&gt;&gt;btnEditImage.Name" xml:space="preserve">
+    <value>btnEditImage</value>
+  </data>
+  <data name="&gt;&gt;btnEditImage.Type" xml:space="preserve">
+    <value>System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </data>
+  <data name="&gt;&gt;btnEditImage.Parent" xml:space="preserve">
+    <value>groupBox1</value>
+  </data>
+  <data name="&gt;&gt;btnEditImage.ZOrder" xml:space="preserve">
+    <value>0</value>
+  </data>
+  <data name="btnEditText.Location" type="System.Drawing.Point, System.Drawing">
+    <value>161, 29</value>
+  </data>
+  <data name="btnEditText.Size" type="System.Drawing.Size, System.Drawing">
+    <value>75, 23</value>
+  </data>
+  <data name="btnEditText.TabIndex" type="System.Int32, mscorlib">
+    <value>4</value>
+  </data>
+  <data name="btnEditText.Text" xml:space="preserve">
+    <value>Edit</value>
+  </data>
+  <data name="&gt;&gt;btnEditText.Name" xml:space="preserve">
+    <value>btnEditText</value>
+  </data>
+  <data name="&gt;&gt;btnEditText.Type" xml:space="preserve">
+    <value>System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </data>
+  <data name="&gt;&gt;btnEditText.Parent" xml:space="preserve">
+    <value>groupBox1</value>
+  </data>
+  <data name="&gt;&gt;btnEditText.ZOrder" xml:space="preserve">
+    <value>1</value>
+  </data>
+  <data name="rdText.AutoSize" type="System.Boolean, mscorlib">
+    <value>True</value>
+  </data>
+  <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+  <data name="rdText.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
+    <value>NoControl</value>
+  </data>
+  <data name="rdText.Location" type="System.Drawing.Point, System.Drawing">
+    <value>23, 32</value>
+  </data>
+  <data name="rdText.Size" type="System.Drawing.Size, System.Drawing">
+    <value>68, 17</value>
+  </data>
+  <data name="rdText.TabIndex" type="System.Int32, mscorlib">
+    <value>2</value>
+  </data>
+  <data name="rdText.Text" xml:space="preserve">
+    <value>Use Text</value>
+  </data>
+  <data name="&gt;&gt;rdText.Name" xml:space="preserve">
+    <value>rdText</value>
+  </data>
+  <data name="&gt;&gt;rdText.Type" xml:space="preserve">
+    <value>System.Windows.Forms.RadioButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </data>
+  <data name="&gt;&gt;rdText.Parent" xml:space="preserve">
+    <value>groupBox1</value>
+  </data>
+  <data name="&gt;&gt;rdText.ZOrder" xml:space="preserve">
+    <value>2</value>
+  </data>
+  <data name="rdImage.AutoSize" type="System.Boolean, mscorlib">
+    <value>True</value>
+  </data>
+  <data name="rdImage.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
+    <value>NoControl</value>
+  </data>
+  <data name="rdImage.Location" type="System.Drawing.Point, System.Drawing">
+    <value>23, 68</value>
+  </data>
+  <data name="rdImage.Size" type="System.Drawing.Size, System.Drawing">
+    <value>91, 17</value>
+  </data>
+  <data name="rdImage.TabIndex" type="System.Int32, mscorlib">
+    <value>3</value>
+  </data>
+  <data name="rdImage.Text" xml:space="preserve">
+    <value>Use an Image</value>
+  </data>
+  <data name="&gt;&gt;rdImage.Name" xml:space="preserve">
+    <value>rdImage</value>
+  </data>
+  <data name="&gt;&gt;rdImage.Type" xml:space="preserve">
+    <value>System.Windows.Forms.RadioButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </data>
+  <data name="&gt;&gt;rdImage.Parent" xml:space="preserve">
+    <value>groupBox1</value>
+  </data>
+  <data name="&gt;&gt;rdImage.ZOrder" xml:space="preserve">
+    <value>3</value>
+  </data>
+  <data name="groupBox1.Location" type="System.Drawing.Point, System.Drawing">
+    <value>12, 6</value>
+  </data>
+  <data name="groupBox1.Size" type="System.Drawing.Size, System.Drawing">
+    <value>272, 138</value>
+  </data>
+  <data name="groupBox1.TabIndex" type="System.Int32, mscorlib">
+    <value>4</value>
+  </data>
+  <data name="groupBox1.Text" xml:space="preserve">
+    <value>Watermark Type</value>
+  </data>
+  <data name="&gt;&gt;groupBox1.Name" xml:space="preserve">
+    <value>groupBox1</value>
+  </data>
+  <data name="&gt;&gt;groupBox1.Type" xml:space="preserve">
+    <value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </data>
+  <data name="&gt;&gt;groupBox1.Parent" xml:space="preserve">
+    <value>contentPanel</value>
+  </data>
+  <data name="&gt;&gt;groupBox1.ZOrder" xml:space="preserve">
+    <value>0</value>
+  </data>
+  <data name="contentPanel.Size" type="System.Drawing.Size, System.Drawing">
+    <value>540, 155</value>
+  </data>
+  <data name="&gt;&gt;contentPanel.Name" xml:space="preserve">
+    <value>contentPanel</value>
+  </data>
+  <data name="&gt;&gt;contentPanel.Type" xml:space="preserve">
+    <value>System.Windows.Forms.Panel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </data>
+  <data name="&gt;&gt;contentPanel.Parent" xml:space="preserve">
+    <value>$this</value>
+  </data>
+  <data name="&gt;&gt;contentPanel.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.HeaderText" xml:space="preserve">
+    <value>Watermark Content</value>
+  </data>
+  <data name="$this.Size" type="System.Drawing.Size, System.Drawing">
+    <value>540, 182</value>
+  </data>
+  <data name="&gt;&gt;$this.Name" xml:space="preserve">
+    <value>WatermarkContentCtrl</value>
+  </data>
+  <data name="&gt;&gt;$this.Type" xml:space="preserve">
+    <value>Maestro.Editors.Common.EditorBindableCollapsiblePanel, Maestro.Editors, Version=3.1.0.5859, Culture=neutral, PublicKeyToken=null</value>
+  </data>
+</root>
\ No newline at end of file

Modified: trunk/Tools/Maestro/Maestro.Editors/WatermarkDefinition/WatermarkEditorCtrl.Designer.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/WatermarkDefinition/WatermarkEditorCtrl.Designer.cs	2011-07-05 12:08:46 UTC (rev 5967)
+++ trunk/Tools/Maestro/Maestro.Editors/WatermarkDefinition/WatermarkEditorCtrl.Designer.cs	2011-07-05 14:01:35 UTC (rev 5968)
@@ -29,12 +29,32 @@
         private void InitializeComponent()
         {
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(WatermarkEditorCtrl));
+            this.wmSettings = new Maestro.Editors.WatermarkDefinition.WatermarkSettingsCtrl();
+            this.wmContent = new Maestro.Editors.WatermarkDefinition.WatermarkContentCtrl();
             this.SuspendLayout();
             // 
+            // wmSettings
+            // 
+            this.wmSettings.ContentBackgroundColor = System.Drawing.SystemColors.Control;
+            resources.ApplyResources(this.wmSettings, "wmSettings");
+            this.wmSettings.HeaderBackgroundColor = System.Drawing.Color.LightSteelBlue;
+            this.wmSettings.HeaderFont = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold);
+            this.wmSettings.Name = "wmSettings";
+            // 
+            // wmContent
+            // 
+            this.wmContent.ContentBackgroundColor = System.Drawing.SystemColors.Control;
+            resources.ApplyResources(this.wmContent, "wmContent");
+            this.wmContent.HeaderBackgroundColor = System.Drawing.Color.LightSteelBlue;
+            this.wmContent.HeaderFont = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold);
+            this.wmContent.Name = "wmContent";
+            // 
             // WatermarkEditorCtrl
             // 
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
             resources.ApplyResources(this, "$this");
+            this.Controls.Add(this.wmContent);
+            this.Controls.Add(this.wmSettings);
             this.Name = "WatermarkEditorCtrl";
             this.ResumeLayout(false);
 
@@ -42,5 +62,8 @@
 
         #endregion
 
+        private WatermarkSettingsCtrl wmSettings;
+        private WatermarkContentCtrl wmContent;
+
     }
 }

Modified: trunk/Tools/Maestro/Maestro.Editors/WatermarkDefinition/WatermarkEditorCtrl.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/WatermarkDefinition/WatermarkEditorCtrl.cs	2011-07-05 12:08:46 UTC (rev 5967)
+++ trunk/Tools/Maestro/Maestro.Editors/WatermarkDefinition/WatermarkEditorCtrl.cs	2011-07-05 14:01:35 UTC (rev 5968)
@@ -41,35 +41,11 @@
 
         public override void Bind(IEditorService service)
         {
-            this.Controls.Clear();
             _wm = (IWatermarkDefinition)service.GetEditedResource();
             _wm.Content.RemoveSchemaAttributes(); //Sanity
 
-            var wmSettings = new WatermarkSettingsCtrl();
+            wmContent.Bind(service);
             wmSettings.Bind(service);
-
-            Control symControl = null;
-            if (_wm.Content.Type == SymbolDefinitionType.Simple)
-            {
-                var ctrl = new SimpleSymbolDefinitionEditorCtrl();
-                ctrl.Bind(new SymbolEditorService(service, _wm.Content));
-                symControl = ctrl;
-            }
-            else if (_wm.Content.Type == SymbolDefinitionType.Compound)
-            {
-                var ctrl = new CompoundSymbolDefinitionEditorCtrl();
-                ctrl.Bind(new SymbolEditorService(service, _wm.Content));
-                symControl = ctrl;
-            }
-
-            if (symControl != null)
-            {
-                symControl.Dock = DockStyle.Top;
-                this.Controls.Add(symControl);
-            }
-
-            wmSettings.Dock = DockStyle.Top;
-            this.Controls.Add(wmSettings);
         }
     }
 }

Modified: trunk/Tools/Maestro/Maestro.Editors/WatermarkDefinition/WatermarkEditorCtrl.resx
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/WatermarkDefinition/WatermarkEditorCtrl.resx	2011-07-05 12:08:46 UTC (rev 5967)
+++ trunk/Tools/Maestro/Maestro.Editors/WatermarkDefinition/WatermarkEditorCtrl.resx	2011-07-05 14:01:35 UTC (rev 5968)
@@ -117,16 +117,71 @@
   <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="wmSettings.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
+    <value>Top</value>
+  </data>
+  <data name="wmSettings.HeaderText" xml:space="preserve">
+    <value>Watermark Settings</value>
+  </data>
+  <assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+  <data name="wmSettings.Location" type="System.Drawing.Point, System.Drawing">
+    <value>0, 0</value>
+  </data>
+  <data name="wmSettings.Size" type="System.Drawing.Size, System.Drawing">
+    <value>528, 359</value>
+  </data>
+  <assembly alias="mscorlib" name="mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+  <data name="wmSettings.TabIndex" type="System.Int32, mscorlib">
+    <value>0</value>
+  </data>
+  <data name="&gt;&gt;wmSettings.Name" xml:space="preserve">
+    <value>wmSettings</value>
+  </data>
+  <data name="&gt;&gt;wmSettings.Type" xml:space="preserve">
+    <value>Maestro.Editors.WatermarkDefinition.WatermarkSettingsCtrl, Maestro.Editors, Version=3.1.0.5859, Culture=neutral, PublicKeyToken=null</value>
+  </data>
+  <data name="&gt;&gt;wmSettings.Parent" xml:space="preserve">
+    <value>$this</value>
+  </data>
+  <data name="&gt;&gt;wmSettings.ZOrder" xml:space="preserve">
+    <value>1</value>
+  </data>
+  <data name="wmContent.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
+    <value>Top</value>
+  </data>
+  <data name="wmContent.HeaderText" xml:space="preserve">
+    <value>Watermark Content</value>
+  </data>
+  <data name="wmContent.Location" type="System.Drawing.Point, System.Drawing">
+    <value>0, 359</value>
+  </data>
+  <data name="wmContent.Size" type="System.Drawing.Size, System.Drawing">
+    <value>528, 182</value>
+  </data>
+  <data name="wmContent.TabIndex" type="System.Int32, mscorlib">
+    <value>1</value>
+  </data>
+  <data name="&gt;&gt;wmContent.Name" xml:space="preserve">
+    <value>wmContent</value>
+  </data>
+  <data name="&gt;&gt;wmContent.Type" xml:space="preserve">
+    <value>Maestro.Editors.WatermarkDefinition.WatermarkContentCtrl, Maestro.Editors, Version=3.1.0.5859, Culture=neutral, PublicKeyToken=null</value>
+  </data>
+  <data name="&gt;&gt;wmContent.Parent" xml:space="preserve">
+    <value>$this</value>
+  </data>
+  <data name="&gt;&gt;wmContent.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>
-  <assembly alias="mscorlib" name="mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
   <data name="$this.AutoScroll" type="System.Boolean, mscorlib">
     <value>True</value>
   </data>
-  <assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
   <data name="$this.Size" type="System.Drawing.Size, System.Drawing">
-    <value>641, 550</value>
+    <value>528, 438</value>
   </data>
   <data name="&gt;&gt;$this.Name" xml:space="preserve">
     <value>WatermarkEditorCtrl</value>

Modified: trunk/Tools/Maestro/Maestro.Editors/WatermarkDefinition/WatermarkInstanceEditor.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/WatermarkDefinition/WatermarkInstanceEditor.cs	2011-07-05 12:08:46 UTC (rev 5967)
+++ trunk/Tools/Maestro/Maestro.Editors/WatermarkDefinition/WatermarkInstanceEditor.cs	2011-07-05 14:01:35 UTC (rev 5968)
@@ -48,11 +48,12 @@
             InitializeComponent();
             _watermark = watermark;
             _resSvc = resSvc;
-            cmbUsage.DataSource = Enum.GetValues(typeof(UsageType));
+            
             try
             {
                 _init = true;
 
+                cmbUsage.DataSource = Enum.GetValues(typeof(UsageType));
                 cmbUsage.SelectedItem = _watermark.Usage;
                 txtResourceId.Text = _watermark.ResourceId;
                 txtName.Text = _watermark.Name;
@@ -90,6 +91,7 @@
 
                         rdOvPosXY.Checked = true;
                     }
+                    TilePos_CheckedChanged(this, EventArgs.Empty);
                 }
 
                 Debug.Assert(_ovTilePosition != null);
@@ -134,29 +136,38 @@
 
         private void txtResourceId_TextChanged(object sender, EventArgs e)
         {
+            if (_init)
+                return;
+
             _watermark.ResourceId = txtResourceId.Text;
         }
 
         private void txtName_TextChanged(object sender, EventArgs e)
         {
+            if (_init)
+                return;
+
             _watermark.Name = txtName.Text;
         }
 
         private void cmbUsage_SelectedIndexChanged(object sender, EventArgs e)
         {
+            if (_init)
+                return;
+
             _watermark.Usage = (UsageType)cmbUsage.SelectedItem;
         }
 
         private void chkOverrideAppearance_CheckedChanged(object sender, EventArgs e)
         {
+            if (_init)
+                return;
+
             numOvTransparency.Enabled = numOvRotation.Enabled = chkOverrideAppearance.Checked;
 
             if (chkOverrideAppearance.Checked)
             {
-                if (rdOvPosXY.Checked)
-                    _watermark.PositionOverride = _ovXyPosition;
-                else if (rdOvTilePos.Checked)
-                    _watermark.PositionOverride = _ovTilePosition;
+                _watermark.AppearanceOverride = _ovAppearance;
             }
             else
             {
@@ -166,16 +177,37 @@
 
         private void chkOverridePosition_CheckedChanged(object sender, EventArgs e)
         {
+            if (_init)
+                return;
+
             rdOvPosXY.Enabled = rdOvTilePos.Enabled = ovPosPanel.Enabled = chkOverridePosition.Checked;
+
+            if (chkOverridePosition.Checked)
+            {
+                if (rdOvPosXY.Checked)
+                    _watermark.PositionOverride = _ovXyPosition;
+                else if (rdOvTilePos.Checked)
+                    _watermark.PositionOverride = _ovTilePosition;
+            }
+            else
+            {
+                _watermark.PositionOverride = null;
+            }
         }
 
         private void numOvTransparency_ValueChanged(object sender, EventArgs e)
         {
+            if (_init)
+                return;
+
             _ovAppearance.Transparency = Convert.ToDouble(numOvTransparency.Value);
         }
 
         private void numOvRotation_ValueChanged(object sender, EventArgs e)
         {
+            if (_init)
+                return;
+
             _ovAppearance.Rotation = Convert.ToDouble(numOvRotation.Value);
         }
     }

Modified: trunk/Tools/Maestro/Maestro.Editors/WatermarkDefinition/WatermarkSettingsCtrl.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/WatermarkDefinition/WatermarkSettingsCtrl.cs	2011-07-05 12:08:46 UTC (rev 5967)
+++ trunk/Tools/Maestro/Maestro.Editors/WatermarkDefinition/WatermarkSettingsCtrl.cs	2011-07-05 14:01:35 UTC (rev 5968)
@@ -30,7 +30,7 @@
 
 namespace Maestro.Editors.WatermarkDefinition
 {
-    [ToolboxItem(false)]
+    [ToolboxItem(true)]
     public partial class WatermarkSettingsCtrl : EditorBindableCollapsiblePanel
     {
         public WatermarkSettingsCtrl()

Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/SymbolDefinition.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/SymbolDefinition.cs	2011-07-05 12:08:46 UTC (rev 5967)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/SymbolDefinition.cs	2011-07-05 14:01:35 UTC (rev 5968)
@@ -157,6 +157,11 @@
             }
         }
 
+        void ISimpleSymbolDefinition.ClearGraphics()
+        {
+            this.Graphics.Clear();
+        }
+
         void ISimpleSymbolDefinition.AddGraphics(IGraphicBase graphics)
         {
             var g = graphics as GraphicBase;
@@ -363,6 +368,12 @@
 #endif
     {
         [XmlIgnore]
+        public override GraphicElementType Type
+        {
+            get { return GraphicElementType.Text; }
+        }
+
+        [XmlIgnore]
         ITextFrame ITextGraphic.Frame
         {
             get
@@ -454,9 +465,12 @@
         }
     }
 
-    partial class GraphicBase : IGraphicBase
+    abstract partial class GraphicBase : IGraphicBase
     {
-        
+        public abstract GraphicElementType Type
+        {
+            get;
+        }
     }
 
     partial class Parameter : IParameter
@@ -647,7 +661,11 @@
 
     partial class Path : IPathGraphic
     {
-        
+        [XmlIgnore]
+        public override GraphicElementType Type
+        {
+            get { return GraphicElementType.Path; }
+        }
     }
 
     partial class CompoundSymbolDefinition : ICompoundSymbolDefinition
@@ -783,6 +801,13 @@
 
     partial class Image : IImageGraphic
     {
+        [XmlIgnore]
+        public override GraphicElementType Type
+        {
+            get { return GraphicElementType.Image; }
+        }
+
+        [XmlIgnore]
         IImageBase IImageGraphic.Item
         {
             get

Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/SymbolInterfaces.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/SymbolInterfaces.cs	2011-07-05 12:08:46 UTC (rev 5967)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/SymbolInterfaces.cs	2011-07-05 14:01:35 UTC (rev 5968)
@@ -325,6 +325,11 @@
         IImageGraphic CreateImageGraphics();
 
         IParameter CreateParameter();
+
+        /// <summary>
+        /// Removes all graphic elements
+        /// </summary>
+        void ClearGraphics();
     }
 
     /// <summary>
@@ -808,6 +813,25 @@
     }
 
     /// <summary>
+    /// Defines the valid types of graphic elements
+    /// </summary>
+    public enum GraphicElementType
+    {
+        /// <summary>
+        /// Text
+        /// </summary>
+        Text,
+        /// <summary>
+        /// Images
+        /// </summary>
+        Image,
+        /// <summary>
+        /// A linear path containing one or more segments
+        /// </summary>
+        Path
+    }
+
+    /// <summary>
     /// Represents the base interface of all graphics
     /// </summary>
     public interface IGraphicBase
@@ -817,6 +841,11 @@
         /// </summary>
         /// <value>The resize control.</value>
         string ResizeControl { get; set; }
+
+        /// <summary>
+        /// Gets the type of graphic element
+        /// </summary>
+        GraphicElementType Type { get; }
     }
 
     /// <summary>



More information about the mapguide-commits mailing list