From 1febaa96f7cbaff83f0d606638560450d78420b9 Mon Sep 17 00:00:00 2001 From: Charlie Kindel Date: Sat, 11 Jun 2022 02:58:48 -0700 Subject: [PATCH 1/3] fixed test that broke by adjusting dialog button alignment --- Terminal.Gui/Windows/Dialog.cs | 5 ++++- UnitTests/ConsoleDriverTests.cs | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Terminal.Gui/Windows/Dialog.cs b/Terminal.Gui/Windows/Dialog.cs index 80d0aa221..5696adbff 100644 --- a/Terminal.Gui/Windows/Dialog.cs +++ b/Terminal.Gui/Windows/Dialog.cs @@ -141,11 +141,14 @@ namespace Terminal.Gui { /// Right } + + private ButtonAlignments buttonAlignment = Dialog.ButtonAlignments.Center; + /// /// Determines how the s are aligned along the /// bottom of the dialog. /// - public ButtonAlignments ButtonAlignment = Dialog.ButtonAlignments.Center; + public ButtonAlignments ButtonAlignment { get => buttonAlignment; set => buttonAlignment = value; } void LayoutStartedHandler () { diff --git a/UnitTests/ConsoleDriverTests.cs b/UnitTests/ConsoleDriverTests.cs index 5f85b2d10..29534b7fa 100644 --- a/UnitTests/ConsoleDriverTests.cs +++ b/UnitTests/ConsoleDriverTests.cs @@ -576,7 +576,7 @@ namespace Terminal.Gui.ConsoleDrivers { ││ Hello World │ │ ││ │ │ ││ │ │ -││ [ Ok ] │ │ +││ [ Ok ] │ │ │└───────────────┘ │ └──────────────────┘ "; From 2931e01cee62e63d5c34c655378d96c0b5407086 Mon Sep 17 00:00:00 2001 From: Charlie Kindel Date: Sat, 11 Jun 2022 02:59:22 -0700 Subject: [PATCH 2/3] fixed test that broke by adjusting dialog button alignment --- UnitTests/ConsoleDriverTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UnitTests/ConsoleDriverTests.cs b/UnitTests/ConsoleDriverTests.cs index 29534b7fa..cb4bc1dcf 100644 --- a/UnitTests/ConsoleDriverTests.cs +++ b/UnitTests/ConsoleDriverTests.cs @@ -593,7 +593,7 @@ namespace Terminal.Gui.ConsoleDrivers { ││ Hello World │ │ ││ │ │ ││ │ │ -││ [ Ok ] │ │ +││ [ Ok ] │ │ │└───────────────┘ │ └──────────────────┘ "; From fa94eebbe51eeca270d26475cf0f1d24c9c2784d Mon Sep 17 00:00:00 2001 From: Charlie Kindel Date: Sat, 11 Jun 2022 03:04:19 -0700 Subject: [PATCH 3/3] Fixed Dialogs scenario crash re: Parse v TryParse --- UICatalog/Scenarios/Dialogs.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/UICatalog/Scenarios/Dialogs.cs b/UICatalog/Scenarios/Dialogs.cs index e0055a4d5..6d43fd7ec 100644 --- a/UICatalog/Scenarios/Dialogs.cs +++ b/UICatalog/Scenarios/Dialogs.cs @@ -148,9 +148,12 @@ namespace UICatalog.Scenarios { }; showDialogButton.Clicked += () => { try { - int width = int.Parse (widthEdit.Text.ToString ()); - int height = int.Parse (heightEdit.Text.ToString ()); - int numButtons = int.Parse (numButtonsEdit.Text.ToString ()); + int width = 0; + int.TryParse (widthEdit.Text.ToString (), out width); + int height = 0; + int.TryParse (heightEdit.Text.ToString (), out height); + int numButtons = 3; + int.TryParse (numButtonsEdit.Text.ToString (), out numButtons); var buttons = new List