|
@@ -3386,10 +3386,8 @@ ImVec2 ImGui::GetWindowPos()
|
|
return window->Pos;
|
|
return window->Pos;
|
|
}
|
|
}
|
|
|
|
|
|
-void ImGui::SetWindowPos(const ImVec2& pos, ImGuiSetCondition cond)
|
|
|
|
|
|
+static void SetWindowPos(ImGuiWindow* window, const ImVec2& pos, ImGuiSetCondition cond)
|
|
{
|
|
{
|
|
- ImGuiWindow* window = GetCurrentWindow();
|
|
|
|
-
|
|
|
|
// Test condition (NB: bit 0 is always true) and clear flags for next time
|
|
// Test condition (NB: bit 0 is always true) and clear flags for next time
|
|
if (cond && (window->SetWindowPosAllowFlags & cond) == 0)
|
|
if (cond && (window->SetWindowPosAllowFlags & cond) == 0)
|
|
return;
|
|
return;
|
|
@@ -3402,16 +3400,27 @@ void ImGui::SetWindowPos(const ImVec2& pos, ImGuiSetCondition cond)
|
|
window->DC.CursorPos += (window->Pos - old_pos); // As we happen to move the window while it is being appended to (which is a bad idea - will smear) let's at least offset the cursor
|
|
window->DC.CursorPos += (window->Pos - old_pos); // As we happen to move the window while it is being appended to (which is a bad idea - will smear) let's at least offset the cursor
|
|
}
|
|
}
|
|
|
|
|
|
-ImVec2 ImGui::GetWindowSize()
|
|
|
|
|
|
+void ImGui::SetWindowPos(const ImVec2& pos, ImGuiSetCondition cond)
|
|
{
|
|
{
|
|
ImGuiWindow* window = GetCurrentWindow();
|
|
ImGuiWindow* window = GetCurrentWindow();
|
|
- return window->Size;
|
|
|
|
|
|
+ SetWindowPos(window, pos, cond);
|
|
}
|
|
}
|
|
|
|
|
|
-void ImGui::SetWindowSize(const ImVec2& size, ImGuiSetCondition cond)
|
|
|
|
|
|
+void ImGui::SetWindowPos(const char* name, const ImVec2& pos, ImGuiSetCondition cond)
|
|
|
|
+{
|
|
|
|
+ ImGuiWindow* window = FindWindowByName(name);
|
|
|
|
+ if (window)
|
|
|
|
+ SetWindowPos(window, pos, cond);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+ImVec2 ImGui::GetWindowSize()
|
|
{
|
|
{
|
|
ImGuiWindow* window = GetCurrentWindow();
|
|
ImGuiWindow* window = GetCurrentWindow();
|
|
|
|
+ return window->Size;
|
|
|
|
+}
|
|
|
|
|
|
|
|
+static void SetWindowSize(ImGuiWindow* window, const ImVec2& size, ImGuiSetCondition cond)
|
|
|
|
+{
|
|
// Test condition (NB: bit 0 is always true) and clear flags for next time
|
|
// Test condition (NB: bit 0 is always true) and clear flags for next time
|
|
if (cond && (window->SetWindowSizeAllowFlags & cond) == 0)
|
|
if (cond && (window->SetWindowSizeAllowFlags & cond) == 0)
|
|
return;
|
|
return;
|
|
@@ -3431,10 +3440,21 @@ void ImGui::SetWindowSize(const ImVec2& size, ImGuiSetCondition cond)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-void ImGui::SetWindowCollapsed(bool collapsed, ImGuiSetCondition cond)
|
|
|
|
|
|
+void ImGui::SetWindowSize(const ImVec2& size, ImGuiSetCondition cond)
|
|
{
|
|
{
|
|
ImGuiWindow* window = GetCurrentWindow();
|
|
ImGuiWindow* window = GetCurrentWindow();
|
|
|
|
+ SetWindowSize(window, size, cond);
|
|
|
|
+}
|
|
|
|
|
|
|
|
+void ImGui::SetWindowSize(const char* name, const ImVec2& size, ImGuiSetCondition cond)
|
|
|
|
+{
|
|
|
|
+ ImGuiWindow* window = FindWindowByName(name);
|
|
|
|
+ if (window)
|
|
|
|
+ SetWindowSize(window, size, cond);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static void SetWindowCollapsed(ImGuiWindow* window, bool collapsed, ImGuiSetCondition cond)
|
|
|
|
+{
|
|
// Test condition (NB: bit 0 is always true) and clear flags for next time
|
|
// Test condition (NB: bit 0 is always true) and clear flags for next time
|
|
if (cond && (window->SetWindowCollapsedAllowFlags & cond) == 0)
|
|
if (cond && (window->SetWindowCollapsedAllowFlags & cond) == 0)
|
|
return;
|
|
return;
|
|
@@ -3444,6 +3464,19 @@ void ImGui::SetWindowCollapsed(bool collapsed, ImGuiSetCondition cond)
|
|
window->Collapsed = collapsed;
|
|
window->Collapsed = collapsed;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+void ImGui::SetWindowCollapsed(bool collapsed, ImGuiSetCondition cond)
|
|
|
|
+{
|
|
|
|
+ ImGuiWindow* window = GetCurrentWindow();
|
|
|
|
+ SetWindowCollapsed(window);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+void ImGui::SetWindowCollapsed(const char* name, bool collapsed, ImGuiSetCondition cond)
|
|
|
|
+{
|
|
|
|
+ ImGuiWindow* window = FindWindowByName(name);
|
|
|
|
+ if (window)
|
|
|
|
+ SetWindowCollapsed(window);
|
|
|
|
+}
|
|
|
|
+
|
|
void ImGui::SetWindowFocus()
|
|
void ImGui::SetWindowFocus()
|
|
{
|
|
{
|
|
ImGuiWindow* window = GetCurrentWindow();
|
|
ImGuiWindow* window = GetCurrentWindow();
|