diff --git a/Example/demo.cs b/Example/demo.cs index 71efe5457..d4d318aba 100644 --- a/Example/demo.cs +++ b/Example/demo.cs @@ -421,26 +421,27 @@ static class Demo { MessageBox.Query (60, 10, "Selected Animals", result == "" ? "No animals selected" : result, "Ok"); } - //static void ComboBoxDemo () - //{ - // IList items = new List (); - // foreach (var dir in new [] { "/etc", @"\windows\System32" }) { - // if (Directory.Exists (dir)) { - // items = Directory.GetFiles (dir) - // .Select (Path.GetFileName) - // .Where (x => char.IsLetterOrDigit (x [0])) - // .Distinct () - // .OrderBy (x => x).ToList (); - // } - // } - // var list = new ComboBox (0, 0, 36, 7, items); - // list.Changed += (object sender, ustring text) => { Application.RequestStop (); }; + static void ComboBoxDemo () + { + IList items = new List (); + foreach (var dir in new [] { "/etc", @"\windows\System32" }) { + if (Directory.Exists (dir)) { + items = Directory.GetFiles (dir) + .Select (Path.GetFileName) + .Where (x => char.IsLetterOrDigit (x [0])) + .Distinct () + .OrderBy (x => x).ToList (); + } + } + var list = new ComboBox () { X = 0, Y = 0, Width = 36, Height = 7 }; + list.SetSource(items); + list.Changed += (object sender, ustring text) => { Application.RequestStop (); }; - // var d = new Dialog ("Select source file", 40, 12) { list }; - // Application.Run (d); + var d = new Dialog ("Select source file", 40, 12) { list }; + Application.Run (d); - // MessageBox.Query (60, 10, "Selected file", list.Text.ToString() == "" ? "Nothing selected" : list.Text.ToString(), "Ok"); - //} + MessageBox.Query (60, 10, "Selected file", list.Text.ToString() == "" ? "Nothing selected" : list.Text.ToString(), "Ok"); + } #endregion @@ -571,7 +572,7 @@ static class Demo { new MenuBarItem ("_List Demos", new MenuItem [] { new MenuItem ("Select _Multiple Items", "", () => ListSelectionDemo (true)), new MenuItem ("Select _Single Item", "", () => ListSelectionDemo (false)), -// new MenuItem ("Search Single Item", "", ComboBoxDemo) + new MenuItem ("Search Single Item", "", ComboBoxDemo) }), new MenuBarItem ("A_ssorted", new MenuItem [] { new MenuItem ("_Show text alignments", "", () => ShowTextAlignments ()), diff --git a/Terminal.Gui/Core/PosDim.cs b/Terminal.Gui/Core/PosDim.cs index 51ea52072..72f8024e4 100644 --- a/Terminal.Gui/Core/PosDim.cs +++ b/Terminal.Gui/Core/PosDim.cs @@ -361,7 +361,7 @@ namespace Terminal.Gui { return 0; } - class DimFactor : Dim { + internal class DimFactor : Dim { float factor; public DimFactor (float n) diff --git a/Terminal.Gui/Terminal.Gui.csproj b/Terminal.Gui/Terminal.Gui.csproj index c0540e484..e3718dc92 100644 --- a/Terminal.Gui/Terminal.Gui.csproj +++ b/Terminal.Gui/Terminal.Gui.csproj @@ -183,12 +183,6 @@ - - - - - -