From ad73227b8e68d290ca008e5195ffb9624ee64b09 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jean-Philippe=20Bruy=C3=A8re?= Date: Thu, 29 Nov 2018 16:30:15 +0100 Subject: [PATCH] debug log view --- Crow.csproj | 1 + CrowIDE/src/CrowIDE.cs | 16 +- Tests/ui/dbgLog.crow | 10 + src/GraphicObjects/GraphicObject.cs | 8 +- src/GraphicObjects/ScrollingObject.cs | 2 +- src/debug/DbgLogViewer.cs | 579 ++++++++---- src/debug/DebugLogViewer.cs | 1177 +++++++++++++++++++++++++ src/debug/DebugLogger.cs | 105 +-- 8 files changed, 1642 insertions(+), 256 deletions(-) create mode 100644 src/debug/DebugLogViewer.cs diff --git a/Crow.csproj b/Crow.csproj index fdb6d7c1..6ad0c309 100644 --- a/Crow.csproj +++ b/Crow.csproj @@ -412,5 +412,6 @@ + diff --git a/CrowIDE/src/CrowIDE.cs b/CrowIDE/src/CrowIDE.cs index 0ee5844d..89bcdcab 100644 --- a/CrowIDE/src/CrowIDE.cs +++ b/CrowIDE/src/CrowIDE.cs @@ -101,12 +101,14 @@ namespace Crow.Coding CurrentSolution = null; } + static CrowIDE app; [STAThread] static void Main () { - using (CrowIDE app = new CrowIDE ()) { + using (app = new CrowIDE ()) { MainIFace = app; + app.Keyboard.KeyDown += App_KeyboardKeyDown; app.initIde (); while (true) { @@ -116,6 +118,18 @@ namespace Crow.Coding } } + static void App_KeyboardKeyDown (object sender, KeyEventArgs e) + { + Console.WriteLine((byte)e.Key); + //#if DEBUG_LOG + switch (e.Key) { + case Key.F2: + DebugLog.save (app); + break; + } + //#endif + } + public CrowIDE () : base(1024, 800) { diff --git a/Tests/ui/dbgLog.crow b/Tests/ui/dbgLog.crow index d0735082..86ed0edc 100755 --- a/Tests/ui/dbgLog.crow +++ b/Tests/ui/dbgLog.crow @@ -5,6 +5,16 @@