aboutsummaryrefslogtreecommitdiffstatsci
path: root/Samples/ShowCase
diff options
context:
space:
mode:
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>2021-02-01 14:57:37 +0100
committerj-p <jp_bruyere@hotmail.com>2021-02-06 20:28:02 +0100
commit7ec412bbf32017f1a9a1be8eea7024f770baefff (patch)
tree9c6540073daefa56ac29c51cb7bf89cdd2ab4e19 /Samples/ShowCase
parentdf1f39540ca2d6dd27d86129fa38812facac370b (diff)
DbgLogger output to console by default
Diffstat (limited to 'Samples/ShowCase')
-rw-r--r--Samples/ShowCase/ShowCase.cs21
-rw-r--r--Samples/ShowCase/ui/showcase.crow8
2 files changed, 22 insertions, 7 deletions
diff --git a/Samples/ShowCase/ShowCase.cs b/Samples/ShowCase/ShowCase.cs
index d3b40d6f..b504648e 100644
--- a/Samples/ShowCase/ShowCase.cs
+++ b/Samples/ShowCase/ShowCase.cs
@@ -9,6 +9,7 @@ using System.Text;
using Crow.IML;
using System.Runtime.CompilerServices;
using Glfw;
+using System.Diagnostics;
namespace ShowCase
{
@@ -16,7 +17,11 @@ namespace ShowCase
{
static void Main ()
{
+ DbgLogger.IncludeEvents = DbgEvtType.Widget;
+ DbgLogger.DiscardEvents = DbgEvtType.Focus;
+
Environment.SetEnvironmentVariable ("FONTCONFIG_PATH", @"C:\Users\Jean-Philippe\source\vcpkg\installed\x64-windows\tools\fontconfig\fonts");
+
using (Showcase app = new Showcase ())
app.Run ();
}
@@ -43,6 +48,7 @@ namespace ShowCase
NotifyValueChanged (CurrentFile);
}
}
+
public string Source {
get => source;
set {
@@ -50,7 +56,9 @@ namespace ShowCase
return;
source = value;
- reloadFromSource ();
+ if (!reloadChrono.IsRunning)
+ reloadChrono.Restart ();
+
CMDSave.CanExecute = source != origSource;
NotifyValueChanged (source);
}
@@ -243,7 +251,14 @@ namespace ShowCase
showError (ex);
}
}
+ Stopwatch reloadChrono = Stopwatch.StartNew ();
+ public override void UpdateFrame () {
+ base.UpdateFrame ();
+ if (reloadChrono.ElapsedMilliseconds < 200)
+ return;
+ reloadFromSource ();
+ reloadChrono.Reset ();
+ }
-
- }
+ }
} \ No newline at end of file
diff --git a/Samples/ShowCase/ui/showcase.crow b/Samples/ShowCase/ui/showcase.crow
index 95aa0999..2447ab67 100644
--- a/Samples/ShowCase/ui/showcase.crow
+++ b/Samples/ShowCase/ui/showcase.crow
@@ -21,13 +21,13 @@
<HorizontalStack>
<Scroller Name="scroller1" Background="White"
Margin="2" ScrollY="{../scrollbar1.Value}">
- <TextBox VerticalAlignment="Top"
+ <TextBox VerticalAlignment="Top"
Text="{²Source}" Multiline="true"
- Font="mono 10"/>
+ Font="consolas, 12"/>
</Scroller>
- <ScrollBar Name="scrollbar1" Value="{../scroller1.ScrollY}"
+ <!--<ScrollBar Name="scrollbar1" Value="{../scroller1.ScrollY}"
LargeIncrement="{../scroller1.PageHeight}" SmallIncrement="30"
- CursorSize="{../scroller1.ChildHeightRatio}" Maximum="{../scroller1.MaxScrollY}" />
+ CursorSize="{../scroller1.ChildHeightRatio}" Maximum="{../scroller1.MaxScrollY}" />-->
</HorizontalStack>
<Label Text="{CurrentFile}" Width="Stretched"/>
<Label Visible="{ShowError}" Text="{ErrorMessage}" Background="Red" Foreground="White" Width="Stretched" Margin="2"