| 5573 | } |
| 5574 | |
| 5575 | static ImGuiWindow* CreateNewWindow(const char* name, ImGuiWindowFlags flags) |
| 5576 | { |
| 5577 | // Create window the first time |
| 5578 | //IMGUI_DEBUG_LOG("CreateNewWindow '%s', flags = 0x%08X\n", name, flags); |
| 5579 | ImGuiContext& g = *GImGui; |
| 5580 | ImGuiWindow* window = IM_NEW(ImGuiWindow)(&g, name); |
| 5581 | window->Flags = flags; |
| 5582 | g.WindowsById.SetVoidPtr(window->ID, window); |
| 5583 | |
| 5584 | ImGuiWindowSettings* settings = NULL; |
| 5585 | if (!(flags & ImGuiWindowFlags_NoSavedSettings)) |
| 5586 | if ((settings = ImGui::FindWindowSettingsByWindow(window)) != 0) |
| 5587 | window->SettingsOffset = g.SettingsWindows.offset_from_ptr(settings); |
| 5588 | |
| 5589 | InitOrLoadWindowSettings(window, settings); |
| 5590 | |
| 5591 | if (flags & ImGuiWindowFlags_NoBringToFrontOnFocus) |
| 5592 | g.Windows.push_front(window); // Quite slow but rare and only once |
| 5593 | else |
| 5594 | g.Windows.push_back(window); |
| 5595 | |
| 5596 | return window; |
| 5597 | } |
| 5598 | |
| 5599 | static ImVec2 CalcWindowSizeAfterConstraint(ImGuiWindow* window, const ImVec2& size_desired) |
| 5600 | { |
no test coverage detected