From ac2ac92751b36f732343082d76b7597e904f005f Mon Sep 17 00:00:00 2001 From: alcexhim Date: Thu, 26 Jun 2014 06:29:04 -0400 Subject: [PATCH] Some fixes for GTK engine --- .../GTKEngine.cs | 16 ++- .../MainWindow.cs | 116 +++++++++++++++++- .../gtk-gui/gui.stetic | 2 +- CSharp/UniversalEditor.GTK.userprefs | 18 +-- 4 files changed, 139 insertions(+), 13 deletions(-) diff --git a/CSharp/Environments/GTK/Engines/UniversalEditor.Environments.GTK/GTKEngine.cs b/CSharp/Environments/GTK/Engines/UniversalEditor.Environments.GTK/GTKEngine.cs index bf8bb64b..d1510fff 100644 --- a/CSharp/Environments/GTK/Engines/UniversalEditor.Environments.GTK/GTKEngine.cs +++ b/CSharp/Environments/GTK/Engines/UniversalEditor.Environments.GTK/GTKEngine.cs @@ -5,13 +5,23 @@ namespace UniversalEditor.Environments.GTK { public class GTKEngine : UniversalEditor.UserInterface.Engine { + protected override void BeforeInitialization () + { + base.BeforeInitialization (); + Application.Init (); + } + protected override void MainLoop () { - Application.Init (); - MainWindow win = new MainWindow (); - win.Show (); Application.Run (); } + + protected override UniversalEditor.UserInterface.IHostApplicationWindow OpenWindowInternal (params string[] FileNames) + { + MainWindow mw = new MainWindow(); + mw.Show (); + return mw; + } } } diff --git a/CSharp/Environments/GTK/Engines/UniversalEditor.Environments.GTK/MainWindow.cs b/CSharp/Environments/GTK/Engines/UniversalEditor.Environments.GTK/MainWindow.cs index 80163c2c..b2aaf106 100644 --- a/CSharp/Environments/GTK/Engines/UniversalEditor.Environments.GTK/MainWindow.cs +++ b/CSharp/Environments/GTK/Engines/UniversalEditor.Environments.GTK/MainWindow.cs @@ -3,7 +3,7 @@ using Gtk; using UniversalEditor.UserInterface; -public partial class MainWindow: Gtk.Window +public partial class MainWindow: Gtk.Window, IHostApplicationWindow { public MainWindow (): base (Gtk.WindowType.Toplevel) { @@ -76,4 +76,118 @@ public partial class MainWindow: Gtk.Window Application.Quit (); a.RetVal = true; } + + #region IHostApplicationWindow implementation + public event EventHandler WindowClosed; + + public void NewFile () + { + throw new System.NotImplementedException (); + } + + public void NewProject (bool combineObjects) + { + throw new System.NotImplementedException (); + } + + public void OpenFile () + { + throw new System.NotImplementedException (); + } + + public void OpenFile (params string[] FileNames) + { + throw new System.NotImplementedException (); + } + + public void OpenProject (bool combineObjects) + { + throw new System.NotImplementedException (); + } + + public void OpenProject (string FileName, bool combineObjects) + { + throw new System.NotImplementedException (); + } + + public void SaveFile () + { + throw new System.NotImplementedException (); + } + + public void SaveFileAs () + { + throw new System.NotImplementedException (); + } + + public void SaveFileAs (string FileName, UniversalEditor.DataFormat df) + { + throw new System.NotImplementedException (); + } + + public void SaveProject () + { + throw new System.NotImplementedException (); + } + + public void SaveProjectAs () + { + throw new System.NotImplementedException (); + } + + public void SaveProjectAs (string FileName, UniversalEditor.DataFormat df) + { + throw new System.NotImplementedException (); + } + + public void SaveAll () + { + throw new System.NotImplementedException (); + } + + public void CloseFile () + { + throw new System.NotImplementedException (); + } + + public void CloseWindow () + { + throw new System.NotImplementedException (); + } + + public bool ShowOptionsDialog () + { + throw new System.NotImplementedException (); + } + + public void ToggleMenuItemEnabled (string menuItemName, bool enabled) + { + throw new System.NotImplementedException (); + } + + public void RefreshCommand (object nativeCommandObject) + { + throw new System.NotImplementedException (); + } + + public void UpdateStatus (string statusText) + { + throw new System.NotImplementedException (); + } + + public void UpdateProgress (bool visible) + { + throw new System.NotImplementedException (); + } + + public void UpdateProgress (int minimum, int maximium, int value) + { + throw new System.NotImplementedException (); + } + + public void ActivateWindow () + { + throw new System.NotImplementedException (); + } + #endregion } diff --git a/CSharp/Environments/GTK/Engines/UniversalEditor.Environments.GTK/gtk-gui/gui.stetic b/CSharp/Environments/GTK/Engines/UniversalEditor.Environments.GTK/gtk-gui/gui.stetic index 0118b136..61cf9407 100644 --- a/CSharp/Environments/GTK/Engines/UniversalEditor.Environments.GTK/gtk-gui/gui.stetic +++ b/CSharp/Environments/GTK/Engines/UniversalEditor.Environments.GTK/gtk-gui/gui.stetic @@ -106,7 +106,7 @@ False - + 1 diff --git a/CSharp/UniversalEditor.GTK.userprefs b/CSharp/UniversalEditor.GTK.userprefs index a5c12d89..ab7894a4 100644 --- a/CSharp/UniversalEditor.GTK.userprefs +++ b/CSharp/UniversalEditor.GTK.userprefs @@ -2,8 +2,8 @@ - - + + @@ -13,11 +13,16 @@ - + - + + + + + + @@ -27,10 +32,7 @@ - - - - + \ No newline at end of file