MCPcopy Create free account
hub / github.com/Aegel5/SimpleSwitcher / DockBuilderRemoveNodeDockedWindows

Method DockBuilderRemoveNodeDockedWindows

imgui_tiny_app/imgui/imgui.cpp:20850–20882  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20848}
20849
20850void ImGui::DockBuilderRemoveNodeDockedWindows(ImGuiID root_id, bool clear_settings_refs)
20851{
20852 // Clear references in settings
20853 ImGuiContext& g = *GImGui;
20854 if (clear_settings_refs)
20855 {
20856 for (ImGuiWindowSettings* settings = g.SettingsWindows.begin(); settings != NULL; settings = g.SettingsWindows.next_chunk(settings))
20857 {
20858 bool want_removal = (root_id == 0) || (settings->DockId == root_id);
20859 if (!want_removal && settings->DockId != 0)
20860 if (ImGuiDockNode* node = DockContextFindNodeByID(&g, settings->DockId))
20861 if (DockNodeGetRootNode(node)->ID == root_id)
20862 want_removal = true;
20863 if (want_removal)
20864 settings->DockId = 0;
20865 }
20866 }
20867
20868 // Clear references in windows
20869 for (int n = 0; n < g.Windows.Size; n++)
20870 {
20871 ImGuiWindow* window = g.Windows[n];
20872 bool want_removal = (root_id == 0) || (window->DockNode && DockNodeGetRootNode(window->DockNode)->ID == root_id) || (window->DockNodeAsHost && window->DockNodeAsHost->ID == root_id);
20873 if (want_removal)
20874 {
20875 const ImGuiID backup_dock_id = window->DockId;
20876 IM_UNUSED(backup_dock_id);
20877 DockContextProcessUndockWindow(&g, window, clear_settings_refs);
20878 if (!clear_settings_refs)
20879 IM_ASSERT(window->DockId == backup_dock_id);
20880 }
20881 }
20882}
20883
20884// If 'out_id_at_dir' or 'out_id_at_opposite_dir' are non NULL, the function will write out the ID of the two new nodes created.
20885// Return value is ID of the node at the specified direction, so same as (*out_id_at_dir) if that pointer is set.

Callers

nothing calls this directly

Calls 3

DockNodeGetRootNodeFunction · 0.85
next_chunkMethod · 0.80
beginMethod · 0.45

Tested by

no test coverage detected