// (minor and older changes stripped away, please see git history for details)
// (minor and older changes stripped away, please see git history for details)
// 2021-XX-XX: Platform: Added support for multiple windows via the ImGuiPlatformIO interface.
// 2021-XX-XX: Platform: Added support for multiple windows via the ImGuiPlatformIO interface.
// 2021-03-23: Inputs: Clearing keyboard down array when losing focus (WM_KILLFOCUS).
// 2021-02-18: Added ImGui_ImplWin32_EnableAlphaCompositing(). Non Visual Studio users will need to link with dwmapi.lib (MinGW/gcc: use -ldwmapi).
// 2021-02-18: Added ImGui_ImplWin32_EnableAlphaCompositing(). Non Visual Studio users will need to link with dwmapi.lib (MinGW/gcc: use -ldwmapi).
// 2021-02-17: Fixed ImGui_ImplWin32_EnableDpiAwareness() attempting to get SetProcessDpiAwareness from shcore.dll on Windows 8 whereas it is only supported on Windows 8.1.
// 2021-02-17: Fixed ImGui_ImplWin32_EnableDpiAwareness() attempting to get SetProcessDpiAwareness from shcore.dll on Windows 8 whereas it is only supported on Windows 8.1.
elseif(IM_UNICODE_CODEPOINT_MAX==(0xFFFF))// Codepoint will not fit in ImWchar (extra parenthesis around 0xFFFF somehow fixes -Wunreachable-code with Clang)
}
cp=IM_UNICODE_CODEPOINT_INVALID;
else
else
{
#if IM_UNICODE_CODEPOINT_MAX == 0xFFFF
cp=IM_UNICODE_CODEPOINT_INVALID;// Codepoint will not fit in ImWchar
new_size.y=ImMax(new_size.y,window_for_height->TitleBarHeight()+window_for_height->MenuBarHeight()+ImMax(0.0f,g.Style.WindowRounding-1.0f));// Reduce artifacts with very small windows
new_size.y=ImMax(new_size.y,decoration_up_height+ImMax(0.0f,g.Style.WindowRounding-1.0f));// Reduce artifacts with very small windows
local_y-=window->TitleBarHeight()+window->MenuBarHeight();// FIXME: Would be nice to have a more standardized access to our scrollable/client rect
constfloatdecoration_up_height=window->TitleBarHeight()+window->MenuBarHeight();// FIXME: Would be nice to have a more standardized access to our scrollable/client rect;
local_y-=decoration_up_height;
window->ScrollTarget.y=IM_FLOOR(local_y+window->Scroll.y);// Convert local position to scroll offset
window->ScrollTarget.y=IM_FLOOR(local_y+window->Scroll.y);// Convert local position to scroll offset
// (Integer encoded as XYYZZ for use in #if preprocessor conditionals. Work in progress versions typically starts at XYY99 then bounce up to XYY00, XYY01 etc. when release tagging happens)
// (Integer encoded as XYYZZ for use in #if preprocessor conditionals. Work in progress versions typically starts at XYY99 then bounce up to XYY00, XYY01 etc. when release tagging happens)
IMGUI_APIintTableGetRowIndex();// return current row index.
IMGUI_APIintTableGetRowIndex();// return current row index.
IMGUI_APIconstchar*TableGetColumnName(intcolumn_n=-1);// return "" if column didn't have a name declared by TableSetupColumn(). Pass -1 to use current column.
IMGUI_APIconstchar*TableGetColumnName(intcolumn_n=-1);// return "" if column didn't have a name declared by TableSetupColumn(). Pass -1 to use current column.
IMGUI_APIImGuiTableColumnFlagsTableGetColumnFlags(intcolumn_n=-1);// return column flags so you can query their Enabled/Visible/Sorted/Hovered status flags. Pass -1 to use current column.
IMGUI_APIImGuiTableColumnFlagsTableGetColumnFlags(intcolumn_n=-1);// return column flags so you can query their Enabled/Visible/Sorted/Hovered status flags. Pass -1 to use current column.
IMGUI_APIvoidTableSetColumnEnabled(intcolumn_n,boolv);// change enabled/disabled state of a column, set to false to hide the column. Note that end-user can use the context menu to change this themselves (right-click in headers, or right-click in columns body with ImGuiTableFlags_ContextMenuInBody)
IMGUI_APIvoidTableSetBgColor(ImGuiTableBgTargettarget,ImU32color,intcolumn_n=-1);// change the color of a cell, row, or column. See ImGuiTableBgTarget_ flags for details.
IMGUI_APIvoidTableSetBgColor(ImGuiTableBgTargettarget,ImU32color,intcolumn_n=-1);// change the color of a cell, row, or column. See ImGuiTableBgTarget_ flags for details.
// Legacy Columns API (2020: prefer using Tables!)
// Legacy Columns API (2020: prefer using Tables!)
@ -1337,15 +1337,22 @@ struct ImGuiViewportP : public ImGuiViewport
ImVec2LastRendererSize;
ImVec2LastRendererSize;
ImVec2WorkOffsetMin;// Work Area: Offset from Pos to top-left corner of Work Area. Generally (0,0) or (0,+main_menu_bar_height). Work Area is Full Area but without menu-bars/status-bars (so WorkArea always fit inside Pos/Size!)
ImVec2WorkOffsetMin;// Work Area: Offset from Pos to top-left corner of Work Area. Generally (0,0) or (0,+main_menu_bar_height). Work Area is Full Area but without menu-bars/status-bars (so WorkArea always fit inside Pos/Size!)
ImVec2WorkOffsetMax;// Work Area: Offset from Pos+Size to bottom-right corner of Work Area. Generally (0,0) or (0,-status_bar_height).
ImVec2WorkOffsetMax;// Work Area: Offset from Pos+Size to bottom-right corner of Work Area. Generally (0,0) or (0,-status_bar_height).
ImVec2CurrWorkOffsetMin;// Work Area: Offset being built/increased during current frame
ImVec2BuildWorkOffsetMin;// Work Area: Offset being built during current frame. Generally >= 0.0f.
ImVec2CurrWorkOffsetMax;// Work Area: Offset being built/decreased during current frame
ImVec2BuildWorkOffsetMax;// Work Area: Offset being built during current frame. Generally <= 0.0f.
// Calculate work rect pos/size given a set of offset (we have 1 pair of offset for rect locked from last frame data, and 1 pair for currently building rect)
IMGUI_APIintTableGetHoveredColumn();// May use (TableGetColumnFlags() & ImGuiTableColumnFlags_IsHovered) instead. Return hovered column. return -1 when table is not hovered. return columns_count if the unused space at the right of visible columns is hovered.
IMGUI_APIintTableGetHoveredColumn();// May use (TableGetColumnFlags() & ImGuiTableColumnFlags_IsHovered) instead. Return hovered column. return -1 when table is not hovered. return columns_count if the unused space at the right of visible columns is hovered.
// Request enabling/disabling a column (often perceived as "showing/hiding" from users point of view)
// Note that end-user can use the context menu to change this themselves (right-click in headers, or right-click in columns body with ImGuiTableFlags_ContextMenuInBody)
// Request will be applied during next layout, which happens on the first call to TableNextRow() after BeginTable()
// For the getter you can use (TableGetColumnFlags() & ImGuiTableColumnFlags_IsEnabled)
// For the getter you can use (TableGetColumnFlags() & ImGuiTableColumnFlags_IsEnabled)
window->DC.MenuBarOffset.x=window->DC.CursorPos.x-window->MenuBarRect().Min.x;// Save horizontal position so next append can reuse it. This is kinda equivalent to a per-layer CursorPos.
window->DC.MenuBarOffset.x=window->DC.CursorPos.x-window->Pos.x;// Save horizontal position so next append can reuse it. This is kinda equivalent to a per-layer CursorPos.
g.GroupStack.back().EmitItem=false;
g.GroupStack.back().EmitItem=false;
EndGroup();// Restore position on layer 0
EndGroup();// Restore position on layer 0
window->DC.LayoutType=ImGuiLayoutType_Vertical;
window->DC.LayoutType=ImGuiLayoutType_Vertical;
@ -6612,45 +6612,67 @@ void ImGui::EndMenuBar()
window->DC.MenuBarAppending=false;
window->DC.MenuBarAppending=false;
}
}
boolImGui::BeginMainMenuBar()
// Important: calling order matters!
// FIXME: Somehow overlapping with docking tech.
// FIXME: The "rect-cut" aspect of this could be formalized into a lower-level helper (rect-cut: https://halt.software/dead-simple-layouts)
SetNextWindowViewport(viewport->ID);// Enforce viewport so we don't create our own viewport when ImGuiConfigFlags_ViewportsNoMerge is set.
SetNextWindowViewport(viewport->ID);// Enforce viewport so we don't create our own viewport when ImGuiConfigFlags_ViewportsNoMerge is set.
PushStyleVar(ImGuiStyleVar_WindowRounding,0.0f);
PushStyleVar(ImGuiStyleVar_WindowRounding,0.0f);
PushStyleVar(ImGuiStyleVar_WindowMinSize,ImVec2(0,0));// Lift normal size constraint, however the presence of a menu-bar will give us the minimum height we want.
PushStyleVar(ImGuiStyleVar_WindowMinSize,ImVec2(0,0));// Lift normal size constraint