github ocornut/imgui v1.91.0

latest releases: v1.91.1-docking, v1.91.1, v1.91.0-docking...
one month ago

1.91.0: multi-select, box-select, item flags, links & more

Reading the changelog is a good way to keep up to date with the things Dear ImGui has to offer, and maybe will give you ideas of some features that you've been ignoring until now!

📣 Click version number above to display full release note contents, otherwise it is clipped by GitHub!
❤️ This is the 100th release of Dear ImGui.
📆 In 12 days I will address the nation regarding upcoming plans for Dear Imgui, general thoughts, and putting more energy on topics that no one cares about such as: fonts, dpi scaling, styling, docking.


Links: Homepage - Release notes - FAQ - Issues, Q&A. Also see our Wiki with sections such as..

Dear ImGui is funded by your contributions and absolutely needs them to sustain and grow. We can invoice and accommodate to many situations. If your company uses Dear ImGui, please reach out. See Funding & Sponsors page. Did you know? If you need an excuse to pay, you may buy licenses for Test Engine and that will contribute to fund Dear ImGui.

In the recent years, Dear ImGui has been financially supported by: Aras Pranckevičius / Arkane Lyon / Asobo Studio / Avalanche Studios Group / BeamNG / Blizzard / Esoterica Engine / G3Dvu / Lucid Games / Noel Berry / Mobigame / Planestate Software / Pocketwatch Games / Remedy Entertainment / Supercell / Terrible Toybox / Tuxedo Labs / Wonderland Engine and many individual contributors. Thank you for allowing Dear ImGui to stay on its path.

Welcome to our new sponsors Valve and Sofistik !!

Special thanks to @GamingMinds-DanielC, @PathogenDavid, @cfillion & more for for their help with patches and answers!


Some of the multi-selection demos:
292222298-442d5689-3e91-4771-9e25-498fbeb9ea32

Changes

