1
0
mirror of https://github.com/ocornut/imgui.git synced 2024-11-12 02:00:58 +01:00
Commit Graph

2023 Commits

Author SHA1 Message Date
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