// Allow last item to be overlapped by a subsequent item. Both may be activated during the same frame before the later one takes priority.
// FIXME: Although this is exposed, its interaction and ideal idiom with using ImGuiButtonFlags_AllowOverlap flag are extremely confusing, need rework.
// FIXME-LEGACY: Use SetNextItemAllowOverlap() *before* your item instead.
voidImGui::SetItemAllowOverlap()
{
ImGuiContext&g=*GImGui;
ImGuiIDid=g.LastItemData.ID;
if(g.HoveredId==id)
g.HoveredIdAllowOverlap=true;
if(g.ActiveId==id)
if(g.ActiveId==id)// Before we made this obsolete, most calls to SetItemAllowOverlap() used to avoid this path by testing g.ActiveId != id.
g.ActiveIdAllowOverlap=true;
}
#endif
// FIXME: It might be undesirable that this will likely disable KeyOwner-aware shortcuts systems. Consider a more fine-tuned version for the two users of this function.
// (Integer encoded as XYYZZ for use in #if preprocessor conditionals, e.g. '#if IMGUI_VERSION_NUM >= 12345')
#define IMGUI_VERSION "1.89.7 WIP"
#define IMGUI_VERSION_NUM 18966
#define IMGUI_VERSION_NUM 18967
#define IMGUI_HAS_TABLE
/*
@ -839,6 +839,9 @@ namespace ImGui
IMGUI_APIvoidSetItemDefaultFocus();// make last item the default focused item of a window.
IMGUI_APIvoidSetKeyboardFocusHere(intoffset=0);// focus keyboard on the next widget. Use positive 'offset' to access sub components of a multiple component widget. Use -1 to access previous widget.
// Overlapping mode
IMGUI_APIvoidSetNextItemAllowOverlap();// allow next item to be overlapped by a subsequent item. Useful with invisible buttons, selectable, treenode covering an area where subsequent items may need to be added. Note that both Selectable() and TreeNode() have dedicated flags doing this.
// Item/Widgets Utilities and Query Functions
// - Most of the functions are referring to the previous Item that has been submitted.
// - See Demo Window under "Widgets->Querying Status" for an interactive visualization of most of those functions.
@ -859,7 +862,6 @@ namespace ImGui
IMGUI_APIImVec2GetItemRectMin();// get upper-left bounding rectangle of the last item (screen space)
IMGUI_APIImVec2GetItemRectMax();// get lower-right bounding rectangle of the last item (screen space)
IMGUI_APIImVec2GetItemRectSize();// get size of last item
IMGUI_APIvoidSetItemAllowOverlap();// allow last item to be overlapped by a subsequent item. sometimes useful with invisible buttons, selectables, etc. to catch unused area.
// Viewports
// - Currently represents the Platform Window created by the application which is hosting our Dear ImGui windows.
@ -3072,6 +3074,8 @@ namespace ImGui
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
namespaceImGui
{
// OBSOLETED in 1.89.7 (from June 2023)
IMGUI_APIvoidSetItemAllowOverlap();// Use SetNextItemAllowOverlap() before item.
ImGuiItemFlags_MixedValue=1<<6,// false // [BETA] Represent a mixed/indeterminate value, generally multi-selection where values differ. Currently only supported by Checkbox() (later should support all sorts of widgets)
ImGuiItemFlags_ReadOnly=1<<7,// false // [ALPHA] Allow hovering interactions but underlying value is not changed.
ImGuiItemFlags_NoWindowHoverableCheck=1<<8,// false // Disable hoverable check in ItemHoverable()
ImGuiItemflags_AllowOverlap=1<<9,// false // Allow being overlapped by another widget. Not-hovered to Hovered transition deferred by a frame.
// Controlled by widget code
ImGuiItemFlags_Inputable=1<<10,// false // [WIP] Auto-activate input mode when tab focused. Currently only used and supported by a few items before it becomes a generic feature.
@ -861,7 +862,7 @@ enum ImGuiButtonFlagsPrivate_
ImGuiButtonFlags_PressedOnDragDropHold=1<<9,// return true when held into while we are drag and dropping another item (used by e.g. tree nodes, collapsing headers)
ImGuiButtonFlags_Repeat=1<<10,// hold to repeat
ImGuiButtonFlags_FlattenChildren=1<<11,// allow interactions even if a child window is overlapping
ImGuiButtonFlags_AllowOverlap=1<<12,// require previous frame HoveredId to either match id or be null before being usable, use along with SetItemAllowOverlap()
ImGuiButtonFlags_AllowOverlap=1<<12,// require previous frame HoveredId to either match id or be null before being usable.
ImGuiButtonFlags_DontClosePopups=1<<13,// disable automatically closing parent popup on press // [UNUSED]
//ImGuiButtonFlags_Disabled = 1 << 14, // disable interactions -> use BeginDisabled() or ImGuiItemFlags_Disabled
ImGuiButtonFlags_AlignTextBaseLine=1<<15,// vertically align button to match text baseline - ButtonEx() only // FIXME: Should be removed and handled by SmallButton(), not possible currently because of DC.CursorPosPrevLine
@ -1179,7 +1180,7 @@ enum ImGuiNextItemDataFlags_
structImGuiNextItemData
{
ImGuiNextItemDataFlagsFlags;
ImGuiItemFlagsItemFlags;
ImGuiItemFlagsItemFlags;// Currently only tested/used for ImGuiItemflags_AllowOverlap.
floatWidth;// Set by SetNextItemWidth()
ImGuiIDFocusScopeId;// Set by SetNextItemMultiSelectData() (!= 0 signify value has been set, so it's an alternate version of HasSelectionData, we don't use Flags for this because they are cleared too early. This is mostly used for debugging)
// AllowOverlap mode (rarely used) requires previous frame HoveredId to be null or to match. This allows using patterns where a later submitted widget overlaps a previous one.