From 149205e8ebe5c4ab1ca52ca700ff754aabdf14aa Mon Sep 17 00:00:00 2001 From: Jean-Philippe Bruyère Date: Wed, 16 Jul 2025 20:08:03 +0200 Subject: DebugLogViewer, DockTests --- Samples/common/samples.style | 8 ++-- Samples/common/src/SampleBaseForEditor.cs | 17 +++---- Samples/common/ui/Interfaces/Divers/all.crow | 2 +- .../Experimental/tabviewTestVertical2.crow | 2 +- Samples/common/ui/debugLog/DebugLog.crow | 5 +++ Samples/common/ui/debugLog/dbg.style | 52 ++++++++++++++++++++++ Samples/common/ui/templates/dockwinsimple.itmp | 7 ++- 7 files changed, 74 insertions(+), 19 deletions(-) create mode 100644 Samples/common/ui/debugLog/DebugLog.crow create mode 100644 Samples/common/ui/debugLog/dbg.style (limited to 'Samples/common') diff --git a/Samples/common/samples.style b/Samples/common/samples.style index 4fbe0293..a82b9a85 100644 --- a/Samples/common/samples.style +++ b/Samples/common/samples.style @@ -3,8 +3,8 @@ InactiveTabBackground = "DarkGrey"; SelectedTabBackground = "Onyx"; InactiveTabForeground = "Grey"; SelectedTabForeground = "White"; -SmallUIFont = "sans, 12"; -SmallFont = "consolas, 12"; +SmallUIFont = "sans, 20"; +SmallFont = "mono, 20"; FpsLabel { Width = "30"; @@ -69,7 +69,7 @@ DockStack { //EndDrag="{Background=Jet}"; } SimpleDockWin { - Template= "#ui.dockwinsimple.itmp"; + //Template= "#ui.dockwinsimple.itmp"; Background = "Yellow"; Width="200"; Height="200"; @@ -91,7 +91,7 @@ valignStyle2 { //Initialized="{Background=Blue}"; } smallLabel { - Font="consolas, 8"; + Font="mono, 8"; } suggestionsListBox { Template = "#ui.Suggestions.template"; diff --git a/Samples/common/src/SampleBaseForEditor.cs b/Samples/common/src/SampleBaseForEditor.cs index b97982e6..3133286f 100644 --- a/Samples/common/src/SampleBaseForEditor.cs +++ b/Samples/common/src/SampleBaseForEditor.cs @@ -5,15 +5,11 @@ using System; using Crow; using System.IO; -using System.Text; -using Crow.IML; -using System.Runtime.CompilerServices; using Glfw; -using System.Diagnostics; using Crow.Text; using System.Collections.Generic; using Encoding = System.Text.Encoding; -using System.Linq; +using Crow.DebugLogger; namespace Samples { @@ -69,9 +65,10 @@ namespace Samples } } - #region DebugLog + #region DebugLog bool debugLogRecording; public bool DebugLoggingEnabled => DbgLogger.IsEnabled; + public IEnumerable DebugEvents => DbgLogger.Events; static ObservableList RecordedEvents; public bool DebugLogRecording { @@ -80,11 +77,6 @@ namespace Samples if (debugLogRecording == value) return; debugLogRecording = value; - if (debugLogRecording) { - DbgLogger.IncludedEvents = new List(RecordedEvents); - } else { - DbgLogger.IncludedEvents = null; - } NotifyValueChanged(debugLogRecording); } } @@ -107,6 +99,9 @@ namespace Samples NotifyValueChanged (DebugLogFilePath); } } + + + #endregion diff --git a/Samples/common/ui/Interfaces/Divers/all.crow b/Samples/common/ui/Interfaces/Divers/all.crow index e59d30d5..2d1601aa 100644 --- a/Samples/common/ui/Interfaces/Divers/all.crow +++ b/Samples/common/ui/Interfaces/Divers/all.crow @@ -7,7 +7,7 @@