omar/imgui: Release v1.40
Short version: added stacked popups, menus, menu bars, menu items + a handful of other features and fixes. Long version below the images.
NB: The BeginPopup() API (introduced in 1.37) had to be changed to allow for stacked popups and menus. Use OpenPopup() to toggle the opened state and BeginPopup() to append.
_NB: The third parameter of Button(), 'repeat_if_held' has been removed. While it's been very rarely used, some code will possibly break if you didn't rely on the default parameter. Use PushButtonRepeat()/PopButtonRepeat() to configure repeat._
Bonus unrelated screenshot
- Menus: Added a menu system! Menus are typically populated with menu items and sub-menus, but you can add any sort of widgets in them (buttons, text inputs, sliders, etc.). (#126)
- Menus: Added MenuItem() to append a menu item. Optional shortcut display, acts a button & toggle with checked/unchecked state, disabled mode. Menu items can be used in any window.
- Menus: Added BeginMenu() to append a sub-menu. Note that you generally want to add sub-menu inside a popup or a menu-bar. They will work inside a normal window but it will be a bit unusual.
- Menus: Added BeginMenuBar() to append to window menu-bar (set ImGuiWindowFlags_MenuBar to enable).
- Menus: Added BeginMainMenuBar() helper to append to a fullscreen main menu-bar.
- Popups: Support for stacked popups. Each popup level inhibit inputs to lower levels. The menus system is based on this. (#126).
- Popups: Added BeginPopupContextItem(), BeginPopupContextWindow(), BeginPopupContextVoid() to create a popup window on mouse-click.
- Popups: Popups have borders by default (#197), attenuated border alpha in default theme.
- Popups & Tooltip: Fit within display. Handling various positioning/sizing/scrolling edge cases. Better hysteresis when moving in corners. Tooltip always tries to stay away from mouse-cursor.
- Added ImGuiStorage::GetVoidPtrRef() for manipulating stored void*.
- Added IsKeyDown() IsMouseDown() as convenience and for consistency with existing functions (instead of reading them from IO structures).
- Added Dummy() helper to advance layout by a given size. Unlike InvisibleButton() this doen't catch any click.
- Added configurable io.KeyRepeatDelay, io.KeyRepeatRate keyboard and mouse repeat rate.
- Added PushButtonRepeat() / PopButtonRepeat() to enable hold-button-to-repeat press on any button. Removed the third 'repeat' parameter of Button().
- Added IsAnyItemHovered() helper.
- Added GetItemsLineHeightWithSpacing() helper.
- Added ImGuiListClipper helper for clipping large list of evenly sized items, to avoid using CalcListClipping() directly.
- Renamed IsRectClipped() to !IsRectVisible() for consistency (opposite return value!). Kept inline redirection function (will obsolete)
- Renamed GetWindowCollapsed() to IsWindowCollapsed() for consistency. Kept inline indirection function (will obsolete).
- Separator: within group start on group horizontal offset. (#205)
- InputText: Fixed incorrect edit state after text buffer is appended to by user via the callback. (#206)
- InputText: CTRL+letter-key shortcuts (e.g. CTRL+C/V/X) makes sure only CTRL is pressed. (#214)
- InputText: Fixed cursor generating a zero-width wireframe rectangle turning into a division by zero (would go unnoticed unless you trapped exceptions).
- InputFloatN/InputIntN: Flags parameter added to match scalar versions. (#218)
- Selectable: Horizontal filling not declared to ItemSize() so Selectable(),SameLine() works and we can better auto-fit the window.
- Selectable: Handling text baseline alignment for line that aren't of text height.
- Combo: Empty label doesn't add ItemInnerSpacing alignment, matching other widgets.
- EndGroup: Carries the text base offset from the last line of the group (sort of incorrect but better than nothing, should use the first line of the group, will implement in the future).
- Columns: distinguish columns-set ID from other widgets as a convenience, added asserts and sailors.
- Listbox: ListBox() function only use public API to encourage creating custom versions. ListBoxHeader() can return false.
- Listbox: Uses ImGuiListClipper and assume items of matching height, so large lists can be handled.
- Plot: overlay label clipped within frame when not fitting.
- Window: Added ImGuiSetCond_Appearing to test the hidden->visible transition in SetWindow***/SetNextWindow*** functions.
- Window: Autofitting cancel out one worth of vertical spacing for vertical symmetry (like what group and tooltip do).
- Window: Default item width for auto-resizing windows expressed as a factor of font height, scales better with different font.
- Window: Fixed auto-fit calculation mismatch of whether a scrollbar will be added by maximum height clamping. Also honor NoScrollBar in the case of height clamping, not adding extra horizontal space.
- Window: Hovering require to hover same child window. Reverted 860cf57 (December 3). Might break something if you have childs overlapping items in parent window.
- Window: Fixed appending multiple times to an existing child via multiple BeginChild/EndChild calls to same child name. Allows a simple form of out-of-order appending.
- Window: Fixed auto-filling child window using WindowMinSize at their minimum size, irrelevant.
- Metrics: Added io.MetricsActiveWindows counter. (#213.
- Metrics: Added io.MetricsAllocs counter (number of active memory allocations).
- Metrics: ShowMetricsWindow() shows popups stack, allocations.
- Style: Added style.DisplayWindowPadding to prevent windows from reaching edges of display (similar to style.DisplaySafeAreaPadding which is still in effect and also affect popups/tooltips).
- Style: Removed style.AutoFitPadding, using style.WindowPadding makes more sense (the default values were already the same).
- Style: Added style.ScrollbarRounding. (#212)
- Style: Added ImGuiCol_TextDisabled for disabled text. Added TextDisabled() helper.
- Style: Added style.WindowTitleAlign alignment options, to e.g. center title on windows. (#222)
- ImVector: tweak growth strategy, matches vector from VS2010.
- ImFontAtlas: Added ClearFonts(), making the different clear funcs more explicit. (#224)
- ImFontAtlas: Fixed appending new fonts without clearing existing fonts. Clearing input data left to application. (#224)
- ImDrawList: Merge draw command better, cases of multiple Begin/End gets merged properly.
- Store common stacked settings contiguously in memory to avoid heap allocation for unused features, and reduce cache misses.
- Shutdown() tests for g.IO.Fonts not being NULL to ease use of multiple ImGui contexts. (#207)
- Added IMGUI_DISABLE_OBSOLETE_FUNCTIONS define to disable the functions that are meant to be removed.
- Examples: Added ? marks with tooltips next to various widgets. Added more comments in the demo window.
- Examples: Added Menu-bar example.
- Examples: Added Simple Layout example.
- Examples: AutoResize demo doesn't use TextWrapped().
- Examples: Console example uses standard malloc/free, makes more sense as a copy & pastable example.
- Examples: DirectX9/11: Fixed key mapping for down arrow.
- Examples: DirectX9/11: hide os curosr if ImGui is drawing it. (#155)
- Examples: DirectX11: explicitly set rasterizer state.
- Examples: OpenGL3: Add conditional compilation of forward compat as required by glfw on OSX. (#229)
- Fixed build with Visual Studio 2008 (possibly earlier versions as well).
- Other fixes, comments, tweaks.