From 2ab44f600bd0ecab04d03ba08fdc17ea195babf2 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Bruyère Date: Thu, 14 Jan 2021 08:07:43 +0100 Subject: label, cached line width in pixel in LineSpan struct, use stackalloc for a single utf8 conversion for size and print, perfs and samplebase --- Samples/common/SampleBase.cs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'Samples/common/SampleBase.cs') diff --git a/Samples/common/SampleBase.cs b/Samples/common/SampleBase.cs index 65345be7..bdc6608b 100644 --- a/Samples/common/SampleBase.cs +++ b/Samples/common/SampleBase.cs @@ -8,6 +8,7 @@ using System.Reflection; using System.Runtime.CompilerServices; using System.Threading; using Crow; +using Glfw; namespace Crow { @@ -261,5 +262,25 @@ namespace Crow base.OnInitialized (); } + public override bool OnKeyDown (Key key) { + + switch (key) { + case Key.F5: + Load ("Interfaces/Divers/testFileDialog.crow").DataSource = this; + return true; + case Key.F6: + Load ("Interfaces/Divers/0.crow").DataSource = this; + return true; + case Key.F7: + Load ("Interfaces/Divers/perfMeasures.crow").DataSource = this; + return true; + case Key.F2: + if (IsKeyDown (Key.LeftShift)) + DbgLogger.Reset (); + DbgLogger.Save (this); + return true; + } + return base.OnKeyDown (key); + } } } \ No newline at end of file -- cgit v1.3.1-4-g156e