-
-
Notifications
You must be signed in to change notification settings - Fork 11.3k
Description
Version/Branch of Dear ImGui:
Version 1.91.9b, Branch: docking
Back-ends:
imgui_impl_glfw.cpp + imgui_impl_vulkan.cpp
Compiler, OS:
Windows 11
Full config/build information:
Dear ImGui 1.91.9b (19191)
--------------------------------
sizeof(size_t): 8, sizeof(ImDrawIdx): 4, sizeof(ImDrawVert): 20
define: __cplusplus=199711
define: _WIN32
define: _WIN64
define: _MSC_VER=1941
define: _MSVC_LANG=202002
define: IMGUI_HAS_VIEWPORT
define: IMGUI_HAS_DOCK
--------------------------------
io.BackendPlatformName: imgui_impl_glfw
io.BackendRendererName: imgui_impl_vulkan
io.ConfigFlags: 0x00000483
NavEnableKeyboard
NavEnableGamepad
DockingEnable
ViewportsEnable
io.ConfigViewportsNoDecoration
io.ConfigNavCaptureKeyboard
io.ConfigInputTextCursorBlink
io.ConfigWindowsResizeFromEdges
io.ConfigMemoryCompactTimer = 60.0
io.BackendFlags: 0x00001C0E
HasMouseCursors
HasSetMousePos
PlatformHasViewports
HasMouseHoveredViewport
RendererHasVtxOffset
RendererHasViewports
--------------------------------
io.Fonts: 1 fonts, Flags: 0x00000000, TexSize: 512,64
io.DisplaySize: 1280.00,720.00
io.DisplayFramebufferScale: 1.00,1.00
--------------------------------
style.WindowPadding: 8.00,8.00
style.WindowBorderSize: 1.00
style.FramePadding: 4.00,3.00
style.FrameRounding: 0.00
style.FrameBorderSize: 0.00
style.ItemSpacing: 8.00,4.00
style.ItemInnerSpacing: 4.00,4.00
Details:
Regarding this assert:
IM_ASSERT((flags & ImGuiInputTextFlags_EnterReturnsTrue) == 0); // Not supported by InputScalar(). Please open an issue if you this would be useful to you. Otherwise use IsItemDeactivatedAfterEdit()!
This pattern was being used in many areas for my current project, and would still be useful in the future. However, when recently trying update our ImGui code, this assert was hit.
I can't go into too much details due to NDAs, but effectively once the "Enter" key is pressed the GUI side application would do some validations, then immediately send a message to a server to perform some action. Intermediate values would be considered dangerous and unacceptable. IsItemDeactivatedAfterEdit
would also work, but would lead to double the lines of what was once an elegant solution.
Thank you for providing and maintaining this library, it's been lovely to use. I understand this is just a nitpick, but wanted to provide my two cents.
Screenshots/Video:
No response
Minimal, Complete and Verifiable Example code:
if (ImGui::InputInt("Foo", &values.foo, 0, 0, ImGuiInputTextFlags_EnterReturnsTrue) && IsValid(values)) {
SendMessage(values);
}