From 29c0297c5fc6dd2650eab14290cbbbf9a99559ce Mon Sep 17 00:00:00 2001 From: Michael Becker Date: Tue, 15 Mar 2022 00:12:02 -0400 Subject: [PATCH] update to latest UWT API changes for treeviews --- .../UniversalEditor.UserInterface/Dialogs/NewDialog.cs | 10 +++++----- .../Editors/FileSystem/FileSystemEditor.cs | 2 +- .../Editors/Icarus/IcarusScriptEditor.cs | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Libraries/UniversalEditor.UserInterface/Dialogs/NewDialog.cs b/Libraries/UniversalEditor.UserInterface/Dialogs/NewDialog.cs index 818b26e7..72f60a2b 100644 --- a/Libraries/UniversalEditor.UserInterface/Dialogs/NewDialog.cs +++ b/Libraries/UniversalEditor.UserInterface/Dialogs/NewDialog.cs @@ -335,12 +335,12 @@ namespace UniversalEditor.UserInterface.Dialogs /// /// A which has zero child rows, or null if no such exists. /// Row. - private TreeModelRow ExpandSingleChildRows(TreeModelRow row) + private TreeModelRow ExpandSingleChildRows(ListViewControl tv, TreeModelRow row) { if (row.Rows.Count == 1) { - row.Expanded = true; - return ExpandSingleChildRows(row.Rows[0]); + tv.SetExpanded(row, true); + return ExpandSingleChildRows(tv, row.Rows[0]); } else if (row.Rows.Count == 0) { @@ -376,7 +376,7 @@ namespace UniversalEditor.UserInterface.Dialogs if (tmObjectModel.Rows.Count == 1) { - TreeModelRow row = ExpandSingleChildRows(tmObjectModel.Rows[0]); + TreeModelRow row = ExpandSingleChildRows(tvObjectModel, tmObjectModel.Rows[0]); if (row != null) { tvObjectModel.SelectedRows.Clear(); @@ -493,7 +493,7 @@ namespace UniversalEditor.UserInterface.Dialogs RefreshProjectTemplates(tvObjectModel.SelectedRows[0]); } - if (tmTemplate.Rows.Count == 1) + if (tmTemplate.Rows.Count > 0) { tvTemplate.SelectedRows.Add(tmTemplate.Rows[0]); } diff --git a/Libraries/UniversalEditor.UserInterface/Editors/FileSystem/FileSystemEditor.cs b/Libraries/UniversalEditor.UserInterface/Editors/FileSystem/FileSystemEditor.cs index 5d922a10..ab2b0359 100644 --- a/Libraries/UniversalEditor.UserInterface/Editors/FileSystem/FileSystemEditor.cs +++ b/Libraries/UniversalEditor.UserInterface/Editors/FileSystem/FileSystemEditor.cs @@ -119,7 +119,7 @@ namespace UniversalEditor.Editors.FileSystem { // nautilus does the equivalent of 'CurrentFolder = ...' except opens in multiple tabs // which... we don't really have the ability to do multiple tabs for the same document at the moment - tv.SelectedRows[i].Expanded = true; + tv.SetExpanded(tv.SelectedRows[i], true); } else { diff --git a/Plugins.UserInterface/UniversalEditor.Plugins.RavenSoftware.UserInterface/Editors/Icarus/IcarusScriptEditor.cs b/Plugins.UserInterface/UniversalEditor.Plugins.RavenSoftware.UserInterface/Editors/Icarus/IcarusScriptEditor.cs index 51e02870..23634408 100644 --- a/Plugins.UserInterface/UniversalEditor.Plugins.RavenSoftware.UserInterface/Editors/Icarus/IcarusScriptEditor.cs +++ b/Plugins.UserInterface/UniversalEditor.Plugins.RavenSoftware.UserInterface/Editors/Icarus/IcarusScriptEditor.cs @@ -83,7 +83,7 @@ namespace UniversalEditor.Plugins.RavenSoftware.UserInterface.Editors.Icarus if (selectedCommand != null && selectedCommand.IsContainer) { RecursiveAddCommand(omcmd, tv.SelectedRows[0]); - tv.SelectedRows[0].Expanded = true; + tv.SetExpanded(tv.SelectedRows[0], true); selectedCommand.Commands.Add(omcmd); tv.SelectedRows[0].RowColumns[0].Value = GetCommandText(selectedCommand);