From 2fa1218fa21369a2781880d751129b2f017a4e68 Mon Sep 17 00:00:00 2001 From: Jesper Date: Mon, 25 May 2020 22:49:21 +0200 Subject: [PATCH 1/3] Fixed typo "doetnet" to "dotnet" --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index aca3821be..c0424f750 100644 --- a/README.md +++ b/README.md @@ -174,7 +174,7 @@ Use NuGet to install the `Terminal.Gui` NuGet package: https://www.nuget.org/pac ## Running and Building -* *`Terminal.Gui`* - Build and run using the .NET SDK command line tools (`doetnet build` in the root directory) or with Visual Studio 2019. +* *`Terminal.Gui`* - Build and run using the .NET SDK command line tools (`dotnet build` in the root directory) or with Visual Studio 2019. ## Contributing From c4588b3a974468f19b5f9bb0b7ae6e8589714773 Mon Sep 17 00:00:00 2001 From: BDisp Date: Mon, 25 May 2020 22:51:34 +0100 Subject: [PATCH 2/3] Added keyDownHandler to Unix --- Terminal.Gui/Drivers/CursesDriver.cs | 6 ++++-- Terminal.Gui/MonoCurses/mainloop.cs | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Terminal.Gui/Drivers/CursesDriver.cs b/Terminal.Gui/Drivers/CursesDriver.cs index 1d2fed102..830599e51 100644 --- a/Terminal.Gui/Drivers/CursesDriver.cs +++ b/Terminal.Gui/Drivers/CursesDriver.cs @@ -369,7 +369,7 @@ namespace Terminal.Gui { }; } - void ProcessInput (Action keyHandler, Action keyUpHandler, Action mouseHandler) + void ProcessInput (Action keyHandler, Action keyDownHandler, Action keyUpHandler, Action mouseHandler) { int wch; var code = Curses.get_wch (out wch); @@ -422,8 +422,10 @@ namespace Terminal.Gui { keyHandler (new KeyEvent (Key.Esc)); } } else if (wch == Curses.KeyTab) { + keyDownHandler (new KeyEvent (MapCursesKey (wch))); keyHandler (new KeyEvent (MapCursesKey (wch))); } else { + keyDownHandler (new KeyEvent ((Key)wch)); keyHandler (new KeyEvent ((Key)wch)); } // Cause OnKeyUp and OnKeyPressed. Note that the special handling for ESC above @@ -446,7 +448,7 @@ namespace Terminal.Gui { this.mainLoop = mainLoop; (mainLoop.Driver as Mono.Terminal.UnixMainLoop).AddWatch (0, Mono.Terminal.UnixMainLoop.Condition.PollIn, x => { - ProcessInput (keyHandler, keyUpHandler, mouseHandler); + ProcessInput (keyHandler, keyDownHandler, keyUpHandler, mouseHandler); return true; }); diff --git a/Terminal.Gui/MonoCurses/mainloop.cs b/Terminal.Gui/MonoCurses/mainloop.cs index 2edc819f7..4bc95fba5 100644 --- a/Terminal.Gui/MonoCurses/mainloop.cs +++ b/Terminal.Gui/MonoCurses/mainloop.cs @@ -208,7 +208,7 @@ namespace Mono.Terminal { while (true) { n = poll (pollmap, (uint)pollmap.Length, 0); - if (pollmap != null) { + if (n > 0) { break; } if (mainLoop.idleHandlers.Count > 0 || CkeckTimeout (wait, ref pollTimeout)) { @@ -472,7 +472,7 @@ namespace Mono.Terminal { running = false; driver.Wakeup (); } - + /// /// Determines whether there are pending events to be processed. /// From 1e813a213a00cdd788cebe322c19764c07894e8d Mon Sep 17 00:00:00 2001 From: Charlie Kindel Date: Tue, 26 May 2020 08:09:43 -0600 Subject: [PATCH 3/3] rule --- UICatalog/Scenarios/ComputedLayout.cs | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/UICatalog/Scenarios/ComputedLayout.cs b/UICatalog/Scenarios/ComputedLayout.cs index d5aecf6e3..3c53b7bf0 100644 --- a/UICatalog/Scenarios/ComputedLayout.cs +++ b/UICatalog/Scenarios/ComputedLayout.cs @@ -36,19 +36,21 @@ namespace UICatalog { // Demonstrate using Dim to create a vertical ruler that always measures the parent window's height // TODO: Either build a custom control for this or implement linewrap in Label #352 - //var verticalRuler = new Label ("") { - // X = 0, - // Y = 0, - // Width = 1, - // Height = Dim.Fill (), - // ColorScheme = Colors.Error - //}; + const string vrule = "|\n1\n2\n3\n4\n5\n6\n7\n8\n9\n"; - //Application.OnResized += () => { - // verticalRuler.Text = rule.Repeat ((int)Math.Ceiling ((double)(verticalRuler.Bounds.Height) / (double)rule.Length)) [0..(verticalRuler.Bounds.Height)]; - //}; + var verticalRuler = new Label ("") { + X = 0, + Y = 0, + Width = 1, + Height = Dim.Fill (), + ColorScheme = Colors.Error + }; - //Win.Add (verticalRuler); + Application.Resized += (sender, a) => { + verticalRuler.Text = vrule.Repeat ((int)Math.Ceiling ((double)(verticalRuler.Bounds.Height*2) / (double)rule.Length)) [0..(verticalRuler.Bounds.Height*2)]; + }; + + Win.Add (verticalRuler); // Demonstrate At - Absolute Layout using Pos var absoluteButton = new Button ("Absolute At(2,1)") {