Commit Graph

2197 Commits

Author SHA1 Message Date
ocornut 430c05991c Docs: added more detailed information about UTF-8 encoding.
+ Revert mistakenly committed Win32+DX11 main.cpp from last commit.
2023-05-10 12:54:51 +02:00
ocornut 0397321be0 Debug Tools: Added 'io.ConfigDebugIgnoreFocusLoss' option. (#4388, #4921) 2023-05-09 20:28:08 +02:00
ocornut 6656553fa4 Nav: Record/restore preferred position on each given axis.
Tagging #6344 #6003 #2694 #1688 as it relates to scoring, however this doesn't technically fix any of them fully yet.
But e.g. once we restore axial path for #2694 this commit will allow going back and forth to initial location.
2023-05-09 17:26:27 +02:00
ocornut 6cdedf5834 Drag, Sliders: if the format string doesn't contain any %, when using CTRL+Click to input we use a default format. (#6405) 2023-05-09 12:04:04 +02:00
Koostosh fd943182bd ImVec2: Added unary minus operator (#6368) 2023-04-25 16:24:50 +02:00
ocornut d3ad2f357f Menus: Fixed an issue when opening a menu hierarchy in a given menu-bar would allow opening another via simple hovering. (#3496, #4797)
Amend 48f26333
2023-04-25 12:17:37 +02:00
ocornut 4d42450a73 Focus: amend ImGuiFocusRequestFlags_UnlessBelowModal to bring to front-most below the modal, simplify code in Begin(). (#6357, #4317) 2023-04-21 19:07:45 +02:00
ocornut 00d3f9295e Nav: Fixed navigation within tables/columns where item boundaries goes beyond columns limits. (#2221) 2023-04-20 16:42:52 +02:00
ocornut 064153fca4 Version 1.89.6 WIP 2023-04-17 14:40:00 +02:00
ocornut 1ebb913827 Version 1.89.5 2023-04-13 16:17:49 +02:00
ocornut 47a07d8476 ButtonBehavior: Fixed an edge case where changing widget type/behavior while active and using same id could lead to an assert. (#6304)
+ Demo: use BeginDisabled() block in BackendFlags section.
I'd still consider this undefined behavior as some combination may not work properly, but let's fix things while we can as we encounter them.
2023-04-05 18:34:49 +02:00
ocornut c9fe7ebc7b IO: Input queue trickling adjustment for touch screens. (#2702, #4921)
+ amend two comments in imgui.h
2023-04-04 21:05:27 +02:00
ocornut a16f99c6a2 IO: Added io.AddMouseSourceEvent() and ImGuiMouseSource enum. (#2702, #2334, #2372, #3453, #5693) 2023-04-04 20:18:57 +02:00
ocornut 9a1e09eb1f Fixed ImVec2 operator[] warning.in Clang. (#6272)
Added by a38e3c2
2023-04-04 19:26:48 +02:00
ocornut 13931fd851 Redirecting domain name
Tired of paying/maintaining two domains names and .org tend to be fluctuating + changing host company for sponsoring.
2023-04-03 15:07:20 +02:00
ocornut e8206db829 InputText: Fixed crash introduced by 5a2b1e848 (#6292, #4714) 2023-04-02 17:29:56 +02:00
ocornut 84fd0c7ff4 Inputs, IO: record MouseWheelRequestAxisSwap information. Apply in UpdateMouseWheel() before legacy ctrl+wheel. 2023-03-29 17:09:58 +02:00
ocornut a38e3c222f Fixed ImVec2 operator[] violating aliasing rules causing issue with Intel C++ compiler. (#6272)
Note that this is not BayesBug's exact intended solution, so issues would be my responsibility ;)
Amended.
2023-03-29 12:51:41 +02:00
AJ Weeks 821814b450 InputText: Reworked prev/next-word behavior . Include period as delimiter and tweak prev/next words logic. (#6067) 2023-03-22 20:48:47 +01:00
ocornut 89d09070e3 Nav: Made Ctrl+Tab/Ctrl+Shift+Tab windowing register ownership to held modifier. (#4828, #3255, #5641) 2023-03-22 15:42:14 +01:00
ocornut e55a0ef107 IO: avoid changing context in AddKeyAnalogEvent(). Amend 7269498. (#6199, #6256, #4921, #5856) 2023-03-21 14:32:37 +01:00
ocornut 5a2b1e8482 InputText: Fixed a tricky edge case, ensuring value is always written back on the frame where IsItemDeactivated() returns true (#4714)
Altered ItemAdd() clipping rule to keep previous-frame ActiveId unclipped to support that late commit.

Also, MarkItemEdited() may in theory need to do:
if (g.ActiveIdPreviousFrame == id)
        g.ActiveIdPreviousFrameHasBeenEditedBefore = true;
But this should already be set so not adding now.
2023-03-16 21:12:57 +01:00
ocornut 24a44b9abe Version 1.89.5 WIP 2023-03-15 12:25:20 +01:00
ocornut f3f6295d53 Version 1.89.4
Commented out obsolete enums/functions names: ImGuiSliderFlags_ClampOnInput, ImGuiInputTextFlags_AlwaysInsertMode, ImDrawList::AddBezierCurve(), ImDrawList::PathBezierCurveTo()()
2023-03-14 16:36:19 +01:00
ocornut cc2177de15 Debug Tools: Added io.ConfigDebugBeginReturnValueOnce / io.ConfigDebugBeginReturnValueLoop options. 2023-03-14 15:25:13 +01:00
ocornut c426e32247 Tables: Fixed an issue where user's Y cursor movement within a hidden column would have side-effects.
- Afaik the "to allow ImGuiListClipper to function" was added early during Tables development (prior to commit 55) and later replaced by support in ImGuiListCipper, it seems unnecessary.
- Also removed RowPosY2 being accted in TableEndCell().
+ Comments about 2bb9e35 + fix example bb224c8
2023-03-13 16:26:38 +01:00
ocornut 2bb9e35a48 Nav: Tabbing now cycles through all items when ImGuiConfigFlags_NavEnableKeyboard is set. (#3092, #5759, #787) 2023-03-10 18:35:52 +01:00
ocornut e83fb468c6 Renamed PushAllowKeyboardFocus()/PopAllowKeyboardFocus() to PushTabStop()/PopTabStop(). (#3092) 2023-03-09 18:53:57 +01:00
ocornut 3b2f617652 BeginTooltip: Added 'bool' return value to BeginTooltip() for API consistency. Updated demo.
Add SetWindowHiddendAndSkipItemsForCurrentFrame().
2023-03-09 15:16:40 +01:00
Marc Delorme c8ad25caa6 Make classes not depend on the implicit GImGui context (#5856, #6199): ImGuiWindow, ImGuiInputTextCallbackData, ImGuiListClipper, ImGuiStackSizes
This commit is a preparation toward adding ImGui apis with explicit context
and making ImGui applications being able to use multiple context at the same time
whatever their concurrency model.

This commit modifies ImGuiInputTextCallback, ImGuiListClipper and ImGuiStackSize so those classes do not to depend on GImGui context anymore.

About ImGuiInputTextCallback:
- ImGuiInputTextCallback depends on ImGuiContext because it has a
  `InsertChars` method adding character to `g.InputTextState`
- To make ImGuiInputTextCallback aware of which context to use, the
  appropriate context is given as argument of ImGuiInputTextCallback
  constructor.

About ImGuiListClipper:
- ImGuiListClipper apply to a context through its `Begin`, `End`, and `Step`
  method.
- To make ImGuiListClipper aware of which context to use, the
  appropriate context is given as argument of ImGuiListClipper
  constructor.
- Since the behavior is different than previously the class has been
  renamed ImGuiListClipperEx
- In order to preserve backward compatibility, a subclass of ImGuiListClipperEx
  named ImGuiListClipper has been defined and forward the implicit context
  to ImGuiListClipperEx parent.

About ImGuiTextFilter:
- ImGuiTextFilter depends on the implicit context because the Draw(..)
  method call ImGui::InputText(...)
- Instead from that commit the Draw(...) method takes an explicit context
  as first argument
- Since the behavior is different than previously the class has been
  renamed ImGuiTextFilterEx
- In order to preserve backward compatibility, a subclass of ImGuiTextFilterEx
  named ImGuiTextFilter has been defined. This subclass has a draw method
  override which and forward the implicit context to the parent class Draw(...)

About ImGuiStackSizes:
- ImGuiStackSizes was depending on ImGuiContext because of its
  `SetToCurrentState` and `CompareWithCurrentState` method
- ImGuiStackSizes is an helper object use
  for comparing state of context. It does not necessarily need to
  compare the same context. For that reason, as opposed to previous
  classes it takes the context it wants to compare to as argument of
  its method.
- For this occasion `SetToCurrentState` and `CompareWithCurrentState`
  have been renamed `SetToContextState` and `CompareWithContextState`
  to match the new method signature.

ImGuiListClipper

ImGuiInputTextCallbackData
2023-03-08 15:55:38 +01:00
Marc Delorme 10ace228bc Make classes not depend on the implicit GImGui context (#6199, #5856, #6199): ImGuiIO
This commit is a preparation toward adding ImGui apis with explicit context
and making ImGui applications being able to use multiple context at the same time
whatever their concurrency model.

About ImGuiIO:
- ImGuiIO depends on ImGuiContext because some of its method want to event to `g.InputEventQueue`.
- To make ImGuiIO aware of the context to use, context which creates the ImGuiIO is given as argument of ImGuiIO constructor.
- The assert `IM_ASSERT(&g.IO == this && "Can only add events to current context.")` has been removed since it does not make sense anymore

NOTE: ImGuiIO could be completely independent of ImGuiContext if the InputEventQueue was moved from ImGuiContext to ImGuiIO, but since
ImGuiIO is a public class it would expose InputEvent type. Solving this problem is out of the current scope, but it is interesting to notice.
2023-03-08 15:39:22 +01:00
ocornut c9a53aa74d Nav: Made Enter key submit the same type of Activation event as Space key. (#5606)
Instead of adding NavActivateInputId support in ButtonBehavior() started untangling the mess.
2023-03-07 18:41:49 +01:00
ocornut b6586bb06d TestEngine: update IMGUI_TEST_ENGINE_ITEM_ADD() hooks to support passing item in flags. 2023-03-06 18:10:04 +01:00
ocornut bfce7750b1 Simpified code in GetKeyData() and used ImGuiKey_KeysData_OFFSET for consistency. Rework demo, Comments. Moved ImGuiKey_KeysData_OFFSET to internal.h (#4921, #6191) 2023-02-24 13:05:32 +01:00
ocornut e9743d85dd Drag and Drop: Clear state on EndDragDropTarget() with delivery + fixed handling of overlapping targets when smaller one is submitted before and can accept the same data type. (#6183, #5817) 2023-02-21 21:23:54 +01:00
ocornut a1b8457cb5 Moved the optional "courtesy maths operators" (#define IMGUI_DEFINE_MATH_OPERATORS) implementation from imgui_internal.h in imgui.h. (#6164, #6137, #5966, #2832) 2023-02-15 19:23:12 +01:00
ocornut 204cb4d226 Version 1.89.4 WIP 2023-02-15 15:35:56 +01:00
ocornut 458a109031 Version 1.89.3 2023-02-14 16:00:18 +01:00
ocornut 092b6825ac Fonts: Assert that in each GlyphRanges[] pairs first is <= second. 2023-02-14 15:00:12 +01:00
ocornut 99c0bd65df Added SeparatorText() widget. (#1643) 2023-02-10 12:16:41 +01:00
ocornut f799a293c8 Tables: Solved an ID conflict issue with multiple-instances of a same table. Storing instance id for convenience. (#6140)
TableGetColumnResizeID() are still using an incorrect table, but having only one-level left tends to cancel things out.
2023-02-03 20:03:03 +01:00
ocornut 3617a96372 Backends, Inputs: Made horizontal scroll wheel and horizontal scroll direction consistent accross backends/os. (#4019, #6096, #1463)
Documented assumptions.
2023-02-01 21:29:08 +01:00
ocornut 867bdbecb3 Text: fixed issue in RenderText() leading to IM_ASSERT_PARANOID() triggering if enabled. (#6132, #5720, #5919)
Amend 3482d4ec, bd96f6e
2023-01-31 14:41:16 +01:00
ocornut 5741cbae45 Internals: ImFileOpen: fixed misleading use of ImWchar (would allocate more when ImWchar=ImWchar32) + update version for previous changes namely tab bar ones. 2023-01-25 20:34:48 +01:00
ocornut 91667430a8 Tables: increase table columns limit from 64 to 512 using bit array allocated in contiguous memory +. (#6094, #5305, #4876, #3572) 2023-01-21 00:41:54 +01:00
ocornut 3482d4eccf Text: Fixed layouting of wrapped-text block skipping successive empty lines. (#5720, #5919)
Regression in the bd96f6e fix
2023-01-19 15:59:39 +01:00
ocornut 1297a2be52 Text: Tweaked rendering of three-dots "..." ellipsis variant. Baking more data. (#2775, #4269)
Ideally we're bake a single glyph but it's currently difficult to setup in our font building process.
2023-01-11 16:37:47 +01:00
ocornut 482ac70a0b Version 1.89.3 WIP 2023-01-11 15:52:30 +01:00
ocornut d7c8516a4b Version 1.89.2 2023-01-05 15:49:29 +01:00
ocornut e06bbe05e1 Revert most/part of "Shortcut: added Shortcut() function and ImGuiInputFlags in public API + Demo." (#456, #2637)
This reverts commit 0949acb6e6.

# Conflicts:
#	imgui.h
2023-01-05 15:21:48 +01:00
ocornut 57a5b73a4c InputText: fixed cursor navigation when pressing Up Arrow on the last character of a multiline buffer which doesn't end with a carriage return. (#6000)
Simplify stb_textedit_find_charpos(). Leaving that to simmer for a while before attempting an upstream PR.
2023-01-04 17:58:07 +01:00
ocornut 4b39c1f654 Docs: adding Tests badge + more references to Test Engine. 2023-01-03 20:26:26 +01:00
ocornut 59b63defe5 Misc shallow merge/sync from docking designed to faciliate cross-merging between docking and string_view. 2022-12-08 21:14:39 +01:00
ocornut 0949acb6e6 Shortcut: added Shortcut() function and ImGuiInputFlags in public API + Demo. (#456, #2637) 2022-12-08 18:54:41 +01:00
ocornut 1dae7df26f Misc: added GetItemID() in public API. 2022-12-08 18:45:04 +01:00
ocornut 48215231f9 Demo: moved WantCapture overrides items + various comments related to ImGuiKey, ImGuiMod 2022-12-08 18:30:48 +01:00
ocornut fd0b3734d3 Tables, Nav, Scrolling: fixed scrolling functions and focus tracking with frozen rows and columns. (#5143, #4868, #3692) 2022-12-06 21:07:50 +01:00
ocornut 0e2a167bdb Fonts: added a 'void* UserData' field in ImFontAtlas, as a convenience for use by applications using multiple font atlases.
+ fixed mislocated Changelog entries added recently.
2022-12-01 20:10:37 +01:00
ocornut 87caf27ac4 Inputs, Scrolling: better selection of scrolling window when hovering nested windows and backend/OS is emitting dual-axis wheeling inputs. (#3795, #4559) 2022-11-30 17:49:59 +01:00
ocornut 1a497c2499 Inputs, IO: reworked ImGuiMod_Shortcut to redirect to Ctrl/Super at runtime instead of compile-time. (#5923, #456) 2022-11-29 19:07:50 +01:00
ocornut bd96f6eac4 Text: Fixed layouting of wrapped-text block when the last source line is above the clipping region. Regression added in 1.89. (#5720, #5919)
+ Update version marker
2022-11-28 14:59:13 +01:00
ocornut 6af38b1a43 Fixed version string for consistency (#5918) 2022-11-28 14:42:30 +01:00
ocornut a8df192df0 Version 1.89.1 2022-11-24 21:24:33 +01:00
ocornut 27c58c3946 Scrolling, Focus, Combo: fixed SetKeyboardFocusHere()/SetItemDefaultFocus()/ScrollToRectEx() during an appearing form not centering item. (#5902, #2812, #4242, #2900)
Amend 44f801186 and 8f495e554
2022-11-24 20:57:41 +01:00
ocornut 3a685749cb ColorEdit: fixed label overlapping when using style.ColorButtonPosition == ImGuiDir_Left. (#5912)
Amend 54fb051e5
+ Internals: added IsKeyboardKey(), IsMouseKey() helpers.
2022-11-23 15:00:50 +01:00
ocornut 5bb2874940 Version 1.89.1 WIP 2022-11-16 17:55:27 +01:00
ocornut d60985df7f Inputs: fix moving a window or drag and dropping from capture mods. (#5888, #4921, #456)
Amend change of SetActiveIdUsingAllKeyboardKeys() in 4448d97 which seemingly accidentally reverted the change intended by fd408c97
2022-11-16 17:41:24 +01:00
ocornut 83cee9e091 InputText: replaced some uses of SetKeyOwner() + IsKeyPressed() with Shortcut()
Which makes it easier to hook/disable those keys from outside if needed.
2022-11-16 17:09:14 +01:00
ocornut 81160fee56 Version 1.89
+ fix warning from a582d92
2022-11-15 15:20:36 +01:00
ocornut 7380b9816e Scrolling: Exposed SetNextWindowScroll() in public API. (#1526) 2022-11-09 17:03:07 +01:00
ocornut cda26635cd Inputs: refacotr/extract CalcRoutingScore() out of SetShortcutRouting(), easier to follow with early returns.
+ clarified comments about GetMouseCursor() #5739
2022-11-09 16:35:50 +01:00
ocornut 7ff2d3353c Inputs: added wip/experiment routing system: Shortcut(), RoutingFocused policy, SetShortcutRouting(). (#456, #2637, #3724)
- InputText() uses Shortcut().
2022-11-08 20:37:58 +01:00
ocornut 4448d975d1 Inputs: added wip/internal Input Owner system. (#456, #2637, #2620, #2891, #3370, #4828, #5108, #5242, #5641)
- Added SetKeyOwner(), SetItemKeyOwner(), TestKeyOwner().
- Added new IsKeyXXX IsMouseXXX functions with ImGuID owner_id and flags.
- Obsoleted SetItemUsingMouseWheel(). (#2891)
- Removed IsKeyPresseedEx() which was a recent internal addition 2022-07-08 deemed to be temporary exactly for this.
- Added ImGuiButtonFlags_NoSetKeyOwner, ImGuiButtonFlags_NoTestKeyOwner
- Added ImGuiSelectableFlags_NoSetKeyOwner.
- Added ImGuiInputFlags_LockThisFrame, ImGuiInputFlags_LockUntilRelease for for SetKeyOwner(), SetItemKeyOwner().
- Added ImGuiInputFlags_CondXXX values for SetItemKeyOwner().
2022-11-08 18:47:36 +01:00
ocornut 9f66a3a9ed Internals: rework FocusScope system, current scope doesn't need to be in window + child doesn't inherit.
Intended as part of work for input routing + blind menu processing shortcuts. Some of this commit will be stripped by next commit.
Intent was to sort windows along with focus scope to build a hierarchy, but for our needs we'd need a persistant one, so scrapping the idea. Not squashing this with next commit to keep a bit of history for future references.
2022-11-04 12:19:20 +01:00
ocornut 6e9dfe1de1 Window: Auto-fit size takes account of work rectangle (menu bars eating from viewport). (#5843) 2022-11-02 12:36:22 +01:00
ocornut a61bbdc239 Commented out redirecting OpenPopupContextItem() which was briefly the name of OpenPopupOnItemClick() from 1.77 to 1.79. 2022-10-26 22:22:53 +02:00
ocornut 9a35bfea39 Internals: added temporary ImGuiItemStatusFlags_Visible (used internally - please do not use).
Used by BeginMenu() as I'm experimenting with blind menus honoring shortcuts.
Extra comments about KeyMap and ImGuiKeys
2022-10-21 14:57:10 +02:00
ocornut e3fa56ae05 BeginMenu(): Menus: Fixed a one-frame issue where SetNextWindowXXX data are not consumed by a BeginMenu().
+ Shallow tweaks to reduce diff of future branches. Removing early return also facilitate some changes.
2022-10-19 14:12:04 +02:00
ocornut 5ac94ad898 Window: Fixed an issue where uncollapsed a window would show a scrollbar for a frame.
Amend / fix regression from 6e8e2c0
2022-10-18 16:43:38 +02:00
ocornut 81176737f8 Menus: Fixed using IsItemHovered()/IsItemClicked() on BeginMenu(). (#5775) 2022-10-14 17:39:04 +02:00
ocornut 3920b1c764 Removed commented out old flags from when Tables was a branch.
ImGuiTableFlags_ColumnsWidthFixed, ImGuiTableFlags_ColumnsWidthStretch,
ImGuiTableFlags_SizingPolicyFixed, ImGuiTableFlags_SizingPolicyStretch
ImGuiTableColumnFlags_WidthAuto
2022-10-14 16:36:41 +02:00
ocornut b15347cb7d Tables: activating an ID (e.g. clicking button inside) column doesn't prevent columns output flags from having ImGuiTableColumnFlags_IsHovered set. (#2957) 2022-10-13 15:15:42 +02:00
ocornut 3e8d198133 Removed runtime patching of obsolete/invalid "%f"/"%.0f" types of format strings for DragInt()/SliderInt(). 2022-10-12 23:09:09 +02:00
ocornut f2a522d70d ImDrawList: Not using alloca() anymore, lift single polygon size limits. (#5704, #1811) 2022-09-30 15:58:55 +02:00
ocornut cc5058e5d7 IO: Filter duplicate input events during the AddXXX() calls. (#5599, #4921) 2022-09-29 22:01:11 +02:00
ocornut bd2355a047 Menus, Nav: Fixed using left/right navigation when appending to an existing menu (multiple BeginMenu() call with same names). (#1207) 2022-09-29 19:25:26 +02:00
ocornut 3532ed1621 Menus, Nav: Fixed keyboard/gamepad navigation occasionally erroneously landing on menu-item in parent when the parent is not a popup. (#5730)
Replace BeginMenu/MenuItem swapping g.NavWindow with a more adequate ImGuiItemFlags_NoWindowHoverableCheck.
Expecting more subtle issues to stem from this.
Note that NoWindowHoverableCheck is not supported by IsItemHovered() but then IsItemHovered() on BeginMenu() never worked: fix should be easy in BeginMenu() + add test is IsItemHovered(), will do later
2022-09-29 18:44:19 +02:00
Andrew D. Zonenberg e74a50f525 Added GetGlyphRangesGreek() helper for Greek & Coptic glyph range. (#5676, #5727) 2022-09-28 17:46:20 +02:00
ocornut d17627b9c6 InputText: leave state->Flags uncleared for the purpose of backends emitting an on-screen keyboard for passwords. (#5724) 2022-09-28 17:38:41 +02:00
ocornut 4d4889bf1b Refactor CalcWordWrapPositionA() to take on the responsability of minimum character display. Add CalcWordWrapNextLineStartA(), simplify caller code.
Should be no-op but incrementing IMGUI_VERSION_NUM just in case.
Preparing for #5720
2022-09-28 14:57:15 +02:00
ocornut 12c0246890 Removed support for 1.42-era IMGUI_DISABLE_INCLUDE_IMCONFIG_H / IMGUI_INCLUDE_IMCONFIG_H. (#255) 2022-09-28 12:08:21 +02:00
ocornut a725db17b7 Comments for flags discoverability + add to debug log (#3795, #4559) 2022-09-27 20:08:40 +02:00
ocornut 83a0030c0a Added ImGuiMod_Shortcut which is ImGuiMod_Super on Mac and ImGuiMod_Ctrl otherwise. (#456) 2022-09-26 10:43:26 +02:00
ocornut fd408c9790 Renamed and merged keyboard modifiers key enums and flags into a same set:. ImGuiKey_ModXXX -> ImGuiMod_XXX and ImGuiModFlags_XXX -> ImGuiMod_XXX. (#4921, #456)
Changed signature of GetKeyChordName() to use ImGuiKeyChord.
Additionally SetActiveIdUsingAllKeyboardKeys() doesn't set ImGuiKey_ModXXX but we never need/use those and the system will be changed in upcoming commits.
2022-09-26 10:43:26 +02:00
ocornut f359dca0dc Misc input related changes to facilitate upcoming merges. 2022-09-22 19:00:30 +02:00
ocornut 85f327d8d3 InputText: added ImGuiInputTextFlags_EscapeClearsAll (#5688) 2022-09-21 16:23:44 +02:00
ocornut 4b522e145c Experiment: ImGuiKey is now a typed enum, allowing ImGuiKey_XXX symbols to be named in debuggers. (#4921, #4537)
May affect binding generators.
2022-09-20 12:42:29 +02:00
ocornut 1dd964f87d Popups & Modals: Fix (amended) somehow undocumented Popup+Child behavior (useful for e.g. #718, #4461 and probably other things)
(broken by 1c4066cd)
2022-09-16 23:27:16 +02:00
ocornut 440f257688 Popups & Modals: fixed nested Begin() being erroneously input-inhibited. (useful for e.g. #718, #4461 and probably other things) 2022-09-16 22:08:11 +02:00
ocornut 472f8013bd Moved version number higher up in imgui.h to increase visibility
- This allow using version number in imconfig
- This technically makes the #ifdef IMGUI_VERSION check valid in case of using IMGUI_DISABLE
- This makes available IMGUI_VERSION/IMGUI_VERSION_NUM with IMGUI_DISABLE - bit of a harmless leak
2022-09-16 22:07:33 +02:00
tocic 6c3c9cea7f Fix typos in source comments (#5675) 2022-09-13 11:09:34 +02:00
ocornut 513c1ba996 Removed the bizarre legacy default argument for 'TreePush(const void* ptr = NULL)' (#1057)
Followup to e605f2179
2022-09-12 16:00:19 +02:00
ocornut 52d9ee0dc2 Tabs: Fixed ShrinkWidths() redistribution of remainder leading to infinite bug (second fix). (#5652, #5262)
Amend b137f31
2022-09-09 20:01:59 +02:00
ocornut b137f31b8c Tabs: Fixed ShrinkWidths() redistribution of remainder leading to infinite bug + over redistribution. (#5652)
Amend c4b91017
2022-09-07 12:22:49 +02:00
Constantine Tarasenkov b87e58fab3 ImGui::InputText: added support for shift+click style selection. (#5619)
(Amend, force-push: sorry wrong edit by omar)
2022-09-05 18:27:58 +02:00
ocornut 9e1ccf8fab Commented out redirecting functions/enums names that were marked obsolete in 1.77 and 1.78 (June 2020): (#3361)
- DragScalar(), DragScalarN(), DragFloat(), DragFloat2(), DragFloat3(), DragFloat4() with signature ending with (..., float power = 1.0f)
- SliderScalar(), SliderScalarN(), SliderFloat(), SliderFloat2(), SliderFloat3(), SliderFloat4() with signatures ending with (..., float power = 1.0f)
- BeginPopupContextWindow(const char*, ImGuiMouseButton, bool)
2022-09-05 14:38:00 +02:00
ocornut edcd5b113e Obsoleted using SetCursorPos()/SetCursorScreenPos() to extend parent window/cell boundaries. (#5548)
This incorrect pattern has been mentioned or suggested in: #4510, #3355, #1760, #1490, #4152, #150
2022-09-02 16:37:35 +02:00
Rokas Kupstys b3ea01d86f Menus: Fix sub-menu inhibition stopping working in some cases. (Amend WIP) (#2517, #5614, noticed in #5546)
Amend bda2cde6
Fixes the case where following menu hover sequence results in incorrect RestoreNavWindow (previously SourceWindow) pointing to opened sub-menu:
1. Hover "Menu -> Options" - Open ##Menu_01 window
2. Hover "Menu -> Colors"  - SourceWindow incorrectly points to ##Menu_01 window
2022-09-01 17:02:46 +02:00
ocornut a502ceb075 Added commented out older obsolete names (1.42 to 1.52) 2022-09-01 12:22:39 +02:00
ocornut 2569c64740 Demo: Improved "Constrained-resizing window" example, more clearly showcase aspect-ratio. (#5627, #5618) 2022-09-01 11:13:39 +02:00
ocornut 747c9a7adf IsKeyPressed(), IsMouseClicked(), GetKeyPressedAmount(): add a (normally unnecessary) test for ->Down next to ->DownDuration tests, facilitating the use of key eating mechanism.
Consider removing when we add support for input ownership.
2022-08-31 19:15:13 +02:00
ocornut e13913ed57 IsItemHovered: Added ImGuiHoveredFlags_DelayNormal, ImGuiHoveredFlags_DelayShort, ImGuiHoveredFlags_NoSharedDelay. (#1485)
IsItemHovered() can't have a non-zero default, but higher-level tooltip helpers may enable a different default later.
2022-08-24 21:32:13 +02:00
ocornut b3b3a07133 Nav: Fixed regression in e99c4fc preventing CTR+Tab to work without NavEnableKeyboard (#5504, #4023); 2022-08-24 14:45:11 +02:00
Geoffrey McRae 2c1262b436 ImVector: fix undefined behaviour during copy operator if source vector is null. (#5608) 2022-08-24 10:57:14 +02:00
ocornut 5b0510c5b7 TestEngine: facilitate aiming at InputScalar() using wildcards + removed unnecessary IDStack.size hack (require TestEngine latest) 2022-08-20 22:55:51 +02:00
Vlad Serebrennikov c911901b5e
Fix ImGuiIO docs and default values (#5540) 2022-08-03 22:46:31 +02:00
ocornut 0a4ddd7246 Fix being unable to mouse wheel while dragging a payload (fix 1480bc5, #4921, #2891) 2022-08-03 22:02:00 +02:00
ocornut 4a2ae06ca4 Changed signature of ImageButton() function: Added 'const char* str_id' parameter + removed 'int frame_padding = -1' parameter. (#5533, #4471, #2464, #1390).
Also removed frame_padding parameter from ImageButtonEx(), amend e0ec69d8.
2022-08-03 21:04:33 +02:00
Rokas Kupstys 0e95cf0dec Fix appending to windows causing a child window to be inserted to g.WindowsFocusOrder which eventually causes a crash. (#5515, #3496, #4797)
Amend a528398
2022-08-03 14:44:05 +02:00
ocornut 6ab5fd1da9 Tables,Columns: fixed a layout issue where SameLine() prior to a row change would set the next row in such state where subsequent SameLine() would move back to previous row. 2022-07-18 17:40:52 +02:00
ocornut 1480bc5d4e Added ImGuiKey_MouseXXX aliases. (#4921) Reworked SetItemUsingMouseWheel() to use this for ActiveId. (#2891)
The rework of SetItemUsingMouseWheel() is half-complete since there's a HoveredIdUsingMouseWheel component. This will however be totally cleaned when we transtion to InputOwner system.
2022-07-08 18:32:25 +02:00
ocornut 105bb3ef8a Legacy: clear g.ActiveIdUsingNavInputMask when active id is clear + Internals: added helpers GetKeyChordName(), ImGuiModFlags_All.
Amend 8b8a61b
2022-07-08 17:51:46 +02:00
ocornut 8b8a61bdf9 Removed io.NavInputs[] and ImGuiNavInput enum. Kept inline redirection code. (#4921, #4858, #787, #1599, #323) 2022-07-08 16:02:07 +02:00
ocornut 92d0924b82 Fixed build with IMGUI_DISABLE_OBSOLETE_KEYIO + made all examples comments refer to StyleColorsLight(). 2022-07-06 20:58:20 +02:00
ocornut 4711b9b05a Add trailing commas to enum (to simplify the diff/patch of further additions) (#4537)
Possible since we are now C++11 + fix warning in GetNavInputAmount().
2022-07-06 20:39:39 +02:00
ocornut 90ef327882 Reordered keys representing directions to follow a consistent L/R/U/D order everywhere. (#2625, #4921, #3724)
Amended to avoid static analysis false positive.
2022-07-06 17:48:01 +02:00
ocornut 467a1cd4a5 Misc: io.Framerate moving average now converge in 60 frames instead of 120. (#5236, #4138) 2022-07-01 17:09:58 +02:00
ocornut 609b935a8c InputText: added experimental io.ConfigInputTextEnterKeepActive feature to make pressing Enter keep the input active and select all text. 2022-06-30 15:47:54 +02:00
ocornut 24dfe6db8a Version 1.89 WIP 2022-06-27 16:55:55 +02:00
ocornut 9aae45eb4a Version 1.88
(fix "Show Debug Log" checkbox in Metrics window)
2022-06-21 18:11:50 +02:00
ocornut d3fd2630b7 Sliders: An initial click within the knob/grab doesn't shift its position. (#1946, #5328) + Adjust default GrabMinSize. 2022-06-20 18:13:10 +02:00
Rokas Kupstys 37a07858a9 Nav: Fixed inability to cancel nav in modal popups. (#5400) 2022-06-17 14:58:26 +02:00
ocornut 07efd7cc20 Renamed IMGUI_DISABLE_METRICS_WINDOW to IMGUI_DISABLE_DEBUG_TOOLS. 2022-06-15 16:02:55 +02:00
ocornut 1d6e34f3f9 Debug: Added ShowDebugLogWindow().
Internal: renamed old IMGUI_DEBUG_LOG() to IMGUI_DEBUG_PRINT().
Amended once.
2022-06-13 19:05:55 +02:00
ocornut 076d8fc868 Nav: Fixed issues with nav request being transferred to another window when calling SetKeyboardFocusHere() and simultaneous changing window focus. (#4449) 2022-06-10 19:25:53 +02:00
ocornut a35e876978 InputText: Amends and tidying up: Fixed undo/redo state corruption when editing buffer in user callback. (#4947, #4949) 2022-06-08 15:27:36 +02:00
ocornut 64d6c30562 InputText: Fixed an undo-state corruption issue when editing buffer before reactivating item. (#4947) + Metrics: Added "InputText" section. 2022-06-07 15:34:21 +02:00
ocornut 74f02703e6 Misc comments + Demo: use IsItemVisible() when using direct ImDrawList calls. 2022-06-07 11:48:05 +02:00
ocornut 65c4c0a490 IO: Added SetAppAcceptingEvents() function (#4921, #4858) 2022-06-02 16:56:00 +02:00
Rokas Kupstys f58bd817e2 Tables: Fix drawcall merging of last column. (#4843, #4844)
Amend 83d22f4e
2022-05-31 14:22:23 +02:00
ocornut 697ce2d67b InputText: Fixed a one-frame display glitch where pressing Escape to revert after a deletion would lead to small garbage being displayed for one frame. (#3008)
Curiously very old, amend 83efdce and bdbb2b2. Using stb_ functions updated ->CurLenA without updating ->TextA, leading to `buf_display_end = buf_display + state->CurLenA;` in the display.
Since f3ab5e62 they are 1 case out of 4 which didn't apply back to ->TextA and this is essentially the one where we ensure appliance. Another solution would be to alter the lower display code, but applying to TextA makes things more consistent.
2022-05-25 18:39:00 +02:00
ocornut 7bf07d2526 Renamed CaptureMouseFromApp() and CaptureKeyboardFromApp() to SetNextFrameWantCaptureMouse() and SetNextFrameWantCaptureKeyboard(). Added demo. (#5304, #4831, #4480, #533) 2022-05-23 11:22:46 +02:00
ocornut e346059eef IO: Fixed input queue trickling of mouse wheel events. (#4921, #4821) 2022-05-18 14:16:02 +02:00
ocornut 9e0517a134 DrawList: Fixed divide-by-zero or glitches with Radius/Rounding values close to zero. (#5249, #5293, #3491)
Amend 8ed34af6f8
2022-05-13 17:19:51 +02:00
ocornut 55f8989392 Docs update, binaries link + Backend: Allegro: fix warning (#5281) 2022-05-04 15:16:05 +02:00
ocornut 6d27fecce1 Debug: added DebugTextEncoding() to help diagnose between text encoding issues and font loading issues. Simplified code + extracted DebugNodeFontGlyph().
Helper to diagnose issues such as #4866, #3558, #3436, #2233, #1880, #1780, #905, #832, #762, #726, #609, #565, #307)
2022-05-03 19:23:54 +02:00
ocornut 3e5dde9a26 Tables: Fixed incorrect auto-fit of parent windows when using non-resizable weighted columns. (#5276) 2022-05-02 16:45:27 +02:00
ocornut 5b29d14783 Layout: Fixed mixing up SameLine() and SetCursorPos() together. SameLine() is a stateful.
+ minor unrelatedcomments.
2022-04-22 17:48:06 +02:00
Andrea Palmatè 14ca75d4e7 Backends: SDL, OpenGL3: Small fixes for AmigaOS4. (#5190) + Allow redefining IM_COL32_XXX layout macros. (#5190, #767, #844) 2022-04-13 20:43:35 +02:00
ocornut 90386780e3 Misc: Fixed calling GetID("label") _before_ a widget emitting this item inside a group (such as InputInt()) from causing an assertion when closing the group. (#5181). 2022-04-12 14:44:57 +02:00
David Maas 937d073328 Updated comment about Edit.NavigateTo to Edit.GoToAll. (#5179)
This command was renamed in Visual Studio 2017.
2022-04-11 17:11:51 +02:00
ocornut f7f30476d5 Added comments about requirement for bilinear filtering. (#5156, #3245) + Backends: SDL_Renderer: Explicitely call SDL_SetTextureScaleMode(). (#4927) 2022-04-07 14:28:08 +02:00
ocornut 2c03aac6d3 Renamed ImGuiKeyModFlags to ImGuiModFlags (Breaking but technically never advertised type) 2022-04-05 15:45:00 +02:00
ocornut c521883be4 Sliders, Drags: Fixed manual input when using hexadecimal display format string. (#5165, #3133)
InputScalar: Fixed manual input when using %03d style width in display format string.
(amended once)
2022-04-04 18:42:04 +02:00
ocornut 508c9aaf60 Sliders, Drags: Fixed using hexadecimal display format strings (pretty much never worked). (#5165, #3133)
Ditched unnecessary code. When transitioning from float in 3e8087458 we added an unnecessary path there, which evolved in c5fb92955.
2022-04-04 14:43:30 +02:00
ocornut f5c5926fb9 Internals: remove obsolete variants of RenderArrow(), RenderBullet(), ImHash() + misc comments. 2022-03-29 15:43:47 +02:00
ocornut 2747a8ca40 Turned ImVec2 to const ref to RenderChar(), RenderText(), ColorButton(), PushClipRect(). for consistency. Comments about polygon filling winding order. 2022-03-29 12:13:31 +02:00
ocornut 0dec430707 Menus: Adjusted BeginMenu() closing logic so hovering void or non-MenuItem() in parent window always lead to menu closure. 2022-03-28 12:33:58 +02:00
ocornut 3587ee492b Viewports: store Viewport field in ImGuiWindow to facilitate using code accross branches + fix PVS warnings. 2022-03-25 15:40:20 +01:00
ocornut 16ddc1698d Fixed creating multiple-context (regression in 28ba54a). (#5135) 2022-03-24 11:01:46 +01:00
ocornut 28ba54a32a Internals: add AddSettingsHandler(), RemoveSettingsHandler(). 2022-03-14 10:23:30 +07:00
ocornut fd06ed833b Misc: tweaks + fix warnings on backends withtout -wno-memaccess (#4995, #5104) 2022-03-13 17:57:32 +07:00
ocornut fa2b318dd6 IO: Fixed input queue trickling of interleaved keys/chars events when InputText() is not active. (#4921, #4858) 2022-02-22 14:36:27 +01:00
ocornut 5659db5529 IO: Fixed backward-compatibility accesses to io.KeysDown[]. (#4921, #4858)
+ Snuck in unrelated comments and removed the "fill once" comment (#5043)
2022-02-21 21:31:01 +01:00
ocornut dca527be1b Clipper: Assert on extraneous calls to Step(). (#4822) + Demo tweak. 2022-02-18 18:40:43 +01:00
ocornut 29d462ebce Set HoveredID even when g.NavDisableMouseHover is set by gamepad/keyboard navigation. This will facilitate the use of future InputOwner API based on HoveredID/ActiveID.
Note that this widen the small gap between polling g.HoveredID and using IsItemHovered() the later does various filtering.
Added IsItemHovered(ImGuiHoveredFlags_NoNavOverride) to disable that specific state redirect/filter.
Side-effect: fix EndGroup() use of combining HoveredId values when gamepad/keyboard nav is active. Unlikely to have user-visible side effect since IsItemHovered() would have filtered out anyway.
Side-effect: fix IsAnyItemHovered() when gamepad/keyboard is active (but this wasn't the primary intent of this change).
Side-effect: fix using SetItemUsingMouseWheel() while hovering an item and gamepad/keyboard is active. (#2891)
2022-02-17 18:39:03 +01:00
ocornut d9e60d29e1 Clipper: Fixed a regresssion when not calling End() + calling End() twice as well. (#4822) 2022-02-17 11:09:06 +01:00
thedmd 5c8f8d0311 ImVector: Fixed erase() with empty range. (#5009) amend/fix b6b8f66
Actual change was missing in b6b8f66
2022-02-16 20:08:58 +01:00
ocornut 2dfa71fad5 Inputs: Fixed IsMouseClicked() repeat mode rate being half of keyboard repeat rate. Using KeyModAlt. Removed KeyModsPrev. 2022-02-16 20:08:58 +01:00
thedmd b6b8f6634e ImVector: Fixed erase() with empty range. (#5009) 2022-02-15 11:16:08 +01:00
Jeff Mears 71f98dd056 Declare ImVec2 and ImVec4 constructors as constexpr (#4995) 2022-02-11 12:27:27 +01:00
thedmd 4691fa0ed5 ImDrawList: PthArcTo: Add small tolerance when comparing angles (#4993) 2022-02-08 17:37:45 +01:00
ocornut 88de982071 Version 1.88 WIP 2022-02-08 14:45:26 +01:00
ocornut 97b1abd6dd Internals: rework RenderMouseCursor() signature so we can use it in docking branch more naturally. 2022-02-08 12:22:46 +01:00
ocornut c71a50deb5 Version 1.87 2022-02-07 18:16:54 +01:00
ocornut 6f73dbea80 TestEngine: submit window data to item system. 2022-02-01 15:20:32 +01:00
Clownacy 422902dbda Correct typos (#4954, #4955), use IM_STATIC_ASSERT now that old pre-C++11 macro has been obsoleted. 2022-01-31 11:58:33 +01:00
ocornut 49e38a5b32 Revert moving ImGuiKeyModFlags to internal.h (amendc906c65) 2022-01-28 15:53:09 +01:00
ocornut c906c65cac (BREAKING) Replaced AddKeyModsEvent() added by 790132a in favor of unified key enum system. Backends: update most. (#4921, #4858)
Sorry this is an unusual breaking but since we are WIP it is a good time to make a correction.
2022-01-27 17:46:48 +01:00
ocornut 8555335935 Shallow alignment of ImGuiKey stuff + moving some in internals. Internals: add offset to ImBitArray<>, simpify ActiveIdUsingKeyInputMask. 2022-01-25 18:11:34 +01:00
ocornut b17b2fb732 Popups: Fixed an issue when reopening a same popup multiple times would offset them by 1 pixel on the right. (#4936)
Passing explicit ImGuiPopupFlags_MouseButtonRight to OpenPopupOnItemClick() calls somehow document the unusual (due to legacy) default value.
2022-01-24 13:24:54 +01:00
sergeyn dd6a44abb1
Fix compiler warning for Intel compiler (#4934) 2022-01-24 12:09:02 +01:00
ocornut 26e59c8742 Nav: Fixed gamepad navigation in wrapping popups not wrapping all the way. (#4365) 2022-01-21 14:41:34 +01:00
ocornut 62d6be3747 IO: Removed ImGuiInputSource from public api for now, unnecessary. (#4858, #787) 2022-01-20 17:39:25 +01:00
ocornut f33bb99821 IO: added AddKeyAnalogEvent() and support for ImGuiKey_GamepadXXXX. (#4858, #787) 2022-01-20 17:24:52 +01:00
Rokas Kupstys 19471da3fd Popups: Fix a crash when a new window is created after a modal on the same frame. (#4920) 2022-01-20 15:03:56 +01:00
ocornut 7ad42ff431 IO: renamed io.ConfigInputEventQueue to io.ConfigInputTrickleEventQueue. (#4858) 2022-01-19 18:45:57 +01:00
ocornut 97b1ffcb3b IO: Reorder enums, compact a little in header. Removed const from internal GetKeyData(). 2022-01-19 15:42:27 +01:00
ocornut 91ae56af45 Removed support for legacy arithmetic operators (+*/) when inputing text into a slider/drag. (#4917, #3184) 2022-01-19 15:10:42 +01:00
ocornut 673f5e588d IO: moved fields to put more focus on the new functions + update misc docs/references + update main.mm in Apple+Metal example (#4858) 2022-01-18 17:41:35 +01:00
ocornut 7374b96f5c IO: Added input queue. (#4858, #2787, #1992, #3383, #2525, #1320) 2022-01-17 17:36:55 +01:00
thedmd b8e56dce83 IO: Added AddMousePosEvent(), AddMouseButtonEvent(), AddMouseWheelEvent() api + updated all Backends. (#4858) (input queue code will be next commit)
Details: note that SDL, OSX and GLFW backends removed recording of MouseJustPressed[] which will be unnecessary with input queue (which is the NEXT commit). (#2787, #1992, #3383, #2525, #1320)
2022-01-17 17:35:37 +01:00
ocornut 92c4ff1c2f Rename ImGuiKey_LeftControl to ImGuiKey_LeftCtrl, ImGuiKey_RightControl to ImGuiKey_RightCtrl + made key order match mods order. (#4858) 2022-01-17 15:42:04 +01:00
ocornut eb823655af Removed support for pre-C++11 compilers. We'll stop supporting VS2010. (#4537)
Build all
2022-01-17 11:54:11 +01:00
ocornut 7f8a89c25c Backends: Win32, SDL: maintain MouseButtonsDown instead of using IsAnyMouseDown(). Internals: added GetInputSourceName(). 2022-01-12 16:12:10 +01:00
ocornut 956e03009a Backends: OSX: Build fIx. Made GetKeyName() input tolerant. Internals: added GetNavInputName(). 2022-01-11 18:48:16 +01:00
ocornut e8172fdfbc Rename io.AddKeyModEvent() -> io.AddKeyModsEvent() and updated backends accordingly. (#2625, #4858)
Amend 790132a (breaking)
2022-01-10 17:00:32 +01:00
ocornut 790132a672 Added io.AddKeyModEvent() and updated backends accordingly. (#2625, #4858) 2022-01-10 15:17:00 +01:00
ocornut bf08c13e9b Inputs: Extra Keys / AddKeyEvent(): bidirectional mapping, basic CI, simplify backends, asserts on misuses, tested backward compat. (#2625, #4858, #2787)
(edit: simplified backends merged into previous commits to make history clearer)
2022-01-10 15:09:56 +01:00
thedmd 3b66929301 Inputs: Extra Keys / AddKeyEvent(): Added ImGuiKey values, io.AddKeyEvent(), GetKeyName(), IMGUI_DISABLE_OBSOLETE_KEYIO. Obsoleted GetKeyIndex(), io.KeyMap[], io.KeysDown[]. (#2625, #4858, #2787) 2022-01-10 15:09:56 +01:00