[mapguide-commits] r5605 - in sandbox/maestro-3.0: Maestro.Editors
Maestro.Editors/Fusion Maestro.Editors/Fusion/WidgetEditors
Maestro.Editors/Properties OSGeo.MapGuide.MaestroAPI/ObjectModels
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Tue Mar 8 07:10:32 EST 2011
Author: jng
Date: 2011-03-08 04:10:32 -0800 (Tue, 08 Mar 2011)
New Revision: 5605
Added:
sandbox/maestro-3.0/Maestro.Editors/Fusion/FusionWidgetEditorMap.cs
sandbox/maestro-3.0/Maestro.Editors/Fusion/NewWidgetDialog.Designer.cs
sandbox/maestro-3.0/Maestro.Editors/Fusion/NewWidgetDialog.cs
sandbox/maestro-3.0/Maestro.Editors/Fusion/NewWidgetDialog.resx
sandbox/maestro-3.0/Maestro.Editors/Fusion/WidgetManagementDialog.Designer.cs
sandbox/maestro-3.0/Maestro.Editors/Fusion/WidgetManagementDialog.cs
sandbox/maestro-3.0/Maestro.Editors/Fusion/WidgetManagementDialog.resx
Modified:
sandbox/maestro-3.0/Maestro.Editors/Fusion/FlexibleLayoutEditorContext.cs
sandbox/maestro-3.0/Maestro.Editors/Fusion/WidgetEditors/GenericWidgetCtrl.Designer.cs
sandbox/maestro-3.0/Maestro.Editors/Fusion/WidgetEditors/GenericWidgetCtrl.cs
sandbox/maestro-3.0/Maestro.Editors/Fusion/WidgetEditors/GenericWidgetCtrl.resx
sandbox/maestro-3.0/Maestro.Editors/Fusion/WidgetSettingsCtrl.Designer.cs
sandbox/maestro-3.0/Maestro.Editors/Fusion/WidgetSettingsCtrl.cs
sandbox/maestro-3.0/Maestro.Editors/Fusion/WidgetSettingsCtrl.resx
sandbox/maestro-3.0/Maestro.Editors/Maestro.Editors.csproj
sandbox/maestro-3.0/Maestro.Editors/Properties/Resources.Designer.cs
sandbox/maestro-3.0/Maestro.Editors/Properties/Resources.resx
sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/ObjectModels/ApplicationDefinitionInterfaces.cs
Log:
Tie up loose ends in the fusion editor. We now have functional widget set management
Modified: sandbox/maestro-3.0/Maestro.Editors/Fusion/FlexibleLayoutEditorContext.cs
===================================================================
--- sandbox/maestro-3.0/Maestro.Editors/Fusion/FlexibleLayoutEditorContext.cs 2011-03-08 07:55:20 UTC (rev 5604)
+++ sandbox/maestro-3.0/Maestro.Editors/Fusion/FlexibleLayoutEditorContext.cs 2011-03-08 12:10:32 UTC (rev 5605)
@@ -54,6 +54,11 @@
return null;
}
+ public IWidgetInfo[] GetAllWidgets()
+ {
+ return new List<IWidgetInfo>(_widgetSet.WidgetInfo).ToArray();
+ }
+
public IApplicationDefinitionContainerInfo GetContainerInfo(string name)
{
Check.NotEmpty(name, "name");
Added: sandbox/maestro-3.0/Maestro.Editors/Fusion/FusionWidgetEditorMap.cs
===================================================================
--- sandbox/maestro-3.0/Maestro.Editors/Fusion/FusionWidgetEditorMap.cs (rev 0)
+++ sandbox/maestro-3.0/Maestro.Editors/Fusion/FusionWidgetEditorMap.cs 2011-03-08 12:10:32 UTC (rev 5605)
@@ -0,0 +1,114 @@
+#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.Text;
+using Maestro.Editors.Fusion.WidgetEditors;
+using OSGeo.MapGuide.ObjectModels.ApplicationDefinition;
+using OSGeo.MapGuide.MaestroAPI;
+
+namespace Maestro.Editors.Fusion
+{
+ public static class FusionWidgetEditorMap
+ {
+ static Dictionary<string, Type> _edTypes;
+
+ static FusionWidgetEditorMap()
+ {
+ _edTypes = new Dictionary<string, Type>();
+
+ _edTypes[KnownWidgetNames.About] = typeof(AboutWidgetCtrl);
+ _edTypes[KnownWidgetNames.ActivityIndicator] = typeof(ActivityIndicatorWidgetCtrl);
+ _edTypes[KnownWidgetNames.Buffer] = typeof(BufferWidgetCtrl);
+ _edTypes[KnownWidgetNames.BufferPanel] = typeof(BufferPanelWidgetCtrl);
+ _edTypes[KnownWidgetNames.CenterSelection] = typeof(CenterSelectionWidgetCtrl);
+ _edTypes[KnownWidgetNames.ClearSelection] = typeof(ClearSelectionCtrl);
+ _edTypes[KnownWidgetNames.ColorPicker] = typeof(ColorPickerWidgetCtrl);
+ //_edTypes[KnownWidgetNames.CTRLClick]
+ _edTypes[KnownWidgetNames.CursorPosition] = typeof(CursorPositionWidgetCtrl);
+ _edTypes[KnownWidgetNames.EditableScale] = typeof(EditableScaleWidgetCtrl);
+ _edTypes[KnownWidgetNames.ExtentHistory] = typeof(ExtentHistoryWidgetCtrl);
+ _edTypes[KnownWidgetNames.FeatureInfo] = typeof(FeatureInfoWidgetCtrl);
+ _edTypes[KnownWidgetNames.Help] = typeof(HelpWidgetCtrl);
+ _edTypes[KnownWidgetNames.InitialMapView] = typeof(InitialMapViewWidgetCtrl);
+ _edTypes[KnownWidgetNames.InvokeScript] = typeof(InvokeScriptWidgetCtrl);
+ //_edTypes[KnownWidgetNames.InvokeURL]
+ //_edTypes[KnownWidgetNames.LayerManager]
+ _edTypes[KnownWidgetNames.Legend] = typeof(LegendWidgetCtrl);
+ _edTypes[KnownWidgetNames.LinkToView] = typeof(LinkToViewWidgetCtrl);
+ _edTypes[KnownWidgetNames.MapMenu] = typeof(MapMenuWidgetCtrl);
+ _edTypes[KnownWidgetNames.Maptip] = typeof(MapTipWidgetCtrl);
+ _edTypes[KnownWidgetNames.Measure] = typeof(MeasureWidgetCtrl);
+ _edTypes[KnownWidgetNames.Navigator] = typeof(NavigatorWidgetCtrl);
+ //_edTypes[KnownWidgetNames.OverviewMap]
+ _edTypes[KnownWidgetNames.Pan] = typeof(PanWidgetCtrl);
+ //_edTypes[KnownWidgetNames.PanOnClick]
+ //_edTypes[KnownWidgetNames.PanQuery]
+ //_edTypes[KnownWidgetNames.Print]
+ //_edTypes[KnownWidgetNames.Query]
+ //_edTypes[KnownWidgetNames.QuickPlot]
+ //_edTypes[KnownWidgetNames.Redline]
+ _edTypes[KnownWidgetNames.RefreshMap] = typeof(RefreshMapWidgetCtrl);
+ //_edTypes[KnownWidgetNames.SaveMap]
+ //_edTypes[KnownWidgetNames.Scalebar]
+ //_edTypes[KnownWidgetNames.Search]
+ //_edTypes[KnownWidgetNames.Select]
+ //_edTypes[KnownWidgetNames.SelectionInfo]
+ //_edTypes[KnownWidgetNames.SelectPolygon]
+ //_edTypes[KnownWidgetNames.SelectRadius]
+ //_edTypes[KnownWidgetNames.SelectRadiusValue]
+ //_edTypes[KnownWidgetNames.SelectWithin]
+ //_edTypes[KnownWidgetNames.TaskPane]
+ //_edTypes[KnownWidgetNames.Theme]
+ //_edTypes[KnownWidgetNames.ViewOptions]
+ //_edTypes[KnownWidgetNames.ViewSize]
+ //_edTypes[KnownWidgetNames.Zoom]
+ //_edTypes[KnownWidgetNames.ZoomOnClick]
+ //_edTypes[KnownWidgetNames.ZoomToSelection]
+ }
+
+ public static IWidgetEditor GetEditorForWidget(IWidget widget, FlexibleLayoutEditorContext context, IEditorService edsvc)
+ {
+ Check.NotNull(widget, "widget");
+ Check.NotNull(context, "context");
+ Check.NotNull(edsvc, "edsvc");
+
+ IWidgetEditor ed = null;
+ if (_edTypes.ContainsKey(widget.Name))
+ {
+ try
+ {
+ ed = (IWidgetEditor)Activator.CreateInstance(_edTypes[widget.Name]);
+ }
+ catch (Exception ex)
+ {
+ ed = null;
+ System.Diagnostics.Trace.TraceError(ex.ToString());
+ }
+ }
+
+ if (ed == null)
+ ed = new GenericWidgetCtrl();
+
+ ed.Setup(widget, context, edsvc);
+ return ed;
+ }
+ }
+}
Added: sandbox/maestro-3.0/Maestro.Editors/Fusion/NewWidgetDialog.Designer.cs
===================================================================
--- sandbox/maestro-3.0/Maestro.Editors/Fusion/NewWidgetDialog.Designer.cs (rev 0)
+++ sandbox/maestro-3.0/Maestro.Editors/Fusion/NewWidgetDialog.Designer.cs 2011-03-08 12:10:32 UTC (rev 5605)
@@ -0,0 +1,124 @@
+namespace Maestro.Editors.Fusion
+{
+ partial class NewWidgetDialog
+ {
+ /// <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 Windows Form 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()
+ {
+ this.label1 = new System.Windows.Forms.Label();
+ this.label2 = new System.Windows.Forms.Label();
+ this.cmbWidgets = new System.Windows.Forms.ComboBox();
+ this.txtName = new System.Windows.Forms.TextBox();
+ this.btnOK = new System.Windows.Forms.Button();
+ this.btnCancel = new System.Windows.Forms.Button();
+ this.SuspendLayout();
+ //
+ // label1
+ //
+ this.label1.AutoSize = true;
+ this.label1.Location = new System.Drawing.Point(13, 28);
+ this.label1.Name = "label1";
+ this.label1.Size = new System.Drawing.Size(68, 13);
+ this.label1.TabIndex = 0;
+ this.label1.Text = "Widget Type";
+ //
+ // label2
+ //
+ this.label2.AutoSize = true;
+ this.label2.Location = new System.Drawing.Point(13, 93);
+ this.label2.Name = "label2";
+ this.label2.Size = new System.Drawing.Size(153, 13);
+ this.label2.TabIndex = 1;
+ this.label2.Text = "Widget Name (must be unique)";
+ //
+ // cmbWidgets
+ //
+ this.cmbWidgets.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+ this.cmbWidgets.FormattingEnabled = true;
+ this.cmbWidgets.Location = new System.Drawing.Point(16, 44);
+ this.cmbWidgets.Name = "cmbWidgets";
+ this.cmbWidgets.Size = new System.Drawing.Size(363, 21);
+ this.cmbWidgets.TabIndex = 2;
+ //
+ // txtName
+ //
+ this.txtName.Location = new System.Drawing.Point(16, 110);
+ this.txtName.Name = "txtName";
+ this.txtName.Size = new System.Drawing.Size(363, 20);
+ this.txtName.TabIndex = 3;
+ //
+ // btnOK
+ //
+ this.btnOK.Location = new System.Drawing.Point(222, 155);
+ this.btnOK.Name = "btnOK";
+ this.btnOK.Size = new System.Drawing.Size(75, 23);
+ this.btnOK.TabIndex = 4;
+ this.btnOK.Text = "OK";
+ this.btnOK.UseVisualStyleBackColor = true;
+ this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
+ //
+ // btnCancel
+ //
+ this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
+ this.btnCancel.Location = new System.Drawing.Point(304, 155);
+ this.btnCancel.Name = "btnCancel";
+ this.btnCancel.Size = new System.Drawing.Size(75, 23);
+ this.btnCancel.TabIndex = 5;
+ this.btnCancel.Text = "Cancel";
+ this.btnCancel.UseVisualStyleBackColor = true;
+ this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
+ //
+ // NewWidgetDialog
+ //
+ this.AcceptButton = this.btnOK;
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
+ this.CancelButton = this.btnCancel;
+ this.ClientSize = new System.Drawing.Size(391, 192);
+ this.ControlBox = false;
+ this.Controls.Add(this.btnCancel);
+ this.Controls.Add(this.btnOK);
+ this.Controls.Add(this.txtName);
+ this.Controls.Add(this.cmbWidgets);
+ this.Controls.Add(this.label2);
+ this.Controls.Add(this.label1);
+ this.Name = "NewWidgetDialog";
+ this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
+ this.Text = "Add Widget";
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.Label label1;
+ private System.Windows.Forms.Label label2;
+ private System.Windows.Forms.ComboBox cmbWidgets;
+ private System.Windows.Forms.TextBox txtName;
+ private System.Windows.Forms.Button btnOK;
+ private System.Windows.Forms.Button btnCancel;
+ }
+}
\ No newline at end of file
Added: sandbox/maestro-3.0/Maestro.Editors/Fusion/NewWidgetDialog.cs
===================================================================
--- sandbox/maestro-3.0/Maestro.Editors/Fusion/NewWidgetDialog.cs (rev 0)
+++ sandbox/maestro-3.0/Maestro.Editors/Fusion/NewWidgetDialog.cs 2011-03-08 12:10:32 UTC (rev 5605)
@@ -0,0 +1,72 @@
+#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.Data;
+using System.Drawing;
+using System.Text;
+using System.Windows.Forms;
+using OSGeo.MapGuide.ObjectModels.ApplicationDefinition;
+
+namespace Maestro.Editors.Fusion
+{
+ public partial class NewWidgetDialog : Form
+ {
+ private IApplicationDefinition _appDef;
+ private FlexibleLayoutEditorContext _context;
+
+ public NewWidgetDialog(IApplicationDefinition appDef, FlexibleLayoutEditorContext context)
+ {
+ InitializeComponent();
+ _appDef = appDef;
+ _context = context;
+
+ cmbWidgets.DisplayMember = "Type";
+ cmbWidgets.DataSource = _context.GetAllWidgets();
+ }
+
+ public IWidgetInfo SelectedWidget { get { return cmbWidgets.SelectedItem as IWidgetInfo; } }
+
+ public string WidgetName { get { return txtName.Text; } }
+
+ private void btnCancel_Click(object sender, EventArgs e)
+ {
+ this.DialogResult = DialogResult.Cancel;
+ }
+
+ private void btnOK_Click(object sender, EventArgs e)
+ {
+ if (string.IsNullOrEmpty(txtName.Text))
+ {
+ MessageBox.Show(string.Format(Properties.Resources.FieldRequired, label2.Text));
+ return;
+ }
+
+ if (_appDef.WidgetNameExists(txtName.Text))
+ {
+ MessageBox.Show(string.Format(Properties.Resources.WidgetNameExists, txtName.Text));
+ return;
+ }
+
+ this.DialogResult = DialogResult.OK;
+ }
+ }
+}
Added: sandbox/maestro-3.0/Maestro.Editors/Fusion/NewWidgetDialog.resx
===================================================================
--- sandbox/maestro-3.0/Maestro.Editors/Fusion/NewWidgetDialog.resx (rev 0)
+++ sandbox/maestro-3.0/Maestro.Editors/Fusion/NewWidgetDialog.resx 2011-03-08 12:10:32 UTC (rev 5605)
@@ -0,0 +1,120 @@
+<?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>
+</root>
\ No newline at end of file
Modified: sandbox/maestro-3.0/Maestro.Editors/Fusion/WidgetEditors/GenericWidgetCtrl.Designer.cs
===================================================================
--- sandbox/maestro-3.0/Maestro.Editors/Fusion/WidgetEditors/GenericWidgetCtrl.Designer.cs 2011-03-08 07:55:20 UTC (rev 5604)
+++ sandbox/maestro-3.0/Maestro.Editors/Fusion/WidgetEditors/GenericWidgetCtrl.Designer.cs 2011-03-08 12:10:32 UTC (rev 5605)
@@ -54,12 +54,12 @@
//
// GenericWidgetCtrl
//
- resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.Controls.Add(this.btnSave);
this.Controls.Add(this.txtXmlContent);
this.Controls.Add(this.label1);
this.Name = "GenericWidgetCtrl";
+ resources.ApplyResources(this, "$this");
this.ResumeLayout(false);
this.PerformLayout();
Modified: sandbox/maestro-3.0/Maestro.Editors/Fusion/WidgetEditors/GenericWidgetCtrl.cs
===================================================================
--- sandbox/maestro-3.0/Maestro.Editors/Fusion/WidgetEditors/GenericWidgetCtrl.cs 2011-03-08 07:55:20 UTC (rev 5604)
+++ sandbox/maestro-3.0/Maestro.Editors/Fusion/WidgetEditors/GenericWidgetCtrl.cs 2011-03-08 12:10:32 UTC (rev 5605)
@@ -56,7 +56,7 @@
private void txtXmlContent_TextChanged(object sender, EventArgs e)
{
- btnSave.Enabled = (txtXmlContent.Text.Equals(_xml));
+ btnSave.Enabled = !(txtXmlContent.Text.Equals(_xml));
}
private void btnSave_Click(object sender, EventArgs e)
@@ -67,20 +67,20 @@
doc.LoadXml(txtXmlContent.Text);
//Base widget properties
- XmlNode node = doc.SelectSingleNode("//Widget/Name");
+ XmlNode node = doc.SelectSingleNode("//WidgetType/Name");
if (node != null)
_widget.Name = node.InnerText;
- node = doc.SelectSingleNode("//Widget/Type");
+ node = doc.SelectSingleNode("//WidgetType/Type");
if (node != null)
_widget.Type = node.InnerText;
- node = doc.SelectSingleNode("//Widget/Location");
+ node = doc.SelectSingleNode("//WidgetType/Location");
if (node != null)
_widget.Location = node.InnerText;
//Extension elements
- node = doc.SelectSingleNode("//Widget/Extension");
+ node = doc.SelectSingleNode("//WidgetType/Extension");
if (node != null)
{
List<XmlElement> elements = new List<XmlElement>();
@@ -95,23 +95,23 @@
var uiw = _widget as IUIWidget;
if (uiw != null)
{
- node = doc.SelectSingleNode("//Widget/StatusItem");
+ node = doc.SelectSingleNode("//WidgetType/StatusItem");
if (node != null)
uiw.StatusText = node.InnerText;
- node = doc.SelectSingleNode("//Widget/ImageUrl");
+ node = doc.SelectSingleNode("//WidgetType/ImageUrl");
if (node != null)
uiw.ImageUrl = node.InnerText;
- node = doc.SelectSingleNode("//Widget/ImageClass");
+ node = doc.SelectSingleNode("//WidgetType/ImageClass");
if (node != null)
uiw.ImageClass = node.InnerText;
- node = doc.SelectSingleNode("//Widget/Tooltip");
+ node = doc.SelectSingleNode("//WidgetType/Tooltip");
if (node != null)
uiw.Tooltip = node.InnerText;
- node = doc.SelectSingleNode("//Widget/Label");
+ node = doc.SelectSingleNode("//WidgetType/Label");
if (node != null)
uiw.Label = node.InnerText;
Modified: sandbox/maestro-3.0/Maestro.Editors/Fusion/WidgetEditors/GenericWidgetCtrl.resx
===================================================================
--- sandbox/maestro-3.0/Maestro.Editors/Fusion/WidgetEditors/GenericWidgetCtrl.resx 2011-03-08 07:55:20 UTC (rev 5604)
+++ sandbox/maestro-3.0/Maestro.Editors/Fusion/WidgetEditors/GenericWidgetCtrl.resx 2011-03-08 12:10:32 UTC (rev 5605)
@@ -150,12 +150,18 @@
<data name="txtXmlContent.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Top, Bottom, Left, Right</value>
</data>
+ <data name="txtXmlContent.Font" type="System.Drawing.Font, System.Drawing">
+ <value>Courier New, 9pt</value>
+ </data>
<data name="txtXmlContent.Location" type="System.Drawing.Point, System.Drawing">
<value>18, 27</value>
</data>
<data name="txtXmlContent.Multiline" type="System.Boolean, mscorlib">
<value>True</value>
</data>
+ <data name="txtXmlContent.ScrollBars" type="System.Windows.Forms.ScrollBars, System.Windows.Forms">
+ <value>Both</value>
+ </data>
<data name="txtXmlContent.Size" type="System.Drawing.Size, System.Drawing">
<value>397, 347</value>
</data>
@@ -207,9 +213,6 @@
<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>432, 412</value>
</data>
Added: sandbox/maestro-3.0/Maestro.Editors/Fusion/WidgetManagementDialog.Designer.cs
===================================================================
--- sandbox/maestro-3.0/Maestro.Editors/Fusion/WidgetManagementDialog.Designer.cs (rev 0)
+++ sandbox/maestro-3.0/Maestro.Editors/Fusion/WidgetManagementDialog.Designer.cs 2011-03-08 12:10:32 UTC (rev 5605)
@@ -0,0 +1,151 @@
+namespace Maestro.Editors.Fusion
+{
+ partial class WidgetManagementDialog
+ {
+ /// <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 Windows Form 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(WidgetManagementDialog));
+ this.groupBox1 = new System.Windows.Forms.GroupBox();
+ this.grdWidgets = new System.Windows.Forms.DataGridView();
+ this.COL_NAME = new System.Windows.Forms.DataGridViewTextBoxColumn();
+ this.COL_TYPE = new System.Windows.Forms.DataGridViewTextBoxColumn();
+ this.toolStrip1 = new System.Windows.Forms.ToolStrip();
+ this.btnAdd = new System.Windows.Forms.ToolStripButton();
+ this.btnDelete = new System.Windows.Forms.ToolStripButton();
+ this.groupBox2 = new System.Windows.Forms.GroupBox();
+ this.btnClose = new System.Windows.Forms.Button();
+ this.groupBox1.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.grdWidgets)).BeginInit();
+ this.toolStrip1.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // groupBox1
+ //
+ resources.ApplyResources(this.groupBox1, "groupBox1");
+ this.groupBox1.Controls.Add(this.grdWidgets);
+ this.groupBox1.Controls.Add(this.toolStrip1);
+ this.groupBox1.Name = "groupBox1";
+ this.groupBox1.TabStop = false;
+ //
+ // grdWidgets
+ //
+ this.grdWidgets.AllowUserToAddRows = false;
+ this.grdWidgets.AllowUserToDeleteRows = false;
+ this.grdWidgets.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
+ this.grdWidgets.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
+ this.COL_NAME,
+ this.COL_TYPE});
+ resources.ApplyResources(this.grdWidgets, "grdWidgets");
+ this.grdWidgets.Name = "grdWidgets";
+ this.grdWidgets.ReadOnly = true;
+ this.grdWidgets.RowHeadersVisible = false;
+ this.grdWidgets.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
+ this.grdWidgets.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.grdWidgets_CellClick);
+ this.grdWidgets.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.grdWidgets_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;
+ //
+ // COL_TYPE
+ //
+ this.COL_TYPE.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
+ this.COL_TYPE.DataPropertyName = "Type";
+ resources.ApplyResources(this.COL_TYPE, "COL_TYPE");
+ this.COL_TYPE.Name = "COL_TYPE";
+ this.COL_TYPE.ReadOnly = true;
+ //
+ // 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.gear__plus;
+ 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.gear__minus;
+ this.btnDelete.Name = "btnDelete";
+ this.btnDelete.Click += new System.EventHandler(this.btnDelete_Click);
+ //
+ // groupBox2
+ //
+ resources.ApplyResources(this.groupBox2, "groupBox2");
+ this.groupBox2.Name = "groupBox2";
+ this.groupBox2.TabStop = false;
+ //
+ // btnClose
+ //
+ resources.ApplyResources(this.btnClose, "btnClose");
+ this.btnClose.Name = "btnClose";
+ this.btnClose.UseVisualStyleBackColor = true;
+ this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
+ //
+ // WidgetManagementDialog
+ //
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
+ resources.ApplyResources(this, "$this");
+ this.ControlBox = false;
+ this.Controls.Add(this.btnClose);
+ this.Controls.Add(this.groupBox2);
+ this.Controls.Add(this.groupBox1);
+ this.Name = "WidgetManagementDialog";
+ this.groupBox1.ResumeLayout(false);
+ this.groupBox1.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.grdWidgets)).EndInit();
+ this.toolStrip1.ResumeLayout(false);
+ this.toolStrip1.PerformLayout();
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.GroupBox groupBox1;
+ private System.Windows.Forms.GroupBox groupBox2;
+ private System.Windows.Forms.Button btnClose;
+ private System.Windows.Forms.ToolStrip toolStrip1;
+ private System.Windows.Forms.ToolStripButton btnAdd;
+ private System.Windows.Forms.ToolStripButton btnDelete;
+ private System.Windows.Forms.DataGridView grdWidgets;
+ private System.Windows.Forms.DataGridViewTextBoxColumn COL_NAME;
+ private System.Windows.Forms.DataGridViewTextBoxColumn COL_TYPE;
+
+ }
+}
\ No newline at end of file
Added: sandbox/maestro-3.0/Maestro.Editors/Fusion/WidgetManagementDialog.cs
===================================================================
--- sandbox/maestro-3.0/Maestro.Editors/Fusion/WidgetManagementDialog.cs (rev 0)
+++ sandbox/maestro-3.0/Maestro.Editors/Fusion/WidgetManagementDialog.cs 2011-03-08 12:10:32 UTC (rev 5605)
@@ -0,0 +1,163 @@
+#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.Data;
+using System.Drawing;
+using System.Text;
+using System.Windows.Forms;
+using OSGeo.MapGuide.ObjectModels.ApplicationDefinition;
+
+namespace Maestro.Editors.Fusion
+{
+ public partial class WidgetManagementDialog : Form, INotifyResourceChanged
+ {
+ private IApplicationDefinition _appDef;
+ private FlexibleLayoutEditorContext _context;
+ private IEditorService _edsvc;
+
+ class WidgetItem
+ {
+ public string Name { get; set; }
+
+ public string Type { get; set; }
+
+ public string Label { get; set; }
+
+ public IWidget Widget { get; set; }
+ }
+
+ private BindingList<WidgetItem> _items;
+
+ public WidgetManagementDialog(IApplicationDefinition appDef, IEditorService edsvc, FlexibleLayoutEditorContext context)
+ {
+ InitializeComponent();
+ edsvc.RegisterCustomNotifier(this);
+ grdWidgets.AutoGenerateColumns = false;
+ _items = new BindingList<WidgetItem>();
+ _appDef = appDef;
+ _context = context;
+ _edsvc = edsvc;
+ grdWidgets.DataSource = _items;
+
+ var wset = appDef.GetFirstWidgetSet();
+ foreach (var wgt in wset.Widgets)
+ {
+ AddWidgetItem(wgt);
+ }
+
+ this.Disposed += new EventHandler(OnDisposed);
+ }
+
+ void OnDisposed(object sender, EventArgs e)
+ {
+ var handler = this.ResourceChanged;
+ if (handler != null)
+ {
+ foreach (var h in handler.GetInvocationList())
+ {
+ this.ResourceChanged -= (EventHandler)h;
+ }
+ this.ResourceChanged = null;
+ }
+ }
+
+ private void AddWidgetItem(IWidget widget)
+ {
+ var item = new WidgetItem()
+ {
+ Name = widget.Name,
+ Type = widget.Type,
+ Widget = widget
+ };
+
+ widget.PropertyChanged += (s, e) =>
+ {
+ if (e.PropertyName == "Name")
+ item.Name = widget.Name;
+ };
+
+ _items.Add(item);
+ }
+
+ private void btnAdd_Click(object sender, EventArgs e)
+ {
+ var diag = new NewWidgetDialog(_appDef, _context);
+ if (diag.ShowDialog() == DialogResult.OK)
+ {
+ var winfo = diag.SelectedWidget;
+ var name = diag.WidgetName;
+
+ var widget = _appDef.CreateWidget(name, winfo);
+ _appDef.GetFirstWidgetSet().AddWidget(widget);
+ AddWidgetItem(widget);
+ OnResourceChanged();
+ }
+ }
+
+ private void btnDelete_Click(object sender, EventArgs e)
+ {
+ if (grdWidgets.SelectedRows.Count == 1)
+ {
+ var item = (WidgetItem)grdWidgets.SelectedRows[0].DataBoundItem;
+ if (MessageBox.Show(Properties.Resources.PromptDeleteWidgetAndReferences, Properties.Resources.Confirm, MessageBoxButtons.YesNo) == DialogResult.Yes)
+ {
+ _appDef.RemoveWidget(item.Widget.Name, true);
+ _items.Remove(item);
+ groupBox2.Controls.Clear();
+ OnResourceChanged();
+ }
+ }
+ }
+
+ private void grdWidgets_CellClick(object sender, DataGridViewCellEventArgs e)
+ {
+ if (e.RowIndex >= 0)
+ {
+ grdWidgets.Rows[e.RowIndex].Selected = true;
+ btnDelete.Enabled = true;
+ LoadWidgetEditor((WidgetItem)grdWidgets.Rows[e.RowIndex].DataBoundItem);
+ }
+ }
+
+ private void LoadWidgetEditor(WidgetItem widgetItem)
+ {
+ groupBox2.Controls.Clear();
+ var ed = FusionWidgetEditorMap.GetEditorForWidget(widgetItem.Widget, _context, _edsvc);
+ ed.Content.Dock = DockStyle.Fill;
+ groupBox2.Controls.Add(ed.Content);
+ }
+
+ private void OnResourceChanged()
+ {
+ var handler = this.ResourceChanged;
+ if (handler != null)
+ handler(this, EventArgs.Empty);
+ }
+
+ public event EventHandler ResourceChanged;
+
+ private void btnClose_Click(object sender, EventArgs e)
+ {
+ this.Close();
+ }
+ }
+}
Added: sandbox/maestro-3.0/Maestro.Editors/Fusion/WidgetManagementDialog.resx
===================================================================
--- sandbox/maestro-3.0/Maestro.Editors/Fusion/WidgetManagementDialog.resx (rev 0)
+++ sandbox/maestro-3.0/Maestro.Editors/Fusion/WidgetManagementDialog.resx 2011-03-08 12:10:32 UTC (rev 5605)
@@ -0,0 +1,330 @@
+<?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="groupBox1.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
+ <value>Top, Bottom, Left, Right</value>
+ </data>
+ <metadata name="COL_NAME.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <data name="COL_NAME.HeaderText" xml:space="preserve">
+ <value>Name</value>
+ </data>
+ <metadata name="COL_TYPE.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <data name="COL_TYPE.HeaderText" xml:space="preserve">
+ <value>Type</value>
+ </data>
+ <data name="grdWidgets.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="grdWidgets.Location" type="System.Drawing.Point, System.Drawing">
+ <value>3, 41</value>
+ </data>
+ <data name="grdWidgets.Size" type="System.Drawing.Size, System.Drawing">
+ <value>300, 371</value>
+ </data>
+ <assembly alias="mscorlib" name="mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+ <data name="grdWidgets.TabIndex" type="System.Int32, mscorlib">
+ <value>1</value>
+ </data>
+ <data name=">>grdWidgets.Name" xml:space="preserve">
+ <value>grdWidgets</value>
+ </data>
+ <data name=">>grdWidgets.Type" xml:space="preserve">
+ <value>System.Windows.Forms.DataGridView, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </data>
+ <data name=">>grdWidgets.Parent" xml:space="preserve">
+ <value>groupBox1</value>
+ </data>
+ <data name=">>grdWidgets.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>3, 16</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="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="toolStrip1.Location" type="System.Drawing.Point, System.Drawing">
+ <value>3, 16</value>
+ </data>
+ <data name="toolStrip1.Size" type="System.Drawing.Size, System.Drawing">
+ <value>300, 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>groupBox1</value>
+ </data>
+ <data name=">>toolStrip1.ZOrder" xml:space="preserve">
+ <value>1</value>
+ </data>
+ <data name="groupBox1.Location" type="System.Drawing.Point, System.Drawing">
+ <value>13, 13</value>
+ </data>
+ <data name="groupBox1.Size" type="System.Drawing.Size, System.Drawing">
+ <value>306, 415</value>
+ </data>
+ <data name="groupBox1.TabIndex" type="System.Int32, mscorlib">
+ <value>0</value>
+ </data>
+ <data name="groupBox1.Text" xml:space="preserve">
+ <value>All Registered Widgets</value>
+ </data>
+ <data name=">>groupBox1.Name" xml:space="preserve">
+ <value>groupBox1</value>
+ </data>
+ <data name=">>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=">>groupBox1.Parent" xml:space="preserve">
+ <value>$this</value>
+ </data>
+ <data name=">>groupBox1.ZOrder" xml:space="preserve">
+ <value>2</value>
+ </data>
+ <data name="groupBox2.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
+ <value>Top, Bottom, Right</value>
+ </data>
+ <data name="groupBox2.Location" type="System.Drawing.Point, System.Drawing">
+ <value>325, 13</value>
+ </data>
+ <data name="groupBox2.Size" type="System.Drawing.Size, System.Drawing">
+ <value>428, 415</value>
+ </data>
+ <data name="groupBox2.TabIndex" type="System.Int32, mscorlib">
+ <value>1</value>
+ </data>
+ <data name="groupBox2.Text" xml:space="preserve">
+ <value>Widget Parameters</value>
+ </data>
+ <data name=">>groupBox2.Name" xml:space="preserve">
+ <value>groupBox2</value>
+ </data>
+ <data name=">>groupBox2.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=">>groupBox2.Parent" xml:space="preserve">
+ <value>$this</value>
+ </data>
+ <data name=">>groupBox2.ZOrder" xml:space="preserve">
+ <value>1</value>
+ </data>
+ <data name="btnClose.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
+ <value>Bottom, Right</value>
+ </data>
+ <data name="btnClose.Location" type="System.Drawing.Point, System.Drawing">
+ <value>678, 434</value>
+ </data>
+ <data name="btnClose.Size" type="System.Drawing.Size, System.Drawing">
+ <value>75, 23</value>
+ </data>
+ <data name="btnClose.TabIndex" type="System.Int32, mscorlib">
+ <value>2</value>
+ </data>
+ <data name="btnClose.Text" xml:space="preserve">
+ <value>Close</value>
+ </data>
+ <data name=">>btnClose.Name" xml:space="preserve">
+ <value>btnClose</value>
+ </data>
+ <data name=">>btnClose.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=">>btnClose.Parent" xml:space="preserve">
+ <value>$this</value>
+ </data>
+ <data name=">>btnClose.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.ClientSize" type="System.Drawing.Size, System.Drawing">
+ <value>765, 469</value>
+ </data>
+ <data name="$this.StartPosition" type="System.Windows.Forms.FormStartPosition, System.Windows.Forms">
+ <value>CenterParent</value>
+ </data>
+ <data name="$this.Text" xml:space="preserve">
+ <value>Widget Management</value>
+ </data>
+ <data name=">>COL_NAME.Name" xml:space="preserve">
+ <value>COL_NAME</value>
+ </data>
+ <data name=">>COL_NAME.Type" xml:space="preserve">
+ <value>System.Windows.Forms.DataGridViewTextBoxColumn, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </data>
+ <data name=">>COL_TYPE.Name" xml:space="preserve">
+ <value>COL_TYPE</value>
+ </data>
+ <data name=">>COL_TYPE.Type" xml:space="preserve">
+ <value>System.Windows.Forms.DataGridViewTextBoxColumn, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</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>WidgetManagementDialog</value>
+ </data>
+ <data name=">>$this.Type" xml:space="preserve">
+ <value>System.Windows.Forms.Form, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </data>
+</root>
\ No newline at end of file
Modified: sandbox/maestro-3.0/Maestro.Editors/Fusion/WidgetSettingsCtrl.Designer.cs
===================================================================
--- sandbox/maestro-3.0/Maestro.Editors/Fusion/WidgetSettingsCtrl.Designer.cs 2011-03-08 07:55:20 UTC (rev 5604)
+++ sandbox/maestro-3.0/Maestro.Editors/Fusion/WidgetSettingsCtrl.Designer.cs 2011-03-08 12:10:32 UTC (rev 5605)
@@ -44,7 +44,7 @@
this.btnMoveUp = new System.Windows.Forms.ToolStripButton();
this.btnMoveDown = new System.Windows.Forms.ToolStripButton();
this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
- this.btnConfigureWidgets = new System.Windows.Forms.ToolStripButton();
+ this.btnManageWidgets = new System.Windows.Forms.ToolStripButton();
this.propertiesPanel = new System.Windows.Forms.Panel();
this.contentPanel.SuspendLayout();
this.groupBox1.SuspendLayout();
@@ -91,7 +91,7 @@
this.btnMoveUp,
this.btnMoveDown,
this.toolStripSeparator2,
- this.btnConfigureWidgets});
+ this.btnManageWidgets});
resources.ApplyResources(this.toolStrip1, "toolStrip1");
this.toolStrip1.Name = "toolStrip1";
//
@@ -169,13 +169,13 @@
this.toolStripSeparator2.Name = "toolStripSeparator2";
resources.ApplyResources(this.toolStripSeparator2, "toolStripSeparator2");
//
- // btnConfigureWidgets
+ // btnManageWidgets
//
- this.btnConfigureWidgets.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
- this.btnConfigureWidgets.Image = global::Maestro.Editors.Properties.Resources.gear;
- resources.ApplyResources(this.btnConfigureWidgets, "btnConfigureWidgets");
- this.btnConfigureWidgets.Name = "btnConfigureWidgets";
- this.btnConfigureWidgets.Click += new System.EventHandler(this.btnConfigureWidgets_Click);
+ this.btnManageWidgets.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
+ this.btnManageWidgets.Image = global::Maestro.Editors.Properties.Resources.gear;
+ resources.ApplyResources(this.btnManageWidgets, "btnManageWidgets");
+ this.btnManageWidgets.Name = "btnManageWidgets";
+ this.btnManageWidgets.Click += new System.EventHandler(this.btnManageWidgets_Click);
//
// propertiesPanel
//
@@ -210,7 +210,7 @@
private System.Windows.Forms.ToolStripButton btnMoveUp;
private System.Windows.Forms.ToolStripButton btnMoveDown;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;
- private System.Windows.Forms.ToolStripButton btnConfigureWidgets;
+ private System.Windows.Forms.ToolStripButton btnManageWidgets;
private System.Windows.Forms.ImageList widgetImageList;
private System.Windows.Forms.ToolStripMenuItem widgetToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem separatorToolStripMenuItem;
Modified: sandbox/maestro-3.0/Maestro.Editors/Fusion/WidgetSettingsCtrl.cs
===================================================================
--- sandbox/maestro-3.0/Maestro.Editors/Fusion/WidgetSettingsCtrl.cs 2011-03-08 07:55:20 UTC (rev 5604)
+++ sandbox/maestro-3.0/Maestro.Editors/Fusion/WidgetSettingsCtrl.cs 2011-03-08 12:10:32 UTC (rev 5605)
@@ -48,6 +48,7 @@
private IApplicationDefinition _flexLayout;
private string _baseUrl;
private IEditorService _edsvc;
+ private FlexibleLayoutEditorContext _context;
public override void Bind(IEditorService service)
{
@@ -55,6 +56,7 @@
{
_edsvc = service;
_fsvc = (IFusionService)_edsvc.GetService((int)ServiceType.Fusion);
+ _context = new FlexibleLayoutEditorContext(_fsvc);
_baseUrl = service.GetCustomProperty("BaseUrl").ToString();
if (!_baseUrl.EndsWith("/"))
@@ -134,7 +136,7 @@
{
//at end
var item = _flexLayout.CreateWidgetReference(widget);
- cnt.Insert(item, cnt.ItemCount - 1);
+ cnt.Insert(item, cnt.ItemCount);
this.SelectedNode.Nodes.Add(CreateNode(item));
}
}
@@ -299,9 +301,9 @@
}
}
- private void btnConfigureWidgets_Click(object sender, EventArgs e)
+ private void btnManageWidgets_Click(object sender, EventArgs e)
{
-
+ new WidgetManagementDialog(_flexLayout, _edsvc, _context).ShowDialog();
}
private void trvWidgets_AfterSelect(object sender, TreeViewEventArgs e)
Modified: sandbox/maestro-3.0/Maestro.Editors/Fusion/WidgetSettingsCtrl.resx
===================================================================
--- sandbox/maestro-3.0/Maestro.Editors/Fusion/WidgetSettingsCtrl.resx 2011-03-08 07:55:20 UTC (rev 5604)
+++ sandbox/maestro-3.0/Maestro.Editors/Fusion/WidgetSettingsCtrl.resx 2011-03-08 12:10:32 UTC (rev 5605)
@@ -164,7 +164,7 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj0yLjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAACU
- CQAAAk1TRnQBSQFMAgEBBAEAAVgBAAFYAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
+ CQAAAk1TRnQBSQFMAgEBBAEAAWABAAFgAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
AwABQAMAASADAAEBAQABCAYAAQgYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA
AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5
AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA
@@ -234,6 +234,24 @@
<metadata name="toolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>3, 16</value>
</metadata>
+ <data name="widgetToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
+ <value>152, 22</value>
+ </data>
+ <data name="widgetToolStripMenuItem.Text" xml:space="preserve">
+ <value>Widget</value>
+ </data>
+ <data name="separatorToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
+ <value>152, 22</value>
+ </data>
+ <data name="separatorToolStripMenuItem.Text" xml:space="preserve">
+ <value>Separator</value>
+ </data>
+ <data name="flyoutMenuToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
+ <value>152, 22</value>
+ </data>
+ <data name="flyoutMenuToolStripMenuItem.Text" xml:space="preserve">
+ <value>Flyout Menu</value>
+ </data>
<data name="btnAddWidget.ImageTransparentColor" type="System.Drawing.Color, System.Drawing">
<value>Magenta</value>
</data>
@@ -241,7 +259,7 @@
<value>29, 22</value>
</data>
<data name="btnAddWidget.Text" xml:space="preserve">
- <value>toolStripDropDownButton1</value>
+ <value>Add Widget</value>
</data>
<data name="btnAddContainer.ImageTransparentColor" type="System.Drawing.Color, System.Drawing">
<value>Magenta</value>
@@ -250,7 +268,7 @@
<value>23, 22</value>
</data>
<data name="btnAddContainer.Text" xml:space="preserve">
- <value>toolStripButton1</value>
+ <value>Add Container</value>
</data>
<data name="btnRemoveWidget.Enabled" type="System.Boolean, mscorlib">
<value>False</value>
@@ -294,14 +312,14 @@
<data name="toolStripSeparator2.Size" type="System.Drawing.Size, System.Drawing">
<value>6, 25</value>
</data>
- <data name="btnConfigureWidgets.ImageTransparentColor" type="System.Drawing.Color, System.Drawing">
+ <data name="btnManageWidgets.ImageTransparentColor" type="System.Drawing.Color, System.Drawing">
<value>Magenta</value>
</data>
- <data name="btnConfigureWidgets.Size" type="System.Drawing.Size, System.Drawing">
+ <data name="btnManageWidgets.Size" type="System.Drawing.Size, System.Drawing">
<value>23, 22</value>
</data>
- <data name="btnConfigureWidgets.Text" xml:space="preserve">
- <value>Configure</value>
+ <data name="btnManageWidgets.Text" xml:space="preserve">
+ <value>Manage Widgets</value>
</data>
<data name="toolStrip1.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 16</value>
@@ -366,24 +384,6 @@
<data name=">>contentPanel.ZOrder" xml:space="preserve">
<value>0</value>
</data>
- <data name="widgetToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
- <value>141, 22</value>
- </data>
- <data name="widgetToolStripMenuItem.Text" xml:space="preserve">
- <value>Widget</value>
- </data>
- <data name="separatorToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
- <value>141, 22</value>
- </data>
- <data name="separatorToolStripMenuItem.Text" xml:space="preserve">
- <value>Separator</value>
- </data>
- <data name="flyoutMenuToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
- <value>141, 22</value>
- </data>
- <data name="flyoutMenuToolStripMenuItem.Text" xml:space="preserve">
- <value>Flyout Menu</value>
- </data>
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
@@ -456,16 +456,16 @@
<data name=">>toolStripSeparator2.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripSeparator, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
- <data name=">>btnConfigureWidgets.Name" xml:space="preserve">
- <value>btnConfigureWidgets</value>
+ <data name=">>btnManageWidgets.Name" xml:space="preserve">
+ <value>btnManageWidgets</value>
</data>
- <data name=">>btnConfigureWidgets.Type" xml:space="preserve">
+ <data name=">>btnManageWidgets.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>WidgetSettingsCtrl</value>
</data>
<data name=">>$this.Type" xml:space="preserve">
- <value>Maestro.Editors.Common.EditorBindableCollapsiblePanel, Maestro.Editors, Version=3.0.0.5334, Culture=neutral, PublicKeyToken=null</value>
+ <value>Maestro.Editors.Common.EditorBindableCollapsiblePanel, Maestro.Editors, Version=3.0.0.5475, Culture=neutral, PublicKeyToken=null</value>
</data>
</root>
\ No newline at end of file
Modified: sandbox/maestro-3.0/Maestro.Editors/Maestro.Editors.csproj
===================================================================
--- sandbox/maestro-3.0/Maestro.Editors/Maestro.Editors.csproj 2011-03-08 07:55:20 UTC (rev 5604)
+++ sandbox/maestro-3.0/Maestro.Editors/Maestro.Editors.csproj 2011-03-08 12:10:32 UTC (rev 5605)
@@ -348,6 +348,7 @@
<Compile Include="Fusion\FlexLayoutSettingsCtrl.Designer.cs">
<DependentUpon>FlexLayoutSettingsCtrl.cs</DependentUpon>
</Compile>
+ <Compile Include="Fusion\FusionWidgetEditorMap.cs" />
<Compile Include="Fusion\MapCtrl.cs">
<SubType>UserControl</SubType>
</Compile>
@@ -360,6 +361,18 @@
<Compile Include="Fusion\MapSettingsCtrl.Designer.cs">
<DependentUpon>MapSettingsCtrl.cs</DependentUpon>
</Compile>
+ <Compile Include="Fusion\NewWidgetDialog.cs">
+ <SubType>Form</SubType>
+ </Compile>
+ <Compile Include="Fusion\NewWidgetDialog.Designer.cs">
+ <DependentUpon>NewWidgetDialog.cs</DependentUpon>
+ </Compile>
+ <Compile Include="Fusion\WidgetManagementDialog.cs">
+ <SubType>Form</SubType>
+ </Compile>
+ <Compile Include="Fusion\WidgetManagementDialog.Designer.cs">
+ <DependentUpon>WidgetManagementDialog.cs</DependentUpon>
+ </Compile>
<Compile Include="Fusion\WidgetEditorFactory.cs" />
<Compile Include="Fusion\WidgetEditors\AboutWidgetCtrl.cs">
<SubType>UserControl</SubType>
@@ -1074,6 +1087,12 @@
<EmbeddedResource Include="Fusion\MapSettingsCtrl.resx">
<DependentUpon>MapSettingsCtrl.cs</DependentUpon>
</EmbeddedResource>
+ <EmbeddedResource Include="Fusion\NewWidgetDialog.resx">
+ <DependentUpon>NewWidgetDialog.cs</DependentUpon>
+ </EmbeddedResource>
+ <EmbeddedResource Include="Fusion\WidgetManagementDialog.resx">
+ <DependentUpon>WidgetManagementDialog.cs</DependentUpon>
+ </EmbeddedResource>
<EmbeddedResource Include="Fusion\WidgetEditors\AboutWidgetCtrl.resx">
<DependentUpon>AboutWidgetCtrl.cs</DependentUpon>
</EmbeddedResource>
Modified: sandbox/maestro-3.0/Maestro.Editors/Properties/Resources.Designer.cs
===================================================================
--- sandbox/maestro-3.0/Maestro.Editors/Properties/Resources.Designer.cs 2011-03-08 07:55:20 UTC (rev 5604)
+++ sandbox/maestro-3.0/Maestro.Editors/Properties/Resources.Designer.cs 2011-03-08 12:10:32 UTC (rev 5605)
@@ -602,6 +602,15 @@
}
/// <summary>
+ /// Looks up a localized string similar to This field is required: {0}.
+ /// </summary>
+ internal static string FieldRequired {
+ get {
+ return ResourceManager.GetString("FieldRequired", resourceCulture);
+ }
+ }
+
+ /// <summary>
/// Looks up a localized string similar to An error occured while copying file: {0}.
/// </summary>
internal static string FileCopyError {
@@ -2068,6 +2077,15 @@
}
/// <summary>
+ /// Looks up a localized string similar to Delete this widget and all references to it?.
+ /// </summary>
+ internal static string PromptDeleteWidgetAndReferences {
+ get {
+ return ResourceManager.GetString("PromptDeleteWidgetAndReferences", resourceCulture);
+ }
+ }
+
+ /// <summary>
/// Looks up a localized string similar to Could not find possible values for enumerable property.
/// </summary>
internal static string PropEnumNoValues {
@@ -2583,6 +2601,15 @@
}
/// <summary>
+ /// Looks up a localized string similar to A widget named {0} already exists.
+ /// </summary>
+ internal static string WidgetNameExists {
+ get {
+ return ResourceManager.GetString("WidgetNameExists", resourceCulture);
+ }
+ }
+
+ /// <summary>
/// Looks up a localized string similar to Widget updated.
/// </summary>
internal static string WidgetUpdated {
Modified: sandbox/maestro-3.0/Maestro.Editors/Properties/Resources.resx
===================================================================
--- sandbox/maestro-3.0/Maestro.Editors/Properties/Resources.resx 2011-03-08 07:55:20 UTC (rev 5604)
+++ sandbox/maestro-3.0/Maestro.Editors/Properties/Resources.resx 2011-03-08 12:10:32 UTC (rev 5605)
@@ -1130,4 +1130,13 @@
<data name="UpdatingConfiguration" xml:space="preserve">
<value>Updating Configuration Document</value>
</data>
+ <data name="PromptDeleteWidgetAndReferences" xml:space="preserve">
+ <value>Delete this widget and all references to it?</value>
+ </data>
+ <data name="FieldRequired" xml:space="preserve">
+ <value>This field is required: {0}</value>
+ </data>
+ <data name="WidgetNameExists" xml:space="preserve">
+ <value>A widget named {0} already exists</value>
+ </data>
</root>
\ No newline at end of file
Modified: sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/ObjectModels/ApplicationDefinitionInterfaces.cs
===================================================================
--- sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/ObjectModels/ApplicationDefinitionInterfaces.cs 2011-03-08 07:55:20 UTC (rev 5604)
+++ sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/ObjectModels/ApplicationDefinitionInterfaces.cs 2011-03-08 12:10:32 UTC (rev 5605)
@@ -590,6 +590,100 @@
public static class ExtensionMethods
{
/// <summary>
+ /// Gets whether a widget with the specified name already exists
+ /// </summary>
+ /// <param name="appDef"></param>
+ /// <param name="name"></param>
+ /// <returns></returns>
+ public static bool WidgetNameExists(this IApplicationDefinition appDef, string name)
+ {
+ Check.NotNull(appDef, "appDef");
+ Check.NotEmpty(name, "name");
+
+ foreach (var set in appDef.WidgetSets)
+ {
+ foreach (var wgt in set.Widgets)
+ {
+ if (wgt.Name == name)
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /// <summary>
+ /// Removes the specified widget from this
+ /// </summary>
+ /// <param name="widget"></param>
+ /// <param name="deleteReferences"></param>
+ public static void RemoveWidget(this IApplicationDefinition appDef, string widgetName, bool deleteReferences)
+ {
+ Check.NotNull(appDef, "appDef");
+ Check.NotEmpty(widgetName, "widgetName");
+
+ IWidgetSet matchingSet = null;
+ IWidget matchingWidget = null;
+ foreach (var set in appDef.WidgetSets)
+ {
+ if (matchingSet != null)
+ {
+ foreach (var wgt in set.Widgets)
+ {
+ if (wgt.Name == widgetName)
+ {
+ matchingSet = set;
+ matchingWidget = wgt;
+ break;
+ }
+ }
+ }
+ }
+
+ int removed = 0;
+
+ if (matchingSet != null && matchingWidget != null)
+ {
+ matchingSet.RemoveWidget(matchingWidget);
+
+ if (deleteReferences)
+ {
+ foreach (var set in appDef.WidgetSets)
+ {
+ foreach (var cnt in set.Containers)
+ {
+ var uicnt = cnt as IUIItemContainer;
+ if (uicnt != null)
+ {
+ List<IWidgetItem> removeMe = new List<IWidgetItem>();
+ foreach (var uiitem in uicnt.Items)
+ {
+ IWidgetItem witem = uiitem as IWidgetItem;
+ if (witem != null && witem.Widget == widgetName)
+ {
+ removeMe.Add(witem);
+ System.Diagnostics.Trace.TraceInformation("Found widget reference in container: " + uicnt.Name);
+ }
+ }
+
+ if (removeMe.Count > 0)
+ {
+ foreach (var rm in removeMe)
+ {
+ uicnt.RemoveItem(rm);
+ removed++;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ if (deleteReferences)
+ System.Diagnostics.Trace.TraceInformation(removed + " widget references removed");
+ }
+
+ /// <summary>
/// Gets a specific container info by type
/// </summary>
/// <param name="set"></param>
More information about the mapguide-commits
mailing list