diff --git a/Import/GacUI.cpp b/Import/GacUI.cpp index 41bf5696..9a211fac 100644 --- a/Import/GacUI.cpp +++ b/Import/GacUI.cpp @@ -4327,7 +4327,7 @@ GuiWindow { WindowClosed.Detach(container->handler); container->handler = nullptr; - GetNativeWindow()->SetParent(0); + GetNativeWindow()->SetParent(nullptr); callback(); owner->SetEnabled(true); owner->SetActivated(); @@ -4507,11 +4507,23 @@ GuiPopup { auto window = GetNativeWindow(); UpdateClientSizeAfterRendering(window->GetBounds().GetSize()); + + INativeWindow* controlWindow = nullptr; switch (popupType) { - case 2: window->SetParent(popupInfo._2.controlWindow); break; - case 3: window->SetParent(popupInfo._3.controlWindow); break; - case 4: window->SetParent(popupInfo._4.controlWindow); break; + case 2: controlWindow = popupInfo._2.controlWindow; break; + case 3: controlWindow = popupInfo._3.controlWindow; break; + case 4: controlWindow = popupInfo._4.controlWindow; break; + } + + if (controlWindow) + { + window->SetParent(controlWindow); + window->SetTopMost(controlWindow->GetTopMost()); + } + else + { + window->SetTopMost(false); } ShowDeactivated(); } @@ -9848,10 +9860,13 @@ ItemProviderBase void ItemProviderBase::InvokeOnItemModified(vint start, vint count, vint newCount) { + CHECK_ERROR(!callingOnItemModified, L"ItemProviderBase::InvokeOnItemModified(vint, vint, vint)#Canning modify the observable data source during its item modified event, which will cause this event to be executed recursively."); + callingOnItemModified = true; for (vint i = 0; i < callbacks.Count(); i++) { callbacks[i]->OnItemModified(start, count, newCount); } + callingOnItemModified = false; } ItemProviderBase::ItemProviderBase() diff --git a/Import/GacUI.h b/Import/GacUI.h index 31978360..e2f88594 100644 --- a/Import/GacUI.h +++ b/Import/GacUI.h @@ -12476,6 +12476,7 @@ Predefined ItemProvider protected: collections::List callbacks; vint editingCounter = 0; + bool callingOnItemModified = false; virtual void InvokeOnItemModified(vint start, vint count, vint newCount); public: diff --git a/Import/GacUIWindows.cpp b/Import/GacUIWindows.cpp index cf819d4c..092d48d1 100644 --- a/Import/GacUIWindows.cpp +++ b/Import/GacUIWindows.cpp @@ -9259,7 +9259,6 @@ WindowsController Dictionary windows; INativeWindow* mainWindow; HWND mainWindowHandle; - vint handleMessageLevelCounter = 0; WindowsCallbackService callbackService; WindowsResourceService resourceService; @@ -9304,7 +9303,6 @@ WindowsController bool HandleMessage(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT& result) { bool skipDefaultProcedure=false; - handleMessageLevelCounter++; { vint index = windows.Keys().IndexOf(hwnd); if (index != -1) @@ -9346,11 +9344,6 @@ WindowsController PostQuitMessage(0); } } - handleMessageLevelCounter--; - if (handleMessageLevelCounter == 0) - { - asyncService.ExecuteAsyncTasks(); - } return skipDefaultProcedure; } diff --git a/Import/Vlpp.h b/Import/Vlpp.h index b5cd0d66..93df90fb 100644 --- a/Import/Vlpp.h +++ b/Import/Vlpp.h @@ -5558,8 +5558,6 @@ CompareEnumerable { return 1; } - ator->Next(); - btor->Next(); } return 0; } diff --git a/Tools/CppMerge.exe b/Tools/CppMerge.exe index ab4792b4..1105467e 100644 Binary files a/Tools/CppMerge.exe and b/Tools/CppMerge.exe differ diff --git a/Tools/GacGen32.exe b/Tools/GacGen32.exe index d0a5999e..b8158afc 100644 Binary files a/Tools/GacGen32.exe and b/Tools/GacGen32.exe differ diff --git a/Tools/GacGen64.exe b/Tools/GacGen64.exe index b49f5b96..31eb923e 100644 Binary files a/Tools/GacGen64.exe and b/Tools/GacGen64.exe differ diff --git a/Tutorial/GacUI_HelloWorlds/UIRes/Xml.bin.x64 b/Tutorial/GacUI_HelloWorlds/UIRes/Xml.bin.x64 index d1557273..a423102c 100644 Binary files a/Tutorial/GacUI_HelloWorlds/UIRes/Xml.bin.x64 and b/Tutorial/GacUI_HelloWorlds/UIRes/Xml.bin.x64 differ diff --git a/Tutorial/GacUI_HelloWorlds/UIRes/Xml.bin.x86 b/Tutorial/GacUI_HelloWorlds/UIRes/Xml.bin.x86 index 392e2295..5d2e86d7 100644 Binary files a/Tutorial/GacUI_HelloWorlds/UIRes/Xml.bin.x86 and b/Tutorial/GacUI_HelloWorlds/UIRes/Xml.bin.x86 differ