You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// ActiveId might have been released by the time we call this (as in the typical press/release button behavior) but still need to fill the data.
4834
4834
ImGuiContext& g = *GImGui;
4835
4835
4836
+
//IM_ASSERT(g.LastItemData.ID == id); // Failing cases include: "widgets_inputtext_scrolling", "widgets_inputtext_multiline_status", "widgets_selectable_input" = case of e.g TempInputText() overlayed manually with different ID (#2718)
// FIXME: Can't we fully rely on LastItemData yet?
4844
4845
g.ActiveIdHasBeenEditedThisFrame = true;
4845
4846
g.ActiveIdHasBeenEditedBefore = true;
4846
-
if (g.DeactivatedItemData.ID == id)
4847
-
g.DeactivatedItemData.HasBeenEditedBefore = true;
4848
4847
}
4848
+
if (g.DeactivatedItemData.ID == id)
4849
+
g.DeactivatedItemData.HasBeenEditedBefore = true;
4849
4850
4850
4851
// We accept a MarkItemEdited() on drag and drop targets (see https://github.com/ocornut/imgui/issues/1875#issuecomment-978243343)
4851
4852
// We accept 'ActiveIdPreviousFrame == id' for InputText() returning an edit after it has been taken ActiveId away (#4714)
4852
4853
// FIXME: This assert is getting a bit meaningless over time. It helped detect some unusual use cases but eventually it is becoming an unnecessary restriction.
Copy file name to clipboardExpand all lines: imgui.h
+4-1Lines changed: 4 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -30,7 +30,7 @@
30
30
// Library Version
31
31
// (Integer encoded as XYYZZ for use in #if preprocessor conditionals, e.g. '#if IMGUI_VERSION_NUM >= 12345')
32
32
#defineIMGUI_VERSION"1.92.9 WIP"
33
-
#defineIMGUI_VERSION_NUM19285
33
+
#defineIMGUI_VERSION_NUM19286
34
34
#defineIMGUI_HAS_TABLE// Added BeginTable() - from IMGUI_VERSION_NUM >= 18000
35
35
#defineIMGUI_HAS_TEXTURES// Added ImGuiBackendFlags_RendererHasTextures - from IMGUI_VERSION_NUM >= 19198
36
36
@@ -1246,6 +1246,8 @@ enum ImGuiItemFlags_
1246
1246
ImGuiItemFlags_AutoClosePopups = 1 << 4, // true // MenuItem()/Selectable() automatically close their parent popup window.
1247
1247
ImGuiItemFlags_AllowDuplicateId = 1 << 5, // false // Allow submitting an item with the same identifier as an item already submitted this frame without triggering a warning tooltip if io.ConfigDebugHighlightIdConflicts is set.
1248
1248
ImGuiItemFlags_Disabled = 1 << 6, // false // [Internal] Disable interactions. DOES NOT affect visuals. This is used by BeginDisabled()/EndDisabled() and only provided here so you can read back via GetItemFlags().
1249
+
1250
+
ImGuiItemFlags_LiveEdit = 1 << 7, // true // WIP
1249
1251
};
1250
1252
1251
1253
// Flags for ImGui::InputText()
@@ -1275,6 +1277,7 @@ enum ImGuiInputTextFlags_
1275
1277
ImGuiInputTextFlags_DisplayEmptyRefVal = 1 << 14, // InputFloat(), InputInt(), InputScalar() etc. only: when value is zero, do not display it. Generally used with ImGuiInputTextFlags_ParseEmptyRefVal.
1276
1278
ImGuiInputTextFlags_NoHorizontalScroll = 1 << 15, // Disable following the cursor horizontally
1277
1279
ImGuiInputTextFlags_NoUndoRedo = 1 << 16, // Disable undo/redo. Note that input text owns the text data while active, if you want to provide your own undo/redo stack you need e.g. to call ClearActiveID().
1280
+
//ImGuiInputTextFlags_NoLiveEdit = 1 << 25,
1278
1281
1279
1282
// Elide display / Alignment
1280
1283
ImGuiInputTextFlags_ElideLeft = 1 << 17, // When text doesn't fit, elide left side to ensure right side stays visible. Useful for path/filenames. Single-line only!
inlineboolTempInputIsActive(ImGuiID id) { ImGuiContext& g = *GImGui; returng.ActiveId == id && g.TempInputId == id; }
3802
+
inlineboolTempInputIsActive(ImGuiID id) { ImGuiContext& g = *GImGui; return(g.TempInputId == id && g.ActiveId == id) || (g.InputTextDeactivatedState.ID == id); }
3803
3803
inline ImGuiInputTextState* GetInputTextState(ImGuiID id) { ImGuiContext& g = *GImGui; return (id != 0 && g.InputTextState.ID == id) ? &g.InputTextState : NULL; } // Get input text state if active
inlineboolIsItemActiveAsInputText() { ImGuiContext& g = *GImGui; return g.ActiveId != 0 && g.ActiveId == g.LastItemData.ID && g.InputTextState.ID == g.LastItemData.ID; } // This may be useful to apply workaround that a based on distinguish whenever an item is active as a text input field.
bool input_edited = (g.LastItemData.StatusFlags & ImGuiItemStatusFlags_EditedInternal) != 0; // We would be using 'ret' if ImGuiInputTextFlags_EnterReturnsTrue was not involved.
if (g.LastItemData.ItemFlags & ImGuiItemFlags_LiveEdit)
3847
+
{
3848
+
bool input_edited = (g.LastItemData.StatusFlags & ImGuiItemStatusFlags_EditedInternal) != 0; // We would be using 'ret' if ImGuiInputTextFlags_EnterReturnsTrue was not involved.
// Backup state of deactivating item so they'll have a chance to do a write to output buffer on the same frame they report IsItemDeactivatedAfterEdit (#4714)
4855
-
InputTextDeactivateHook(state->ID);
4871
+
if (state->ID != id && state->ID == g.ActiveId && (init_make_active && g.ActiveId != id))
4872
+
InputTextDeactivateHook(state->ID); // <-- this is essentially an earlier call to what SetActiveID() would do below.
4856
4873
4857
4874
// Take a copy of the initial buffer value.
4858
4875
// From the moment we focused we are normally ignoring the content of 'buf' (unless we are in read-only mode)
0 commit comments