diff --git a/Import/GacUI.cpp b/Import/GacUI.cpp index 40827184..9c93fc47 100644 --- a/Import/GacUI.cpp +++ b/Import/GacUI.cpp @@ -6373,18 +6373,25 @@ GuiTabPageList tab->containerComposition->RemoveChild(value->boundsComposition); value->tab = nullptr; - if (items.Count() <= 1) + if (items.Count() > 1) + { + if (items.Count() > index + 1) + { + tab->SetSelectedPage(items[index + 1]); + } + else if (items.Count() == index + 1) + { + tab->SetSelectedPage(items[index - 1]); + } + } + } + + void GuiTabPageList::AfterRemove(vint index, vint count) + { + if (items.Count() == 0) { tab->SetSelectedPage(nullptr); } - else if (items.Count() > index + 1) - { - tab->SetSelectedPage(items[index + 1]); - } - else if (items.Count() == index + 1) - { - tab->SetSelectedPage(items[index - 1]); - } } GuiTabPageList::GuiTabPageList(GuiTab* _tab) diff --git a/Import/GacUI.h b/Import/GacUI.h index 9f72da40..b0a9a715 100644 --- a/Import/GacUI.h +++ b/Import/GacUI.h @@ -13598,6 +13598,7 @@ Tab Control bool QueryInsert(vint index, GuiTabPage* const& value)override; void AfterInsert(vint index, GuiTabPage* const& value)override; void BeforeRemove(vint index, GuiTabPage* const& value)override; + void AfterRemove(vint index, vint count)override; public: GuiTabPageList(GuiTab* _tab); ~GuiTabPageList();