From 64f36a9f1f6debbe1b89634634f60249eb6a57c7 Mon Sep 17 00:00:00 2001 From: Michael Becker Date: Fri, 2 Aug 2019 14:24:56 -0400 Subject: [PATCH] Scaffolding to support Print with PrintHandlers... eventually --- .../Libraries/UniversalEditor.UserInterface/Engine.cs | 4 ++++ .../IHostApplicationWindow.cs | 2 ++ .../UniversalEditor.UserInterface/MainWindow.cs | 10 ++++++++++ 3 files changed, 16 insertions(+) diff --git a/CSharp/Libraries/UniversalEditor.UserInterface/Engine.cs b/CSharp/Libraries/UniversalEditor.UserInterface/Engine.cs index 9df5a23a..76f02fe8 100644 --- a/CSharp/Libraries/UniversalEditor.UserInterface/Engine.cs +++ b/CSharp/Libraries/UniversalEditor.UserInterface/Engine.cs @@ -266,6 +266,10 @@ namespace UniversalEditor.UserInterface { LastWindow.CloseProject(); }); + Application.AttachCommandEventHandler("FilePrint", delegate(object sender, EventArgs e) + { + LastWindow.PrintDocument(); + }); Application.AttachCommandEventHandler("FileRestart", delegate(object sender, EventArgs e) { RestartApplication(); diff --git a/CSharp/Libraries/UniversalEditor.UserInterface/IHostApplicationWindow.cs b/CSharp/Libraries/UniversalEditor.UserInterface/IHostApplicationWindow.cs index 6c5c5d77..3eb7be5e 100644 --- a/CSharp/Libraries/UniversalEditor.UserInterface/IHostApplicationWindow.cs +++ b/CSharp/Libraries/UniversalEditor.UserInterface/IHostApplicationWindow.cs @@ -37,6 +37,8 @@ namespace UniversalEditor.UserInterface void CloseFile(); void CloseProject(); void CloseWindow(); + + void PrintDocument(); Editor GetCurrentEditor(); diff --git a/CSharp/Libraries/UniversalEditor.UserInterface/MainWindow.cs b/CSharp/Libraries/UniversalEditor.UserInterface/MainWindow.cs index 0956a5ab..ab5d90bf 100644 --- a/CSharp/Libraries/UniversalEditor.UserInterface/MainWindow.cs +++ b/CSharp/Libraries/UniversalEditor.UserInterface/MainWindow.cs @@ -611,6 +611,16 @@ namespace UniversalEditor.UserInterface throw new NotImplementedException(); } + public void PrintDocument() + { + Editor editor = GetCurrentEditor (); + if (editor != null) { + PrintDialog dlg = new PrintDialog (); + if (dlg.ShowDialog () == DialogResult.OK) { + } + } + } + public Editor GetCurrentEditor() { Pages.EditorPage page = GetCurrentEditorPage ();