mirror of
https://github.com/Drezil/imgui.git
synced 2024-11-26 05:27:01 +00:00
Comments (#1567)
This commit is contained in:
parent
9a76fd30fd
commit
f6ee8d30fb
13
imgui.cpp
13
imgui.cpp
@ -5006,19 +5006,18 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
|
|||||||
return !window->SkipItems;
|
return !window->SkipItems;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Old Begin() API with 5 parameters, avoid calling this version directly! Use SetNextWindowSize()+Begin() instead.
|
// Old Begin() API with 5 parameters, avoid calling this version directly! Use SetNextWindowSize()/SetNextWindowBgAlpha() + Begin() instead.
|
||||||
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
|
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
|
||||||
bool ImGui::Begin(const char* name, bool* p_open, const ImVec2& size_on_first_use, float bg_alpha_override, ImGuiWindowFlags flags)
|
bool ImGui::Begin(const char* name, bool* p_open, const ImVec2& size_first_use, float bg_alpha_override, ImGuiWindowFlags flags)
|
||||||
{
|
{
|
||||||
// Old API feature: we could pass the initial window size as a parameter, however this was very misleading because in most cases it would only affect the window when it didn't have storage in the .ini file.
|
// Old API feature: we could pass the initial window size as a parameter. This was misleading because it only had an effect if the window didn't have data in the .ini file.
|
||||||
if (size_on_first_use.x != 0.0f || size_on_first_use.y != 0.0f)
|
if (size_first_use.x != 0.0f || size_first_use.y != 0.0f)
|
||||||
ImGui::SetNextWindowSize(size_on_first_use, ImGuiCond_FirstUseEver);
|
ImGui::SetNextWindowSize(size_first_use, ImGuiCond_FirstUseEver);
|
||||||
|
|
||||||
// Old API feature: override the window background alpha with a parameter.
|
// Old API feature: override the window background alpha with a parameter.
|
||||||
ImGui::SetNextWindowBgAlpha(bg_alpha_override);
|
ImGui::SetNextWindowBgAlpha(bg_alpha_override);
|
||||||
|
|
||||||
bool ret = ImGui::Begin(name, p_open, flags);
|
return ImGui::Begin(name, p_open, flags);
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
#endif // IMGUI_DISABLE_OBSOLETE_FUNCTIONS
|
#endif // IMGUI_DISABLE_OBSOLETE_FUNCTIONS
|
||||||
|
|
||||||
|
2
imgui.h
2
imgui.h
@ -1004,7 +1004,7 @@ namespace ImGui
|
|||||||
static inline void SetNextWindowContentWidth(float w) { SetNextWindowContentSize(ImVec2(w, 0.0f)); }
|
static inline void SetNextWindowContentWidth(float w) { SetNextWindowContentSize(ImVec2(w, 0.0f)); }
|
||||||
static inline float GetItemsLineHeightWithSpacing() { return GetFrameHeightWithSpacing(); }
|
static inline float GetItemsLineHeightWithSpacing() { return GetFrameHeightWithSpacing(); }
|
||||||
// OBSOLETED in 1.52 (between Aug 2017 and Oct 2017)
|
// OBSOLETED in 1.52 (between Aug 2017 and Oct 2017)
|
||||||
bool Begin(const char* name, bool* p_open, const ImVec2& size_on_first_use, float bg_alpha_override = -1.0f, ImGuiWindowFlags flags = 0); // Use SetNextWindowSize() instead if you want to set a window size.
|
bool Begin(const char* name, bool* p_open, const ImVec2& size_on_first_use, float bg_alpha_override = -1.0f, ImGuiWindowFlags flags = 0); // Use SetNextWindowSize(size, ImGuiCond_FirstUseEver) + SetNextWindowBgAlpha() instead.
|
||||||
static inline bool IsRootWindowOrAnyChildHovered() { return IsItemHovered(ImGuiHoveredFlags_RootAndChildWindows); }
|
static inline bool IsRootWindowOrAnyChildHovered() { return IsItemHovered(ImGuiHoveredFlags_RootAndChildWindows); }
|
||||||
static inline void AlignFirstTextHeightToWidgets() { AlignTextToFramePadding(); }
|
static inline void AlignFirstTextHeightToWidgets() { AlignTextToFramePadding(); }
|
||||||
static inline void SetNextWindowPosCenter(ImGuiCond c=0) { ImGuiIO& io = GetIO(); SetNextWindowPos(ImVec2(io.DisplaySize.x * 0.5f, io.DisplaySize.y * 0.5f), c, ImVec2(0.5f, 0.5f)); }
|
static inline void SetNextWindowPosCenter(ImGuiCond c=0) { ImGuiIO& io = GetIO(); SetNextWindowPos(ImVec2(io.DisplaySize.x * 0.5f, io.DisplaySize.y * 0.5f), c, ImVec2(0.5f, 0.5f)); }
|
||||||
|
Loading…
Reference in New Issue
Block a user