diff --git a/UICatalog/Scenarios/FileDialog2Examples.cs b/UICatalog/Scenarios/FileDialog2Examples.cs index 0ca7f1d08..77e147200 100644 --- a/UICatalog/Scenarios/FileDialog2Examples.cs +++ b/UICatalog/Scenarios/FileDialog2Examples.cs @@ -3,6 +3,8 @@ using System.Collections; using System.IO; using System.Linq; using Terminal.Gui; +using Terminal.Gui.Graphs; +using static Terminal.Gui.OpenDialog; namespace UICatalog.Scenarios { [ScenarioMetadata (Name: "FileDialog2", Description: "Demonstrates how to the FileDialog2 class")] @@ -12,15 +14,18 @@ namespace UICatalog.Scenarios { private CheckBox cbIcons; private CheckBox cbMonochrome; private CheckBox cbCaseSensitive; + private CheckBox cbAllowMultipleSelection; private RadioGroup rgCaption; + private RadioGroup rgOpenMode; + private RadioGroup rgAllowedTypes; public override void Setup () { var y = 0; var x = 1; - cbMustExist = new CheckBox ("Must Exist") { Checked = true, X=x}; + cbMustExist = new CheckBox ("Must Exist") { Checked = true, Y = y++, X=x}; Win.Add (cbMustExist); @@ -33,61 +38,71 @@ namespace UICatalog.Scenarios { cbCaseSensitive = new CheckBox ("Case Sensitive Search") { Checked = false, Y = y++, X=x }; Win.Add (cbCaseSensitive); + cbAllowMultipleSelection = new CheckBox ("Multiple") { Checked = false, Y = y++, X=x }; + Win.Add (cbAllowMultipleSelection); + y = 0; x = 24; - Win.Add(new Label("Open Caption"){X=x++,Y=y++}); + Win.Add(new LineView(Orientation.Vertical){ + X = x++, + Y = 1, + Height = 4 + }); + Win.Add(new Label("Caption"){X=x++,Y=y++}); rgCaption = new RadioGroup{X = x, Y=y}; rgCaption.RadioLabels = new NStack.ustring[]{"Ok","Open","Save"}; Win.Add(rgCaption); + y = 0; + x = 37; + + Win.Add(new LineView(Orientation.Vertical){ + X = x++, + Y = 1, + Height = 4 + }); + Win.Add(new Label("OpenMode"){X=x++,Y=y++}); + + rgOpenMode = new RadioGroup{X = x, Y=y}; + rgOpenMode.RadioLabels = new NStack.ustring[]{"File","Directory","Mixed"}; + Win.Add(rgOpenMode); - x = 1; - y = 5; - - foreach (var multi in new bool [] { false, true }) { - foreach (OpenDialog.OpenMode openMode in Enum.GetValues (typeof (OpenDialog.OpenMode))) { - var btn = new Button ($"Select {(multi ? "Many" : "One")} {openMode}") { - X = x, - Y = y - }; - SetupHandler (btn, openMode, multi); - y += 2; - Win.Add (btn); - } - } y = 5; + x = 24; - // SubViews[0] is ContentView - x = Win.Subviews [0].Subviews.OfType