Breaking Changes:

  • IO, IME: renamed platform IME hook and added explicit context for consistency and future-proofness.
    • old: io.SetPlatformImeDataFn(ImGuiViewport* viewport, ImGuiPlatformImeData* data);
    • new: io.PlatformSetImeDataFn(ImGuiContext* ctx, ImGuiViewport* viewport, ImGuiPlatformImeData* data);
      It is expected that for a vast majority of users this is automatically set by core library and/or platform backend so it won't have any effect.
  • Obsoleted GetContentRegionMax(), GetWindowContentRegionMin() and GetWindowContentRegionMax(). (information thread: #7838)
    You should never need those functions! You can do everything in less a confusing manner by only using GetCursorScreenPos() and GetContentRegionAvail(). Also always consider that if you are using GetWindowPos() and GetCursorPos() you may also be making things unnecessarily complicated.
    I repeat: You can do everything with GetCursorScreenPos() and GetContentRegionAvail()!
    • GetWindowContentRegionMax().x - GetCursorPos().x --> GetContentRegionAvail().x
    • GetWindowContentRegionMax().x + GetWindowPos().x --> GetCursorScreenPos().x + GetContentRegionAvail().x // when called from left edge of window
    • GetContentRegionMax() --> GetContentRegionAvail() + GetCursorScreenPos() - GetWindowPos() // right edge in local coordinates
    • GetWindowContentRegionMax().x - GetWindowContentRegionMin().x --> GetContentRegionAvail() // when called from left edge of window
  • Item flag changes:
    • Obsoleted PushButtonRepeat()/PopButtonRepeat() in favor of using new PushItemFlag()/PopItemFlag() with ImGuiItemFlags_ButtonRepeat. Kept inline redirecting functions (will obsolete).
    • Obsoleted PushTabStop()/PopTabStop() in favor of using new PushItemFlag()/PopItemFlag() with ImGuiItemFlags_NoTabStop. Kept inline redirecting functions (will obsolete).
    • Renamed ImGuiSelectableFlags_DontClosePopups to ImGuiSelectableFlags_NoAutoClosePopups for consistency. Kept inline redirecting functions (will obsolete). + Internals: changed/inverted ImGuiItemFlags_SelectableDontClosePopup (default==false) to
      ImGuiItemFlags_AutoClosePopups (default==true), same logic, only inverted behavior. (#1379, #1468, #2200, #4936, #5216, #7302, #7573)
  • Commented out obsolete ImGuiModFlags (renamed to ImGuiKeyChord in 1.89). (#4921, #456)
  • Commented out obsolete ImGuiModFlags_XXX values (renamed to ImGuiMod_XXX in 1.89). (#4921, #456)
    • ImGuiModFlags_Ctrl -> ImGuiMod_Ctrl, ImGuiModFlags_Shift -> ImGuiMod_Shift etc.
  • Backends: GLFW+Emscripten: Renamed ImGui_ImplGlfw_InstallEmscriptenCanvasResizeCallback() to ImGui_ImplGlfw_InstallEmscriptenCallbacks(), with an additional GLFWWindow* parameter. (#7647) [@ypujante]

Other Changes

  • Added TextLink(), TextLinkOpenURL() hyperlink widgets. (#7660)
  • IO: added io.PlatformOpenInShellFn() handler to open a link/folder/file in OS shell. (#7660)
    Added IMGUI_DISABLE_DEFAULT_SHELL_FUNCTIONS to disable default Windows/Linux/Mac implementation.
  • IO: added io.ConfigNavSwapGamepadButtons to swap Activate/Cancel (A<>B) buttons, to match the typical "Nintendo/Japanese consoles" button layout when using Gamepad navigation. (#787, #5723)
  • Added PushItemFlag()/PopItemFlags(), ImGuiItemFlags to modify shared item flags:
    • Added ImGuiItemFlags_NoTabStop to disable tabbing through items.
    • Added ImGuiItemFlags_NoNav to disable any navigation and focus of items. (#787)
    • Added ImGuiItemFlags_NoNavDefaultFocus to disable item being default focus. (#787)
    • Added ImGuiItemFlags_ButtonRepeat to enable repeat on any button-like behavior.
    • Added ImGuiItemFlags_AutoClosePopups to disable menu items/selection auto closing parent popups.
      Disabling this was previously possible for Selectable() via a direct flag but not for MenuItem(). (#1379, #1468, #2200, #4936, #5216, #7302, #7573)
    • This was mostly all previously in imgui_internal.h.
  • Multi-Select: added multi-select API and demos. (#1861, #6518)
    • This system implements standard multi-selection idioms (CTRL+mouse click, CTRL+keyboard moves, SHIFT+mouse click, SHIFT+keyboard moves, etc.) with support for clipper (not submitting non-visible items), box-selection with scrolling, and many other details.
    • In the spirit of Dear ImGui design, your code owns both items and actual selection data. This is designed to allow all kinds of selection storage you may use in your application (e.g. set/map/hash, intrusive selection, interval trees, up to you).
    • The supported widgets are Selectable(), Checkbox(). TreeNode() is also technically supported but... using this correctly is more complicated. You need some sort of linear/random access to your tree, which is suited to advanced trees setups already implementing filters and clipper. We will work toward simplifying our existing demo for trees.
    • A helper ImGuiSelectionBasicStorage is provided to facilitate getting started in a typical app (likely to suit a majority of users).
    • Documentation:
    • Added BeginMultiSelect(), EndMultiSelect(), SetNextItemSelectionUserData().
    • Added IsItemToggledSelection() for use if you need latest selection update during current iteration.
    • Added ImGuiMultiSelectIO and ImGuiSelectionRequest structures:
      • BeginMultiSelect() and EndMultiSelect() return a ImGuiMultiSelectIO structure, which is mostly an array of ImGuiSelectionRequest actions (clear, select all, set range, etc.)
      • Other fields are helpful when using a clipper, or wanting to handle deletion nicely.
    • Added ImGuiSelectionBasicStorage helper to store and maintain a selection (optional):
      • This is similar to if you used e.g. a std::set to store a selection, with all the right glue to honor ImGuiMultiSelectIO requests. Most applications can use that.
    • Added ImGuiSelectionExternalStorage helper to maintain an externally stored selection (optional):
      • Helpful to easily bind multi-selection to e.g. an array of checkboxes.
    • Added ImGuiMultiSelectFlags options:
      • ImGuiMultiSelectFlags_SingleSelect: Disable selecting more than one item. This is available to allow single-selection code to share same code/logic if desired. It essentially disables the main purpose of BeginMultiSelect() tho!
      • ImGuiMultiSelectFlags_NoSelectAll: Disable CTRL+A shortcut to select all.
      • ImGuiMultiSelectFlags_NoRangeSelect: Disable Shift+selection mouse/keyboard support (useful for unordered 2D selection). With BoxSelect is also ensure contiguous SetRange requests are not combined into one. This allows not handling interpolation in SetRange requests.
      • ImGuiMultiSelectFlags_NoAutoSelect: Disable selecting items when navigating (useful for e.g. supporting range-select in a list of checkboxes).
      • ImGuiMultiSelectFlags_NoAutoClear: Disable clearing selection when navigating or selecting another one (generally used with ImGuiMultiSelectFlags_NoAutoSelect. useful for e.g. supporting range-select in a list of checkboxes).
      • ImGuiMultiSelectFlags_NoAutoClearOnReselect: Disable clearing selection when clicking/selecting an already selected item. (#7424)
      • ImGuiMultiSelectFlags_BoxSelect1d: Enable box-selection with same width and same x pos items (e.g. full row Selectable()). Box-selection works better with little bit of spacing between items hit-box in order to be able to aim at empty space.
      • ImGuiMultiSelectFlags_BoxSelect2d: Enable box-selection with varying width or varying x pos items support (e.g. different width labels, or 2D layout/grid). This is slower: alters clipping logic so that e.g. horizontal movements will update selection of normally clipped items.
      • ImGuiMultiSelectFlags_BoxSelectNoScroll: Disable scrolling when box-selecting near edges of scope.
      • ImGuiMultiSelectFlags_ClearOnEscape: Clear selection when pressing Escape while scope is focused.
      • ImGuiMultiSelectFlags_ClearOnClickVoid. Clear selection when clicking on empty location within scope.
      • ImGuiMultiSelectFlags_ScopeWindow (default): Scope for _BoxSelect and _ClearOnClickVoid is whole window (Default). Use if BeginMultiSelect() covers a whole window or used a single time in same window.
      • ImGuiMultiSelectFlags_ScopeRect: Scope for _BoxSelect and _ClearOnClickVoid is rectangle encompassing BeginMultiSelect()/EndMultiSelect(). Use if BeginMultiSelect() is called multiple times in same window.
      • ImGuiMultiSelectFlags_SelectOnClick (default): Apply selection on mouse down when clicking on unselected item. (Default)
      • ImGuiMultiSelectFlags_SelectOnClickRelease: Apply selection on mouse release when clicking an unselected item. Allow dragging an unselected item without altering selection.
      • ImGuiMultiSelectFlags_NavWrapX: [Temporary] Enable navigation wrapping on X axis. Provided as a convenience because we don't have a design for the general Nav API for this yet. When the more general feature be public we may obsolete this flag in favor of new one.
    • Demo: Added "Examples->Assets Browser" demo.
    • Demo: Added "Widgets->Selection State & Multi-Select" section, with:
      • Multi-Select
      • Multi-Select (with clipper)
      • Multi-Select (with deletion)
      • Multi-Select (dual list box) (#6648)
      • Multi-Select (in a table)
      • Multi-Select (checkboxes)
      • Multi-Select (multiple scopes)
      • Multi-Select (tiled assert browser)
      • Multi-Select (trees) (#1861)
      • Multi-Select (advanced)
  • Inputs: added SetItemKeyOwner(ImGuiKey key) in public API. This is a simplified version of a more complete set of function available in imgui_internal.h. One common use-case for this is to allow your widgets to disable standard inputs behaviors such as Tab or Alt handling, Mouse Wheel scrolling, etc. (#456, #2637, #2620, #2891, #3370, #3724, #4828, #5108, #5242, #5641)
     // Hovering or activating the button will disable mouse wheel default behavior to scroll
     InvisibleButton(...);
     SetItemKeyOwner(ImGuiKey_MouseWheelY);
  • Nav: fixed clicking window decorations (e.g. resize borders) from losing focused item when within a child window using ImGuiChildFlags_NavFlattened.
  • InputText: added '' and '/' as word separator. (#7824, #7704) [@reduf]
  • TreeNode: added SetNextItemStorageID() to specify/override the identifier used for persisting open/close storage. Useful if needing to often read/write from storage without manipulating the ID stack. (#7553, #6990, #3823, #1131)
  • Selectable: added ImGuiSelectableFlags_Highlight flag to highlight items independently from the hovered state. (#7820) [@rerilier]
  • Clipper: added SeekCursorForItem() function. When using ImGuiListClipper::Begin(INT_MAX) you can can use the clipper without knowing the amount of items beforehand. In this situation, call ImGuiListClipper::SeekCursorForItem(items_count) at the end of your iteration loop to position the layout cursor correctly. This is done automatically if provided a count to Begin(). (#1311)
  • Groups, Tables: fixed EndGroup() failing to correctly capture current table occupied size. (#7543)
  • Style, TabBar: added style.TabBarOverlineSize / ImGuiStyleVar_TabBarOverlineSize to manipulate thickness of the horizontal line over selected tabs. [@DctrNoob]
  • Style: close button and collapse/window-menu button hover highlight made rectangular instead of round.
  • Misc: added GetID(int) variant for consistency. (#7111)
  • Debug Tools:
    • Debug Log: Added IMGUI_DEBUG_LOG(), ImGui::DebugLog() in public API. (#5855)
      Printed entries include imgui frame counter prefix + are redirected to ShowDebugLogWindow() and other configurable locations. Always call IMGUI_DEBUG_LOG() for maximum stripping in caller code.
    • Debug Log: Added "Configure Outputs.." button. (#5855)
    • Debug Log: Fixed incorrect checkbox layout when partially clipped.
  • Demo: Reworked "Property Editor" demo in a manner that more resemble the tree data and
    struct description data that a real application would want to use.
  • Backends:
    • Backends: Win32: Fixed ImGuiMod_Super being mapped to VK_APPS instead of VK_LWIN || VK_RWIN. (#7768, #4858, #2622) [@Aemony]
    • Backends: SDL3: Update for API changes: SDL_GetGamepads() memory ownership change. (#7807)
    • Backends: SDL3: Update for API changes: SDL_GetClipboardText() memory ownership change. (#7801)
    • Backends: SDL3: Update for API changes: SDLK_x renames and SDLK_KP_x removals (#7761, #7762)
    • Backends: SDL3: Update for API changes: SDL_GetProperty() change to SDL_GetPointerProperty()`. (#7794) [@wermipls]
    • Backends: SDL2,SDL3,OSX: Update for io.SetPlatformImeDataFn() -> io.PlatformSetImeDataFn() rename.
    • Backends: GLFW,SDL2: Added io.PlatformOpenInShellFn handler for web/Emscripten versions. (#7660) [@ypujante, @ocornut]
    • Backends; GLFW+Emscripten: Added support for GLFW3 contrib port which fixes many of the things not supported by the embedded GLFW: gamepad support, mouse cursor shapes, copy to clipboard, workaround for Super/Meta key, different ways of resizing, multi-window (glfw/canvas) support. (#7647) [@ypujante]
    • Backends: GLFW+Emscripten: Fixed Emscripten warning when using mouse wheel on some setups "Unable to preventDefault inside passive event listener". (#7647, #7600) [@ypujante]

Changes from 1.90.9 to 1.91.0 related to the Docking branch:

  • Viewports: Always update fallback monitor to primary monitor if there's one.
  • Backends: OSX: Fixed NSAppKitVersion version limit for setWantsBestResolutionOpenGLSurface usage. (#7814) [@YGXXD]
  • Backends: SDL3: Fixed a bug preventing ImGuiViewportFlags_NoFocusOnAppearing support from working (Windows only).
  • Backends: Vulkan: ImGui_ImplVulkan_SwapBuffers() used by secondary viewports still proceeds increasing frame counters on VK_SUBOPTIMAL_KHR. (#7825, #3881) [@NostraMagister]

Bonus: Dear ImGui Multi-Context Compositor

Released a simple helper to facilitate displaying & interacting with multiple contexts simultaneously (e.g. update vs render domains contexts)
https://github.com/ocornut/imgui_club -> imgui_multicontext_compositor
Manages z-order, mouse/keyboard routing, cross-context drag and drop.
multi_context_compositor.gif

Gallery

TextLink(), TextLinkOpenURL()
20240702_hyperlink

Some more multi-select demos
multiselect_trees
multiselect_checkboxes

Dear ImGui Test Engine running automated tests for box-selection
📺 Video link: https://github.com/user-attachments/assets/bf55db48-f57b-4b9c-b595-44c45281ef6b
353504678-bf55db48-f57b-4b9c-b595-44c45281ef6b mp4_snapshot_00 15_ 2024 07 30_17 41 12

@yannlemos: "We used ImGui to create the in-game developer console for Extremely Powerful Capybaras. "
"We use the C# bindings provided by uimgui to use it inside Unity. Love ImGui, thanks for the effort!!"
📺 Video link: https://github.com/ocornut/imgui/assets/16945950/44e65ba6-b836-4353-91df-582b22ebe121
345857083-44e65ba6-b836-4353-91df-582b22ebe121 mp4_snapshot_00 16_ 2024 07 30_17 40 05

@ypujante "_Announcing the release of WebGPU Shader Toy, a free tool that you can access in your browser.
There is a video demonstrating several of the features
WebGPU Shader Toy - Automatic

@baderouaich "Enigma, A Simple, Reliable and Efficient Encryption Tool"
https://github.com/baderouaich/Enigma
My-Encryptions-Demo

splatviz by @Florian-Barthel
https://github.com/Florian-Barthel/splatviz
teaser

Openthesia: customizable midi visualization software kinda like Synthesia for Windows by @ImAxel0
Built using ImGui.NET wrapper.
https://openthesia.pages.dev/
📺 Video link: https://github.com/user-attachments/assets/b59182de-f99f-442c-a163-2bdb027330b0
openthesia

@thedmd: "I took a swing at Wave Function Collapse. Once again Dear ImGui did heavy lifting by showing how internals does tick."
📺 Video link: https://github.com/user-attachments/assets/8c6894f9-edd4-49f4-8cdc-0163d72479f7
thedmd Capture

@alien-brother: "A synthesizer plugin I'm working on - https://sr.ht/~alien-brother/still.
ImGui is one of the few UI frameworks that works well in a plugin - links statically and does not want to own the event loop."

screenshot


Also see previous releases details.
Note that GitHub are now clamping release notes sometimes really badly, click on a header/title to read full notes.

Dear ImGui is funded by your contributions and needs them to sustain and grow. We can invoice and accommodate to many situations.
If your company uses Dear ImGui, please reach out (omar AT dearimgui DOT com). See Funding/Sponsors page. Did you know? If you need an excuse to pay, you may buy licenses for Test Engine and that will contribute to fund Dear ImGui.

Don't miss a new imgui release

NewReleases is sending notifications on new releases.