diff --git a/Content/UniversalEditor.Content.PlatformIndependent/Editors/Multimedia3D/Scene/Panels/MotionTestPanel.glade b/Content/UniversalEditor.Content.PlatformIndependent/Editors/Multimedia3D/Scene/Panels/MotionTestPanel.glade
new file mode 100644
index 00000000..04296560
--- /dev/null
+++ b/Content/UniversalEditor.Content.PlatformIndependent/Editors/Multimedia3D/Scene/Panels/MotionTestPanel.glade
@@ -0,0 +1,975 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Content/UniversalEditor.Content.PlatformIndependent/Editors/Multimedia3D/Scene/Panels/MotionTestPanel.uexml b/Content/UniversalEditor.Content.PlatformIndependent/Editors/Multimedia3D/Scene/Panels/MotionTestPanel.uexml
new file mode 100644
index 00000000..1f003d40
--- /dev/null
+++ b/Content/UniversalEditor.Content.PlatformIndependent/Editors/Multimedia3D/Scene/Panels/MotionTestPanel.uexml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/Content/UniversalEditor.Content.PlatformIndependent/UniversalEditor.Content.PlatformIndependent.csproj b/Content/UniversalEditor.Content.PlatformIndependent/UniversalEditor.Content.PlatformIndependent.csproj
index 64a39a39..61990d1e 100644
--- a/Content/UniversalEditor.Content.PlatformIndependent/UniversalEditor.Content.PlatformIndependent.csproj
+++ b/Content/UniversalEditor.Content.PlatformIndependent/UniversalEditor.Content.PlatformIndependent.csproj
@@ -321,6 +321,8 @@
+
+
diff --git a/Libraries/UniversalEditor.UserInterface/Common/Reflection.cs b/Libraries/UniversalEditor.UserInterface/Common/Reflection.cs
index 977bc65f..ec94f3f7 100644
--- a/Libraries/UniversalEditor.UserInterface/Common/Reflection.cs
+++ b/Libraries/UniversalEditor.UserInterface/Common/Reflection.cs
@@ -257,6 +257,24 @@ namespace UniversalEditor.UserInterface.Common
}
}
}
+
+ MarkupTagElement tagPanels = (tagEditor.Elements["Panels"] as MarkupTagElement);
+ if (tagPanels != null)
+ {
+ foreach (MarkupElement elPanel in tagPanels.Elements)
+ {
+ MarkupTagElement tagPanel = (elPanel as MarkupTagElement);
+ if (tagPanel == null) continue;
+
+ PanelReference pr = new PanelReference(new Guid(tagPanel.Attributes["ID"].Value));
+ pr.Title = tagPanel.Attributes["Title"]?.Value;
+ pr.ControlTypeName = tagPanel.Attributes["ControlTypeName"]?.Value;
+ pr.LayoutFileName = tagPanel.Attributes["LayoutFileName"]?.Value;
+
+ er.Panels.Add(pr);
+ }
+ }
+
MarkupTagElement tagVariables = (tagEditor.Elements["Variables"] as MarkupTagElement);
if (tagVariables != null)
{
diff --git a/Libraries/UniversalEditor.UserInterface/EditorApplication.cs b/Libraries/UniversalEditor.UserInterface/EditorApplication.cs
index c5bf4116..f2804265 100644
--- a/Libraries/UniversalEditor.UserInterface/EditorApplication.cs
+++ b/Libraries/UniversalEditor.UserInterface/EditorApplication.cs
@@ -81,6 +81,39 @@ namespace UniversalEditor.UserInterface
public PanelReference.PanelReferenceCollection Panels { get; } = new PanelReference.PanelReferenceCollection();
+ protected override void OnContextAdded(ContextChangedEventArgs e)
+ {
+ base.OnContextAdded(e);
+
+ EditorContext ec = (e.Context as EditorContext);
+ if (ec != null)
+ {
+ foreach (PanelReference panel in ec.Panels)
+ {
+ foreach (IHostApplicationWindow mw in Windows)
+ {
+ mw.AddPanel(panel);
+ }
+ }
+ }
+ }
+ protected override void OnContextRemoved(ContextChangedEventArgs e)
+ {
+ base.OnContextRemoved(e);
+
+ EditorContext ec = (e.Context as EditorContext);
+ if (ec != null)
+ {
+ foreach (PanelReference panel in ec.Panels)
+ {
+ foreach (IHostApplicationWindow mw in Windows)
+ {
+ mw.RemovePanel(panel);
+ }
+ }
+ }
+ }
+
protected override void OnStartup(EventArgs e)
{
base.OnStartup(e);
diff --git a/Libraries/UniversalEditor.UserInterface/EditorContext.cs b/Libraries/UniversalEditor.UserInterface/EditorContext.cs
index 2b73e758..266231c8 100644
--- a/Libraries/UniversalEditor.UserInterface/EditorContext.cs
+++ b/Libraries/UniversalEditor.UserInterface/EditorContext.cs
@@ -29,6 +29,7 @@ namespace UniversalEditor.UserInterface
public class EditorContext : UIContext
{
public EditorReference Reference { get; private set; } = null;
+ public PanelReference.PanelReferenceCollection Panels { get; } = new PanelReference.PanelReferenceCollection();
public override string ToString()
{
@@ -48,6 +49,10 @@ namespace UniversalEditor.UserInterface
{
MenuItems.Add(reference.MenuBar.Items[i]);
}
+ for (int i = 0; i < reference.Panels.Count; i++)
+ {
+ Panels.Add(reference.Panels[i]);
+ }
}
}
}
diff --git a/Libraries/UniversalEditor.UserInterface/EditorReference.cs b/Libraries/UniversalEditor.UserInterface/EditorReference.cs
index 752cb750..29a31aed 100644
--- a/Libraries/UniversalEditor.UserInterface/EditorReference.cs
+++ b/Libraries/UniversalEditor.UserInterface/EditorReference.cs
@@ -31,7 +31,7 @@ namespace UniversalEditor.UserInterface
public CommandBar MenuBar { get; } = new CommandBar();
public Command.CommandCollection Commands { get; } = new Command.CommandCollection();
-
+ public PanelReference.PanelReferenceCollection Panels { get; } = new PanelReference.PanelReferenceCollection();
public EditorView.EditorViewCollection Views { get; } = new EditorView.EditorViewCollection();
public Variable.VariableCollection Variables { get; } = new Variable.VariableCollection();
public Toolbox Toolbox { get; } = new Toolbox();
diff --git a/Libraries/UniversalEditor.UserInterface/IHostApplicationWindow.cs b/Libraries/UniversalEditor.UserInterface/IHostApplicationWindow.cs
index 01cd59c1..81721c63 100644
--- a/Libraries/UniversalEditor.UserInterface/IHostApplicationWindow.cs
+++ b/Libraries/UniversalEditor.UserInterface/IHostApplicationWindow.cs
@@ -87,6 +87,9 @@ namespace UniversalEditor.UserInterface
Document.ReadOnlyDocumentCollection Documents { get; }
Editor.ReadOnlyEditorCollection Editors { get; }
+
+ bool AddPanel(PanelReference panelReference);
+ bool RemovePanel(PanelReference panelReference);
}
public class IHostApplicationWindowCollection
: System.Collections.ObjectModel.Collection
diff --git a/Libraries/UniversalEditor.UserInterface/MainWindow.cs b/Libraries/UniversalEditor.UserInterface/MainWindow.cs
index 4446bfd7..ee0dd231 100644
--- a/Libraries/UniversalEditor.UserInterface/MainWindow.cs
+++ b/Libraries/UniversalEditor.UserInterface/MainWindow.cs
@@ -95,6 +95,11 @@ namespace UniversalEditor.UserInterface
return tab;
}
+ public void UnregisterPanel(PanelReference panelReference, Panel panel)
+ {
+ _MyPanels.Remove(panelReference);
+ _MyPanels_ID.Remove(panelReference.ID);
+ }
public void RegisterPanel(PanelReference panelReference, Panel panel)
{
_MyPanels[panelReference] = panel;
@@ -244,23 +249,7 @@ namespace UniversalEditor.UserInterface
{
foreach (PanelReference panel in ((EditorApplication)Application.Instance).Panels)
{
- Panel p = null;
- if (panel.Control != null)
- {
- p = panel.Control;
- }
- else if (panel.ControlTypeName != null)
- {
- p = MBS.Framework.Reflection.CreateType(panel.ControlTypeName);
- }
- else
- {
- Console.Error.WriteLine("ue: MainWindow.InitializePanels() - could not create panel '{0}'; neither Control nor ControlTypeName were specified", panel.Title);
- continue;
- }
-
- RegisterPanel(panel, p);
- AddPanel(panel.Title, panel.Placement, p);
+ AddPanel(panel);
}
}
@@ -602,6 +591,35 @@ namespace UniversalEditor.UserInterface
}
}
+ public bool AddPanel(PanelReference panelReference)
+ {
+ Panel p = null;
+ if (panelReference.Control != null)
+ {
+ p = panelReference.Control;
+ }
+ else if (panelReference.ControlTypeName != null)
+ {
+ p = MBS.Framework.Reflection.CreateType(panelReference.ControlTypeName);
+ }
+ else
+ {
+ Console.Error.WriteLine("ue: MainWindow.InitializePanels() - could not create panel '{0}'; neither Control nor ControlTypeName were specified", panelReference.Title);
+ return false;
+ }
+
+ RegisterPanel(panelReference, p);
+ AddPanel(panelReference.Title, panelReference.Placement, p);
+ return true;
+ }
+ public bool RemovePanel(PanelReference panelReference)
+ {
+ Panel panel = FindPanel(panelReference.ID);
+ RemovePanel(panel);
+ UnregisterPanel(panelReference, panel);
+ return true;
+ }
+
private DockingContainer AddPanelContainer(DockingItemPlacement placement, DockingContainer parent = null)
{
DockingContainer dc = new DockingContainer();
@@ -616,6 +634,8 @@ namespace UniversalEditor.UserInterface
}
return dc;
}
+
+ private Dictionary dockingWindowsForPanel = new Dictionary();
private void AddPanel(string title, DockingItemPlacement placement, Control control = null, DockingContainer parent = null)
{
if (control == null)
@@ -635,6 +655,12 @@ namespace UniversalEditor.UserInterface
{
dckContainer.Items.Add(dw);
}
+ dockingWindowsForPanel[control] = dw;
+ }
+ private void RemovePanel(Panel panel)
+ {
+ DockingWindow dw = dockingWindowsForPanel[panel];
+ dw.Parent.Items.Remove(dw);
}
private void InitEditorPage(Document doc)
diff --git a/Plugins.UserInterface/UniversalEditor.Plugins.Multimedia3D.UserInterface/Editors/Scene/Panels/MotionTestPanel.cs b/Plugins.UserInterface/UniversalEditor.Plugins.Multimedia3D.UserInterface/Editors/Scene/Panels/MotionTestPanel.cs
new file mode 100644
index 00000000..f5b9f650
--- /dev/null
+++ b/Plugins.UserInterface/UniversalEditor.Plugins.Multimedia3D.UserInterface/Editors/Scene/Panels/MotionTestPanel.cs
@@ -0,0 +1,11 @@
+using System;
+using UniversalEditor.UserInterface;
+
+namespace UniversalEditor.Plugins.Multimedia3D.UserInterface.Editors.Scene.Panels
+{
+ [ContainerLayout("~/Editors/Multimedia3D/Scene/Panels/MotionTestPanel.glade")]
+ public class MotionTestPanel : Panel
+ {
+ public static readonly Guid ID = new Guid("{a94821d1-9bcb-4396-908a-33ce757436b8}");
+ }
+}
diff --git a/Plugins.UserInterface/UniversalEditor.Plugins.Multimedia3D.UserInterface/Editors/Scene/SceneEditor.cs b/Plugins.UserInterface/UniversalEditor.Plugins.Multimedia3D.UserInterface/Editors/Scene/SceneEditor.cs
new file mode 100644
index 00000000..fd088c90
--- /dev/null
+++ b/Plugins.UserInterface/UniversalEditor.Plugins.Multimedia3D.UserInterface/Editors/Scene/SceneEditor.cs
@@ -0,0 +1,50 @@
+//
+// StageEditor.cs
+//
+// Author:
+// Michael Becker
+//
+// Copyright (c) 2021 Mike Becker's Software
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program 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 General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+using System;
+using UniversalEditor.ObjectModels.Multimedia3D.Scene;
+using UniversalEditor.UserInterface;
+
+namespace UniversalEditor.Plugins.Multimedia3D.UserInterface.Editors.Scene
+{
+ public class SceneEditor : Editor
+ {
+ private static EditorReference _er = null;
+ public override EditorReference MakeReference()
+ {
+ if (_er == null)
+ {
+ _er = base.MakeReference();
+ _er.ID = new Guid("{6dbe6294-681b-4d1f-8249-d04a1a3ef4a2}");
+ _er.SupportedObjectModels.Add(typeof(SceneObjectModel));
+ }
+ return _er;
+ }
+
+ public override void UpdateSelections()
+ {
+ }
+
+ protected override Selection CreateSelectionInternal(object content)
+ {
+ return null;
+ }
+ }
+}
diff --git a/Plugins.UserInterface/UniversalEditor.Plugins.Multimedia3D.UserInterface/UniversalEditor.Plugins.Multimedia3D.UserInterface.csproj b/Plugins.UserInterface/UniversalEditor.Plugins.Multimedia3D.UserInterface/UniversalEditor.Plugins.Multimedia3D.UserInterface.csproj
index 6165ecdc..9797927f 100644
--- a/Plugins.UserInterface/UniversalEditor.Plugins.Multimedia3D.UserInterface/UniversalEditor.Plugins.Multimedia3D.UserInterface.csproj
+++ b/Plugins.UserInterface/UniversalEditor.Plugins.Multimedia3D.UserInterface/UniversalEditor.Plugins.Multimedia3D.UserInterface.csproj
@@ -32,6 +32,8 @@
+
+
@@ -70,6 +72,8 @@
+
+