Added GetWindowHeight() for completeness + BeginGroup() comment.

This commit is contained in:
ocornut 2015-08-25 16:55:14 +01:00
parent 822eaf1751
commit 8cf7df7ec4
2 changed files with 8 additions and 1 deletions

View File

@ -4353,6 +4353,12 @@ float ImGui::GetWindowWidth()
return window->Size.x; return window->Size.x;
} }
float ImGui::GetWindowHeight()
{
ImGuiWindow* window = GImGui->CurrentWindow;
return window->Size.y;
}
ImVec2 ImGui::GetWindowPos() ImVec2 ImGui::GetWindowPos()
{ {
ImGuiState& g = *GImGui; ImGuiState& g = *GImGui;

View File

@ -131,6 +131,7 @@ namespace ImGui
IMGUI_API ImVec2 GetWindowPos(); // get current window position in screen space (useful if you want to do your own drawing via the DrawList api) IMGUI_API ImVec2 GetWindowPos(); // get current window position in screen space (useful if you want to do your own drawing via the DrawList api)
IMGUI_API ImVec2 GetWindowSize(); // get current window size IMGUI_API ImVec2 GetWindowSize(); // get current window size
IMGUI_API float GetWindowWidth(); IMGUI_API float GetWindowWidth();
IMGUI_API float GetWindowHeight();
IMGUI_API bool IsWindowCollapsed(); IMGUI_API bool IsWindowCollapsed();
IMGUI_API void SetNextWindowPos(const ImVec2& pos, ImGuiSetCond cond = 0); // set next window position. call before Begin() IMGUI_API void SetNextWindowPos(const ImVec2& pos, ImGuiSetCond cond = 0); // set next window position. call before Begin()
@ -177,7 +178,7 @@ namespace ImGui
IMGUI_API void PopButtonRepeat(); IMGUI_API void PopButtonRepeat();
// Cursor / Layout // Cursor / Layout
IMGUI_API void BeginGroup(); // once closing a group it is seen as a single item (so you can use IsItemHovered() on a group, SameLine() between groups, etc. IMGUI_API void BeginGroup(); // lock horizontal starting position. once closing a group it is seen as a single item (so you can use IsItemHovered() on a group, SameLine() between groups, etc.
IMGUI_API void EndGroup(); IMGUI_API void EndGroup();
IMGUI_API void Separator(); // horizontal line IMGUI_API void Separator(); // horizontal line
IMGUI_API void SameLine(float local_pos_x = 0.0f, float spacing_w = -1.0f); // call between widgets or groups to layout them horizontally IMGUI_API void SameLine(float local_pos_x = 0.0f, float spacing_w = -1.0f); // call between widgets or groups to layout them horizontally