From 63e67ddac294f7eb8ef927b93ca33fbfca38ecb1 Mon Sep 17 00:00:00 2001 From: Michael Becker Date: Thu, 12 Dec 2019 00:12:59 -0500 Subject: [PATCH] implement CustomOptionChoice now tht UWT has a ComboBox control --- .../Dialogs/CustomOptionsDialog.cs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/CSharp/Libraries/UniversalEditor.UserInterface/Dialogs/CustomOptionsDialog.cs b/CSharp/Libraries/UniversalEditor.UserInterface/Dialogs/CustomOptionsDialog.cs index cb9014ab..8eb59840 100644 --- a/CSharp/Libraries/UniversalEditor.UserInterface/Dialogs/CustomOptionsDialog.cs +++ b/CSharp/Libraries/UniversalEditor.UserInterface/Dialogs/CustomOptionsDialog.cs @@ -87,17 +87,19 @@ namespace UniversalEditor.UserInterface.Dialogs { CustomOptionChoice option = (eo as CustomOptionChoice); - // ComboBox cbo = new ComboBox(); - // if (option.RequireChoice) cbo.DropDownStyle = ComboBoxStyle.DropDownList; + ComboBox cbo = new ComboBox(); + cbo.ReadOnly = option.RequireChoice; + DefaultTreeModel tm = new DefaultTreeModel(new Type[] { typeof(string) }); foreach (CustomOptionFieldChoice choice in option.Choices) { - // cbo.Items.Add(choice); + tm.Rows.Add(new TreeModelRow(new TreeModelRowColumn[] { new TreeModelRowColumn(tm.Columns[0], choice) })); } + cbo.Model = tm; // cbo.Dock = DockStyle.Fill; - // tbl.Controls.Add(cbo); + this.Controls.Add(cbo, new GridLayout.Constraints(iRow, 1, 1, 1, ExpandMode.Horizontal)); - // CustomOptionControls.Add(eo.PropertyName, cbo); + CustomOptionControls.Add(eo.PropertyName, cbo); } else if (eo is CustomOptionNumber) {