There is only UWT
This commit is contained in:
parent
a70b338b3c
commit
227a902fd1
@ -83,6 +83,10 @@
|
||||
<Project>{30467E5C-05BC-4856-AADC-13906EF4CADD}</Project>
|
||||
<Name>UniversalEditor.Essential</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\..\UniversalWidgetToolkit\Libraries\UniversalWidgetToolkit\UniversalWidgetToolkit.csproj">
|
||||
<Project>{29E1C1BB-3EA5-4062-B62F-85EEC703FE07}</Project>
|
||||
<Name>UniversalWidgetToolkit</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
|
||||
@ -4,7 +4,7 @@ using UniversalWidgetToolkit;
|
||||
|
||||
namespace UniversalEditor.Engines.UWT
|
||||
{
|
||||
public class Editor : Control, IEditorImplementation
|
||||
public class Editor : Control
|
||||
{
|
||||
public Editor()
|
||||
{
|
||||
|
||||
@ -6,51 +6,6 @@ namespace UniversalEditor.Engines.UWT
|
||||
{
|
||||
public class UWTEngine : Engine
|
||||
{
|
||||
#region implemented abstract members of Engine
|
||||
protected override void ShowCrashDialog (Exception ex)
|
||||
{
|
||||
Console.WriteLine (ex.ToString ());
|
||||
}
|
||||
|
||||
protected override void BeforeInitialization ()
|
||||
{
|
||||
UniversalWidgetToolkit.Application.Initialize();
|
||||
}
|
||||
|
||||
protected override void MainLoop ()
|
||||
{
|
||||
UniversalWidgetToolkit.Application.Start ();
|
||||
}
|
||||
protected override IHostApplicationWindow OpenWindowInternal (params Document[] documents)
|
||||
{
|
||||
MainWindow mw = new MainWindow ();
|
||||
LastWindow = mw;
|
||||
mw.Show ();
|
||||
return mw;
|
||||
}
|
||||
public override void ShowAboutDialog (DataFormatReference dfr)
|
||||
{
|
||||
UniversalWidgetToolkit.Dialogs.AboutDialog dlg = new UniversalWidgetToolkit.Dialogs.AboutDialog ();
|
||||
dlg.ProgramName = "Universal Editor";
|
||||
dlg.Version = System.Reflection.Assembly.GetEntryAssembly ().GetName ().Version;
|
||||
dlg.Copyright = "(c) 1997-2016 Michael Becker";
|
||||
dlg.Comments = "A modular, extensible document editor";
|
||||
dlg.LicenseType = UniversalWidgetToolkit.LicenseType.GPL30;
|
||||
dlg.ShowDialog ();
|
||||
}
|
||||
public override bool ShowCustomOptionDialog (ref CustomOption.CustomOptionCollection customOptions, string title = null, EventHandler aboutButtonClicked = null)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
#endregion
|
||||
|
||||
protected override void StopApplicationInternal ()
|
||||
{
|
||||
base.StopApplicationInternal ();
|
||||
|
||||
UniversalWidgetToolkit.Application.Stop ();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@ -33,7 +33,6 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="MainWindow.cs" />
|
||||
<Compile Include="UWTEngine.cs" />
|
||||
<Compile Include="Editor.cs" />
|
||||
</ItemGroup>
|
||||
|
||||
@ -46,7 +46,7 @@ namespace UniversalEditor.UserInterface.Common
|
||||
foreach (Type typeInt in interfaces)
|
||||
{
|
||||
#region Initializing Editors
|
||||
if (typeInt == typeof(IEditorImplementation))
|
||||
if (typeInt == typeof(Editor))
|
||||
{
|
||||
Console.Write("loading editor '" + type.FullName + "'... ");
|
||||
|
||||
@ -54,7 +54,7 @@ namespace UniversalEditor.UserInterface.Common
|
||||
{
|
||||
// TODO: see if there is a way we can MakeReference() without having to create all the UI
|
||||
// components of the IEditorImplementation
|
||||
IEditorImplementation editor = (type.Assembly.CreateInstance(type.FullName) as IEditorImplementation);
|
||||
Editor editor = (type.Assembly.CreateInstance(type.FullName) as Editor);
|
||||
listEditors.Add(editor.MakeReference());
|
||||
|
||||
Console.WriteLine("SUCCESS!");
|
||||
|
||||
@ -1,44 +1,42 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using UniversalWidgetToolkit;
|
||||
|
||||
namespace UniversalEditor.UserInterface
|
||||
{
|
||||
/// <summary>
|
||||
/// Provides an interface for custom editor implementations not using the Universal Widget Toolkit.
|
||||
/// </summary>
|
||||
public interface IEditorImplementation
|
||||
public abstract class Editor : Control
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Copies the selected content to the Universal Editor clipboard.
|
||||
/// </summary>
|
||||
void Copy();
|
||||
public abstract void Copy();
|
||||
/// <summary>
|
||||
/// Pastes the content from the Universal Editor clipboard, overwriting any selected content.
|
||||
/// </summary>
|
||||
void Paste();
|
||||
public abstract void Paste();
|
||||
/// <summary>
|
||||
/// Deletes the selected content.
|
||||
/// </summary>
|
||||
void Delete();
|
||||
public abstract void Delete();
|
||||
|
||||
/// <summary>
|
||||
/// Restores the previous object model in the stack.
|
||||
/// </summary>
|
||||
void Undo();
|
||||
public abstract void Undo();
|
||||
/// <summary>
|
||||
/// Restores the previously-undone object model from the stack.
|
||||
/// </summary>
|
||||
void Redo();
|
||||
public abstract void Redo();
|
||||
|
||||
string Title { get; }
|
||||
public abstract string Title { get; }
|
||||
|
||||
event ToolboxItemEventHandler ToolboxItemAdded;
|
||||
event ToolboxItemEventHandler ToolboxItemSelected;
|
||||
|
||||
bool SelectToolboxItem(ToolboxItem item);
|
||||
public event ToolboxItemEventHandler ToolboxItemAdded;
|
||||
public event ToolboxItemEventHandler ToolboxItemSelected;
|
||||
|
||||
EditorReference MakeReference();
|
||||
public abstract bool SelectToolboxItem(ToolboxItem item);
|
||||
|
||||
public abstract EditorReference MakeReference();
|
||||
}
|
||||
}
|
||||
@ -24,11 +24,11 @@ namespace UniversalEditor.UserInterface
|
||||
mvarEditorType = type;
|
||||
}
|
||||
|
||||
public IEditorImplementation Create()
|
||||
public Editor Create()
|
||||
{
|
||||
if (mvarEditorType != null)
|
||||
{
|
||||
return (mvarEditorType.Assembly.CreateInstance(mvarEditorType.FullName) as IEditorImplementation);
|
||||
return (mvarEditorType.Assembly.CreateInstance(mvarEditorType.FullName) as Editor);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -13,52 +13,64 @@ using UniversalEditor.ObjectModels.Markup;
|
||||
|
||||
namespace UniversalEditor.UserInterface
|
||||
{
|
||||
public abstract class Engine
|
||||
public class Engine
|
||||
{
|
||||
private static Engine _TheEngine = new Engine();
|
||||
|
||||
#region implemented abstract members of Engine
|
||||
protected void ShowCrashDialog (Exception ex)
|
||||
{
|
||||
Console.WriteLine (ex.ToString ());
|
||||
}
|
||||
|
||||
protected void BeforeInitialization ()
|
||||
{
|
||||
UniversalWidgetToolkit.Application.Initialize();
|
||||
}
|
||||
|
||||
protected void MainLoop ()
|
||||
{
|
||||
UniversalWidgetToolkit.Application.Start ();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Opens a new window, optionally loading the specified documents.
|
||||
/// </summary>
|
||||
/// <param name="FileNames">The file name(s) of the document(s) to load.</param>
|
||||
/// <returns>An <see cref="IHostApplicationWindow"/> representing the window that was created.</returns>
|
||||
protected IHostApplicationWindow OpenWindowInternal (params Document[] documents)
|
||||
{
|
||||
MainWindow mw = new MainWindow ();
|
||||
LastWindow = mw;
|
||||
mw.Show ();
|
||||
return mw;
|
||||
}
|
||||
public void ShowAboutDialog (DataFormatReference dfr)
|
||||
{
|
||||
UniversalWidgetToolkit.Dialogs.AboutDialog dlg = new UniversalWidgetToolkit.Dialogs.AboutDialog ();
|
||||
dlg.ProgramName = "Universal Editor";
|
||||
dlg.Version = System.Reflection.Assembly.GetEntryAssembly ().GetName ().Version;
|
||||
dlg.Copyright = "(c) 1997-2016 Michael Becker";
|
||||
dlg.Comments = "A modular, extensible document editor";
|
||||
dlg.LicenseType = UniversalWidgetToolkit.LicenseType.GPL30;
|
||||
dlg.ShowDialog ();
|
||||
}
|
||||
public bool ShowCustomOptionDialog (ref CustomOption.CustomOptionCollection customOptions, string title = null, EventHandler aboutButtonClicked = null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
#endregion
|
||||
|
||||
protected void StopApplicationInternal ()
|
||||
{
|
||||
UniversalWidgetToolkit.Application.Stop ();
|
||||
}
|
||||
|
||||
|
||||
private static Engine[] m_AvailableEngines = null;
|
||||
public static Engine[] GetAvailableEngines()
|
||||
{
|
||||
if (m_AvailableEngines == null)
|
||||
{
|
||||
string directory = System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
|
||||
string[] libraries = System.IO.Directory.GetFiles(directory, "*.dll");
|
||||
List<Engine> engines = new List<Engine>();
|
||||
foreach (string library in libraries)
|
||||
{
|
||||
try
|
||||
{
|
||||
Assembly assembly = Assembly.LoadFile(library);
|
||||
Type[] types = null;
|
||||
try
|
||||
{
|
||||
types = assembly.GetTypes();
|
||||
}
|
||||
catch (ReflectionTypeLoadException ex)
|
||||
{
|
||||
types = ex.Types;
|
||||
}
|
||||
if (types == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
foreach (Type type in types)
|
||||
{
|
||||
if (type.IsSubclassOf(typeof(Engine)))
|
||||
{
|
||||
Engine engine = (Engine)type.Assembly.CreateInstance(type.FullName);
|
||||
engines.Add(engine);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
m_AvailableEngines = engines.ToArray();
|
||||
}
|
||||
return m_AvailableEngines;
|
||||
return new Engine[] { _TheEngine };
|
||||
}
|
||||
|
||||
public bool AttachCommandEventHandler(string commandID, EventHandler handler)
|
||||
@ -73,9 +85,6 @@ namespace UniversalEditor.UserInterface
|
||||
return false;
|
||||
}
|
||||
|
||||
protected virtual void BeforeInitialization()
|
||||
{
|
||||
}
|
||||
protected virtual void AfterInitialization()
|
||||
{
|
||||
}
|
||||
@ -148,31 +157,31 @@ namespace UniversalEditor.UserInterface
|
||||
});
|
||||
AttachCommandEventHandler("EditCopy", delegate(object sender, EventArgs e)
|
||||
{
|
||||
IEditorImplementation editor = LastWindow.GetCurrentEditor();
|
||||
Editor editor = LastWindow.GetCurrentEditor();
|
||||
if (editor == null) return;
|
||||
editor.Copy();
|
||||
});
|
||||
AttachCommandEventHandler("EditPaste", delegate(object sender, EventArgs e)
|
||||
{
|
||||
IEditorImplementation editor = LastWindow.GetCurrentEditor();
|
||||
Editor editor = LastWindow.GetCurrentEditor();
|
||||
if (editor == null) return;
|
||||
editor.Paste();
|
||||
});
|
||||
AttachCommandEventHandler("EditDelete", delegate(object sender, EventArgs e)
|
||||
{
|
||||
IEditorImplementation editor = LastWindow.GetCurrentEditor();
|
||||
Editor editor = LastWindow.GetCurrentEditor();
|
||||
if (editor == null) return;
|
||||
editor.Delete();
|
||||
});
|
||||
AttachCommandEventHandler("EditUndo", delegate(object sender, EventArgs e)
|
||||
{
|
||||
IEditorImplementation editor = LastWindow.GetCurrentEditor();
|
||||
Editor editor = LastWindow.GetCurrentEditor();
|
||||
if (editor == null) return;
|
||||
editor.Undo();
|
||||
});
|
||||
AttachCommandEventHandler("EditRedo", delegate(object sender, EventArgs e)
|
||||
{
|
||||
IEditorImplementation editor = LastWindow.GetCurrentEditor();
|
||||
Editor editor = LastWindow.GetCurrentEditor();
|
||||
if (editor == null) return;
|
||||
editor.Redo();
|
||||
});
|
||||
@ -332,34 +341,9 @@ namespace UniversalEditor.UserInterface
|
||||
|
||||
public static bool Execute()
|
||||
{
|
||||
Engine[] engines = null;
|
||||
try
|
||||
{
|
||||
engines = GetAvailableEngines();
|
||||
}
|
||||
catch
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
for (int i = 0; i < engines.Length; i++)
|
||||
{
|
||||
Console.WriteLine("Found engine " + engines[i].GetType().FullName);
|
||||
}
|
||||
|
||||
if (engines.Length < 1)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (engines.Length == 1)
|
||||
{
|
||||
mvarCurrentEngine = engines[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
mvarCurrentEngine = engines[1];
|
||||
}
|
||||
|
||||
Console.WriteLine(" *** There is only UWT *** ");
|
||||
mvarCurrentEngine = _TheEngine;
|
||||
|
||||
if (mvarCurrentEngine != null)
|
||||
{
|
||||
Console.WriteLine("Using engine " + mvarCurrentEngine.GetType().FullName);
|
||||
@ -380,10 +364,6 @@ namespace UniversalEditor.UserInterface
|
||||
return true;
|
||||
}
|
||||
|
||||
protected abstract void ShowCrashDialog(Exception ex);
|
||||
|
||||
protected abstract void MainLoop();
|
||||
|
||||
private Command.CommandCollection mvarCommands = new Command.CommandCollection();
|
||||
/// <summary>
|
||||
/// The commands defined for this application.
|
||||
@ -465,18 +445,10 @@ namespace UniversalEditor.UserInterface
|
||||
LastWindow.OpenFile(documents);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Opens a new window, optionally loading the specified documents.
|
||||
/// </summary>
|
||||
/// <param name="FileNames">The file name(s) of the document(s) to load.</param>
|
||||
/// <returns>An <see cref="IHostApplicationWindow"/> representing the window that was created.</returns>
|
||||
protected abstract IHostApplicationWindow OpenWindowInternal(params Document[] documents);
|
||||
|
||||
public void ShowAboutDialog()
|
||||
{
|
||||
this.ShowAboutDialog(null);
|
||||
}
|
||||
public abstract void ShowAboutDialog(DataFormatReference dfr);
|
||||
|
||||
public void OpenWindow()
|
||||
{
|
||||
@ -1211,9 +1183,6 @@ namespace UniversalEditor.UserInterface
|
||||
{
|
||||
return true;
|
||||
}
|
||||
protected virtual void StopApplicationInternal()
|
||||
{
|
||||
}
|
||||
|
||||
public bool ShowCustomOptionDialog(ref DataFormat df, CustomOptionDialogType type)
|
||||
{
|
||||
@ -1365,7 +1334,6 @@ namespace UniversalEditor.UserInterface
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public abstract bool ShowCustomOptionDialog(ref CustomOption.CustomOptionCollection customOptions, string title = null, EventHandler aboutButtonClicked = null);
|
||||
|
||||
public virtual ActionMenuItem[] CreateMenuItemsFromPlaceholder(PlaceholderMenuItem pmi)
|
||||
{
|
||||
|
||||
@ -38,7 +38,7 @@ namespace UniversalEditor.UserInterface
|
||||
void CloseProject();
|
||||
void CloseWindow();
|
||||
|
||||
IEditorImplementation GetCurrentEditor();
|
||||
Editor GetCurrentEditor();
|
||||
|
||||
bool FullScreen { get; set; }
|
||||
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
using System;
|
||||
using System;
|
||||
|
||||
using UniversalEditor.Accessors;
|
||||
using UniversalEditor.UserInterface;
|
||||
|
||||
using UniversalWidgetToolkit;
|
||||
using UniversalWidgetToolkit.Controls;
|
||||
@ -11,43 +10,45 @@ using UniversalWidgetToolkit.Input.Keyboard;
|
||||
|
||||
// TODO: We need to work on UWT signaling to native objects...
|
||||
|
||||
namespace UniversalEditor.Engines.UWT
|
||||
namespace UniversalEditor.UserInterface
|
||||
{
|
||||
public class MainWindow : Window, IHostApplicationWindow
|
||||
{
|
||||
private DockingContainer tbsDocumentTabs = null;
|
||||
|
||||
public MainWindow ()
|
||||
public MainWindow()
|
||||
{
|
||||
UniversalWidgetToolkit.Layouts.BoxLayout layout = new UniversalWidgetToolkit.Layouts.BoxLayout (Orientation.Vertical);
|
||||
UniversalWidgetToolkit.Layouts.BoxLayout layout = new UniversalWidgetToolkit.Layouts.BoxLayout(Orientation.Vertical);
|
||||
this.Layout = layout;
|
||||
|
||||
foreach (CommandItem ci in UniversalEditor.UserInterface.Engine.CurrentEngine.MainMenu.Items) {
|
||||
UniversalWidgetToolkit.MenuItem mi = LoadMenuItem (ci);
|
||||
foreach (CommandItem ci in Engine.CurrentEngine.MainMenu.Items)
|
||||
{
|
||||
UniversalWidgetToolkit.MenuItem mi = LoadMenuItem(ci);
|
||||
if (mi == null)
|
||||
continue;
|
||||
|
||||
if (mi.Name == "Help") {
|
||||
if (mi.Name == "Help")
|
||||
{
|
||||
mi.HorizontalAlignment = MenuItemHorizontalAlignment.Right;
|
||||
}
|
||||
this.MenuBar.Items.Add (mi);
|
||||
this.MenuBar.Items.Add(mi);
|
||||
}
|
||||
|
||||
tbsDocumentTabs = new DockingContainer ();
|
||||
tbsDocumentTabs = new DockingContainer();
|
||||
|
||||
InitStartPage();
|
||||
InitEditorPage("test.txt");
|
||||
|
||||
this.Controls.Add(tbsDocumentTabs, new UniversalWidgetToolkit.Layouts.BoxLayout.Constraints(true, true, 0, UniversalWidgetToolkit.Layouts.BoxLayout.PackType.End));
|
||||
|
||||
this.Bounds = new UniversalWidgetToolkit.Drawing.Rectangle (0, 0, 600, 400);
|
||||
this.Bounds = new UniversalWidgetToolkit.Drawing.Rectangle(0, 0, 600, 400);
|
||||
|
||||
this.Text = "Universal Editor";
|
||||
}
|
||||
|
||||
private void InitEditorPage(string title)
|
||||
{
|
||||
TextBox txt = new TextBox();
|
||||
TextBox txt = new TextBox();
|
||||
txt.Text = "Testing for " + title;
|
||||
txt.Multiline = true;
|
||||
|
||||
@ -72,30 +73,32 @@ namespace UniversalEditor.Engines.UWT
|
||||
if (mi == null)
|
||||
return;
|
||||
|
||||
Command cmd = UniversalEditor.UserInterface.Engine.CurrentEngine.Commands [mi.Name];
|
||||
if (cmd == null) {
|
||||
Console.WriteLine ("unknown cmd '" + mi.Name + "'");
|
||||
Command cmd = UniversalEditor.UserInterface.Engine.CurrentEngine.Commands[mi.Name];
|
||||
if (cmd == null)
|
||||
{
|
||||
Console.WriteLine("unknown cmd '" + mi.Name + "'");
|
||||
return;
|
||||
}
|
||||
|
||||
cmd.Execute ();
|
||||
cmd.Execute();
|
||||
}
|
||||
|
||||
public override void OnActivate (EventArgs e)
|
||||
public override void OnActivate(EventArgs e)
|
||||
{
|
||||
Console.WriteLine ("Window activated");
|
||||
Console.WriteLine("Window activated");
|
||||
}
|
||||
|
||||
public override void OnClosed(EventArgs e)
|
||||
{
|
||||
UniversalWidgetToolkit.Application.Stop ();
|
||||
UniversalWidgetToolkit.Application.Stop();
|
||||
}
|
||||
|
||||
private Shortcut CommandShortcutKeyToUWTShortcut(CommandShortcutKey shortcutKey)
|
||||
{
|
||||
KeyboardKey key = KeyboardKey.None;
|
||||
|
||||
switch (shortcutKey.Value) {
|
||||
switch (shortcutKey.Value)
|
||||
{
|
||||
case CommandShortcutKeyValue.A:
|
||||
{
|
||||
key = KeyboardKey.A;
|
||||
@ -236,97 +239,110 @@ namespace UniversalEditor.Engines.UWT
|
||||
if ((shortcutKey.Modifiers & CommandShortcutKeyModifiers.Shift) == CommandShortcutKeyModifiers.Shift) modifierKeys |= KeyboardModifierKey.Shift;
|
||||
if ((shortcutKey.Modifiers & CommandShortcutKeyModifiers.Super) == CommandShortcutKeyModifiers.Super) modifierKeys |= KeyboardModifierKey.Super;
|
||||
|
||||
return new Shortcut (key, modifierKeys);
|
||||
return new Shortcut(key, modifierKeys);
|
||||
}
|
||||
|
||||
private UniversalWidgetToolkit.MenuItem LoadMenuItem(CommandItem ci)
|
||||
{
|
||||
if (ci is CommandReferenceCommandItem) {
|
||||
if (ci is CommandReferenceCommandItem)
|
||||
{
|
||||
CommandReferenceCommandItem crci = (ci as CommandReferenceCommandItem);
|
||||
|
||||
Command cmd = UniversalEditor.UserInterface.Engine.CurrentEngine.Commands [crci.CommandID];
|
||||
if (cmd != null) {
|
||||
CommandMenuItem mi = new CommandMenuItem (cmd.Title);
|
||||
Command cmd = UniversalEditor.UserInterface.Engine.CurrentEngine.Commands[crci.CommandID];
|
||||
if (cmd != null)
|
||||
{
|
||||
CommandMenuItem mi = new CommandMenuItem(cmd.Title);
|
||||
mi.Name = cmd.ID;
|
||||
mi.Shortcut = CommandShortcutKeyToUWTShortcut (cmd.ShortcutKey);
|
||||
if (cmd.Items.Count > 0) {
|
||||
foreach (CommandItem ci1 in cmd.Items) {
|
||||
UniversalWidgetToolkit.MenuItem mi1 = LoadMenuItem (ci1);
|
||||
mi.Items.Add (mi1);
|
||||
mi.Shortcut = CommandShortcutKeyToUWTShortcut(cmd.ShortcutKey);
|
||||
if (cmd.Items.Count > 0)
|
||||
{
|
||||
foreach (CommandItem ci1 in cmd.Items)
|
||||
{
|
||||
UniversalWidgetToolkit.MenuItem mi1 = LoadMenuItem(ci1);
|
||||
mi.Items.Add(mi1);
|
||||
}
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
mi.Click += MainWindow_MenuBar_Item_Click;
|
||||
}
|
||||
return mi;
|
||||
} else {
|
||||
Console.WriteLine ("attempted to load unknown cmd '" + crci.CommandID + "'");
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("attempted to load unknown cmd '" + crci.CommandID + "'");
|
||||
}
|
||||
return null;
|
||||
} else if (ci is SeparatorCommandItem) {
|
||||
return new UniversalWidgetToolkit.SeparatorMenuItem ();
|
||||
}
|
||||
else if (ci is SeparatorCommandItem)
|
||||
{
|
||||
return new UniversalWidgetToolkit.SeparatorMenuItem();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
#region IHostApplicationWindow implementation
|
||||
|
||||
public void NewFile ()
|
||||
public void NewFile()
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void NewProject (bool combineObjects = false)
|
||||
public void NewProject(bool combineObjects = false)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void OpenFile ()
|
||||
public void OpenFile()
|
||||
{
|
||||
FileDialog dlg = new FileDialog ();
|
||||
FileDialog dlg = new FileDialog();
|
||||
dlg.Mode = FileDialogMode.Open;
|
||||
dlg.MultiSelect = true;
|
||||
if (dlg.ShowDialog () == DialogResult.OK) {
|
||||
OpenFile (dlg.SelectedFileNames.ToArray ());
|
||||
if (dlg.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
OpenFile(dlg.SelectedFileNames.ToArray());
|
||||
}
|
||||
}
|
||||
|
||||
public void OpenFile (params string[] fileNames)
|
||||
public void OpenFile(params string[] fileNames)
|
||||
{
|
||||
Document[] documents = new Document[fileNames.Length];
|
||||
for (int i = 0; i < documents.Length; i++) {
|
||||
FileAccessor fa = new FileAccessor (fileNames [i]);
|
||||
documents [i] = new Document (fa);
|
||||
for (int i = 0; i < documents.Length; i++)
|
||||
{
|
||||
FileAccessor fa = new FileAccessor(fileNames[i]);
|
||||
documents[i] = new Document(fa);
|
||||
}
|
||||
OpenFile (documents);
|
||||
OpenFile(documents);
|
||||
}
|
||||
|
||||
public void OpenFile (params Document[] documents)
|
||||
public void OpenFile(params Document[] documents)
|
||||
{
|
||||
foreach (Document doc in documents) {
|
||||
foreach (Document doc in documents)
|
||||
{
|
||||
InitEditorPage(doc.Title);
|
||||
}
|
||||
}
|
||||
|
||||
public void OpenProject (bool combineObjects = false)
|
||||
public void OpenProject(bool combineObjects = false)
|
||||
{
|
||||
FileDialog dlg = new FileDialog ();
|
||||
dlg.FileNameFilters.Add ("Project files", "*.ueproj");
|
||||
dlg.FileNameFilters.Add ("Solution files", "*.uesln");
|
||||
FileDialog dlg = new FileDialog();
|
||||
dlg.FileNameFilters.Add("Project files", "*.ueproj");
|
||||
dlg.FileNameFilters.Add("Solution files", "*.uesln");
|
||||
dlg.Title = "Open Project or Solution";
|
||||
if (dlg.ShowDialog () == DialogResult.OK) {
|
||||
if (dlg.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public void OpenProject (string FileName, bool combineObjects = false)
|
||||
public void OpenProject(string FileName, bool combineObjects = false)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void SaveFile ()
|
||||
public void SaveFile()
|
||||
{
|
||||
IEditorImplementation currentEditor = GetCurrentEditor();
|
||||
Editor currentEditor = GetCurrentEditor();
|
||||
if (currentEditor != null)
|
||||
{
|
||||
FileDialog fd = new FileDialog();
|
||||
@ -338,43 +354,43 @@ namespace UniversalEditor.Engines.UWT
|
||||
}
|
||||
}
|
||||
|
||||
public void SaveFileAs ()
|
||||
public void SaveFileAs()
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void SaveFileAs (string FileName, DataFormat df)
|
||||
public void SaveFileAs(string FileName, DataFormat df)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void SaveProject ()
|
||||
public void SaveProject()
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void SaveProjectAs ()
|
||||
public void SaveProjectAs()
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void SaveProjectAs (string FileName, DataFormat df)
|
||||
public void SaveProjectAs(string FileName, DataFormat df)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void SaveAll ()
|
||||
public void SaveAll()
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void SwitchPerspective (int index)
|
||||
public void SwitchPerspective(int index)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
private System.Collections.Generic.List<Window> Windows = new System.Collections.Generic.List<Window>();
|
||||
public void CloseFile ()
|
||||
public void CloseFile()
|
||||
{
|
||||
if (tbsDocumentTabs.CurrentItem != null)
|
||||
{
|
||||
@ -386,17 +402,17 @@ namespace UniversalEditor.Engines.UWT
|
||||
}
|
||||
}
|
||||
|
||||
public void CloseProject ()
|
||||
public void CloseProject()
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void CloseWindow ()
|
||||
public void CloseWindow()
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public IEditorImplementation GetCurrentEditor ()
|
||||
public Editor GetCurrentEditor()
|
||||
{
|
||||
DockingItem curitem = tbsDocumentTabs.CurrentItem;
|
||||
if (curitem == null) return null;
|
||||
@ -407,7 +423,7 @@ namespace UniversalEditor.Engines.UWT
|
||||
return editor;
|
||||
}
|
||||
|
||||
public bool ShowOptionsDialog ()
|
||||
public bool ShowOptionsDialog()
|
||||
{
|
||||
OptionsDialog dlg = new OptionsDialog();
|
||||
if (dlg.ShowDialog() == DialogResult.OK)
|
||||
@ -417,44 +433,44 @@ namespace UniversalEditor.Engines.UWT
|
||||
return false;
|
||||
}
|
||||
|
||||
public void ToggleMenuItemEnabled (string menuItemName, bool enabled)
|
||||
public void ToggleMenuItemEnabled(string menuItemName, bool enabled)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void RefreshCommand (object nativeCommandObject)
|
||||
public void RefreshCommand(object nativeCommandObject)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void UpdateStatus (string statusText)
|
||||
public void UpdateStatus(string statusText)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void UpdateProgress (bool visible)
|
||||
public void UpdateProgress(bool visible)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void UpdateProgress (int minimum, int maximium, int value)
|
||||
public void UpdateProgress(int minimum, int maximium, int value)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void ActivateWindow ()
|
||||
public void ActivateWindow()
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void ShowStartPage ()
|
||||
public void ShowStartPage()
|
||||
{
|
||||
InitStartPage();
|
||||
}
|
||||
|
||||
public void SetWindowListVisible (bool visible, bool modal)
|
||||
public void SetWindowListVisible(bool visible, bool modal)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public event EventHandler WindowClosed;
|
||||
@ -464,4 +480,3 @@ namespace UniversalEditor.Engines.UWT
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@ -67,7 +67,7 @@
|
||||
<Compile Include="HostApplication.cs" />
|
||||
<Compile Include="HostApplicationMessage.cs" />
|
||||
<Compile Include="HostApplicationOutputWindow.cs" />
|
||||
<Compile Include="IEditorImplementation.cs" />
|
||||
<Compile Include="Editor.cs" />
|
||||
<Compile Include="IHostApplicationWindow.cs" />
|
||||
<Compile Include="IOptionPanelImplementation.cs" />
|
||||
<Compile Include="Language.cs" />
|
||||
@ -89,6 +89,7 @@
|
||||
<Compile Include="Command.cs" />
|
||||
<Compile Include="StockCommandType.cs" />
|
||||
<Compile Include="EngineMainMenu.cs" />
|
||||
<Compile Include="MainWIndow.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
|
||||
@ -116,6 +117,10 @@
|
||||
<Project>{30467E5C-05BC-4856-AADC-13906EF4CADD}</Project>
|
||||
<Name>UniversalEditor.Essential</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\..\UniversalWidgetToolkit\Libraries\UniversalWidgetToolkit\UniversalWidgetToolkit.csproj">
|
||||
<Project>{29E1C1BB-3EA5-4062-B62F-85EEC703FE07}</Project>
|
||||
<Name>UniversalWidgetToolkit</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
|
||||
@ -17,14 +17,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UniversalEditor.UserInterfa
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UniversalEditor.Essential", "Libraries\UniversalEditor.Essential\UniversalEditor.Essential.csproj", "{30467E5C-05BC-4856-AADC-13906EF4CADD}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Engines", "Engines", "{B55B87C2-12E7-4622-A9CB-10A56666C8C6}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "UWT", "UWT", "{3BEAD9B7-C2C3-48FA-BF20-9AFF31FC3DE1}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Engines", "Engines", "{EB8C50C4-8C47-4644-94C6-3D2DC9A69D36}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UniversalEditor.Engines.UWT", "Engines\UWT\UniversalEditor.Engines.UWT\UniversalEditor.Engines.UWT.csproj", "{90B038C3-99D3-4E18-AFA8-FB5941909732}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Dependencies", "Dependencies", "{20F315E0-52AE-479F-AF43-3402482C1FC8}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UniversalWidgetToolkit", "..\..\UniversalWidgetToolkit\Libraries\UniversalWidgetToolkit\UniversalWidgetToolkit.csproj", "{29E1C1BB-3EA5-4062-B62F-85EEC703FE07}"
|
||||
@ -245,10 +237,6 @@ Global
|
||||
{899E3DD6-EA65-4168-AAE3-867A4F9650A6}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{899E3DD6-EA65-4168-AAE3-867A4F9650A6}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{899E3DD6-EA65-4168-AAE3-867A4F9650A6}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{90B038C3-99D3-4E18-AFA8-FB5941909732}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{90B038C3-99D3-4E18-AFA8-FB5941909732}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{90B038C3-99D3-4E18-AFA8-FB5941909732}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{90B038C3-99D3-4E18-AFA8-FB5941909732}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{988052D4-92F5-4A6F-BE1D-33852D1E5D1E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{988052D4-92F5-4A6F-BE1D-33852D1E5D1E}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{988052D4-92F5-4A6F-BE1D-33852D1E5D1E}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
@ -343,10 +331,6 @@ Global
|
||||
{2D4737E6-6D95-408A-90DB-8DFF38147E85} = {0399182F-AF56-4E86-B229-EAB38C2EE6AF}
|
||||
{8622EBC4-8E20-476E-B284-33D472081F5C} = {0399182F-AF56-4E86-B229-EAB38C2EE6AF}
|
||||
{30467E5C-05BC-4856-AADC-13906EF4CADD} = {0399182F-AF56-4E86-B229-EAB38C2EE6AF}
|
||||
{3BEAD9B7-C2C3-48FA-BF20-9AFF31FC3DE1} = {B55B87C2-12E7-4622-A9CB-10A56666C8C6}
|
||||
{EB8C50C4-8C47-4644-94C6-3D2DC9A69D36} = {3BEAD9B7-C2C3-48FA-BF20-9AFF31FC3DE1}
|
||||
{20F315E0-52AE-479F-AF43-3402482C1FC8} = {3BEAD9B7-C2C3-48FA-BF20-9AFF31FC3DE1}
|
||||
{90B038C3-99D3-4E18-AFA8-FB5941909732} = {EB8C50C4-8C47-4644-94C6-3D2DC9A69D36}
|
||||
{29E1C1BB-3EA5-4062-B62F-85EEC703FE07} = {20F315E0-52AE-479F-AF43-3402482C1FC8}
|
||||
{62DC7CF9-C608-49E5-8C39-305B2E3E93F6} = {20F315E0-52AE-479F-AF43-3402482C1FC8}
|
||||
{64089452-6A08-47A5-A857-BF418F80D4A3} = {2ED32D16-6C06-4450-909A-40D32DA67FB4}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user