Start working seriously on UWT
This commit is contained in:
parent
b4c01fe286
commit
a70b338b3c
53
CSharp/Engines/UWT/UniversalEditor.Engines.UWT/Editor.cs
Normal file
53
CSharp/Engines/UWT/UniversalEditor.Engines.UWT/Editor.cs
Normal file
@ -0,0 +1,53 @@
|
||||
using System;
|
||||
using UniversalEditor.UserInterface;
|
||||
using UniversalWidgetToolkit;
|
||||
|
||||
namespace UniversalEditor.Engines.UWT
|
||||
{
|
||||
public class Editor : Control, IEditorImplementation
|
||||
{
|
||||
public Editor()
|
||||
{
|
||||
}
|
||||
|
||||
public string Title => throw new NotImplementedException();
|
||||
|
||||
public event ToolboxItemEventHandler ToolboxItemAdded;
|
||||
public event ToolboxItemEventHandler ToolboxItemSelected;
|
||||
|
||||
public void Copy()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void Delete()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public EditorReference MakeReference()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void Paste()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void Redo()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public bool SelectToolboxItem(ToolboxItem item)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void Undo()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -9,6 +9,8 @@ using UniversalWidgetToolkit.Controls.Docking;
|
||||
using UniversalWidgetToolkit.Dialogs;
|
||||
using UniversalWidgetToolkit.Input.Keyboard;
|
||||
|
||||
// TODO: We need to work on UWT signaling to native objects...
|
||||
|
||||
namespace UniversalEditor.Engines.UWT
|
||||
{
|
||||
public class MainWindow : Window, IHostApplicationWindow
|
||||
@ -33,19 +35,8 @@ namespace UniversalEditor.Engines.UWT
|
||||
|
||||
tbsDocumentTabs = new DockingContainer ();
|
||||
|
||||
Container ctStartPage = new Container();
|
||||
|
||||
Label lblStartPage = new Label();
|
||||
lblStartPage.Text = "this is a start page";
|
||||
ctStartPage.Controls.Add(lblStartPage);
|
||||
|
||||
InitDocTab("Start Page", ctStartPage);
|
||||
|
||||
TextBox txt = new TextBox();
|
||||
txt.Multiline = true;
|
||||
|
||||
InitDocTab("file1.txt", txt);
|
||||
InitDocTab("Archive3.zip", null);
|
||||
InitStartPage();
|
||||
InitEditorPage("test.txt");
|
||||
|
||||
this.Controls.Add(tbsDocumentTabs, new UniversalWidgetToolkit.Layouts.BoxLayout.Constraints(true, true, 0, UniversalWidgetToolkit.Layouts.BoxLayout.PackType.End));
|
||||
|
||||
@ -54,6 +45,21 @@ namespace UniversalEditor.Engines.UWT
|
||||
this.Text = "Universal Editor";
|
||||
}
|
||||
|
||||
private void InitEditorPage(string title)
|
||||
{
|
||||
TextBox txt = new TextBox();
|
||||
txt.Text = "Testing for " + title;
|
||||
txt.Multiline = true;
|
||||
|
||||
InitDocTab(title, txt);
|
||||
}
|
||||
private void InitStartPage()
|
||||
{
|
||||
Label lblStartPage = new Label();
|
||||
lblStartPage.Text = "this is a start page";
|
||||
InitDocTab("Start Page", lblStartPage);
|
||||
}
|
||||
|
||||
private void InitDocTab(string title, Control content)
|
||||
{
|
||||
DockingItem item = new DockingItem(title, content);
|
||||
@ -298,9 +304,7 @@ namespace UniversalEditor.Engines.UWT
|
||||
public void OpenFile (params Document[] documents)
|
||||
{
|
||||
foreach (Document doc in documents) {
|
||||
TabPage tab = new TabPage ();
|
||||
tab.Text = doc.Title;
|
||||
// tbsDocumentTabs.TabPages.Add (tab);
|
||||
InitEditorPage(doc.Title);
|
||||
}
|
||||
}
|
||||
|
||||
@ -369,9 +373,17 @@ namespace UniversalEditor.Engines.UWT
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
private System.Collections.Generic.List<Window> Windows = new System.Collections.Generic.List<Window>();
|
||||
public void CloseFile ()
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
if (tbsDocumentTabs.CurrentItem != null)
|
||||
{
|
||||
tbsDocumentTabs.Items.Remove(tbsDocumentTabs.CurrentItem);
|
||||
}
|
||||
if (this.Windows.Count == 0)
|
||||
{
|
||||
this.Destroy();
|
||||
}
|
||||
}
|
||||
|
||||
public void CloseProject ()
|
||||
@ -386,12 +398,23 @@ namespace UniversalEditor.Engines.UWT
|
||||
|
||||
public IEditorImplementation GetCurrentEditor ()
|
||||
{
|
||||
return null;
|
||||
DockingItem curitem = tbsDocumentTabs.CurrentItem;
|
||||
if (curitem == null) return null;
|
||||
|
||||
Editor editor = (curitem.ChildControl as Editor);
|
||||
if (editor == null) return null;
|
||||
|
||||
return editor;
|
||||
}
|
||||
|
||||
public bool ShowOptionsDialog ()
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
OptionsDialog dlg = new OptionsDialog();
|
||||
if (dlg.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public void ToggleMenuItemEnabled (string menuItemName, bool enabled)
|
||||
@ -426,7 +449,7 @@ namespace UniversalEditor.Engines.UWT
|
||||
|
||||
public void ShowStartPage ()
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
InitStartPage();
|
||||
}
|
||||
|
||||
public void SetWindowListVisible (bool visible, bool modal)
|
||||
|
||||
@ -26,7 +26,7 @@ namespace UniversalEditor.Engines.UWT
|
||||
MainWindow mw = new MainWindow ();
|
||||
LastWindow = mw;
|
||||
mw.Show ();
|
||||
return mw;
|
||||
return mw;
|
||||
}
|
||||
public override void ShowAboutDialog (DataFormatReference dfr)
|
||||
{
|
||||
|
||||
@ -35,6 +35,7 @@
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="MainWindow.cs" />
|
||||
<Compile Include="UWTEngine.cs" />
|
||||
<Compile Include="Editor.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<ItemGroup>
|
||||
@ -55,4 +56,7 @@
|
||||
<Name>UniversalEditor.UserInterface</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Editors\" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
Loading…
x
Reference in New Issue
Block a user