From feb5cbcee57700be903e3a987396d4e669acd549 Mon Sep 17 00:00:00 2001 From: Michael Becker Date: Mon, 9 Sep 2019 11:57:29 -0400 Subject: [PATCH] *sigh* manually keep track of document count until we figure out how libgdl works --- .../Libraries/UniversalEditor.UserInterface/MainWindow.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CSharp/Libraries/UniversalEditor.UserInterface/MainWindow.cs b/CSharp/Libraries/UniversalEditor.UserInterface/MainWindow.cs index 2f082be8..88877c43 100644 --- a/CSharp/Libraries/UniversalEditor.UserInterface/MainWindow.cs +++ b/CSharp/Libraries/UniversalEditor.UserInterface/MainWindow.cs @@ -434,10 +434,13 @@ namespace UniversalEditor.UserInterface InitDocTab("Start Page", lblStartPage); } + private int documentWindowCount = 0; private void InitDocTab(string title, Control content) { DockingItem item = new DockingItem(title, content); dckContainer.Items.Add(item); + + documentWindowCount++; } private void MainWindow_MenuBar_Item_Click(object sender, EventArgs e) @@ -642,8 +645,9 @@ namespace UniversalEditor.UserInterface if (dckContainer.CurrentItem != null) { dckContainer.Items.Remove(dckContainer.CurrentItem); + documentWindowCount--; } - if (this.Windows.Count == 0) + if (documentWindowCount == 0) { CloseWindow (); }