Commit Graph

9323 Commits

Author SHA1 Message Date
ocornut
92fcdb29e5 ImStrv: add needed disambiguishing functions for const char* now being ambiguous. (5079)
amended for gcc/clang warnings
amended to facilitate merge with docking
2025-09-12 16:09:14 +02:00
ocornut
051a6c46a8 ImStrv: backtracked for now on supporting ImStrv for format strings.
It's widely incomplete and slow, requires a printf function taking non-zero-terminated format string to work.
Might do it eventually but it's much less a problem than labels. Format string are more frequently inlined in code and tend to be small, so existing solutions at call site can work better for now.
2025-09-12 16:09:14 +02:00
ocornut
2e275d1c65 ImStrv: Fixed various compile errors/warnings. 2025-09-12 16:09:14 +02:00
璀境石
05cfe36fdd ImStrv: enhanced VS debugger .natvis support. build fixes. (5333, 5906) 2025-09-12 16:09:14 +02:00
ocornut
2af3bc19f4 ImStrv: standardized code doing format copy, optimized ImStrStr 2025-09-12 16:09:14 +02:00
ocornut
e883c4d519 ImStrv: moved double char* function signatures under #ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS blocks. 2025-09-12 16:09:14 +02:00
ocornut
2eac1c762b ImStrv: changed ImStrv xxx=NULL args to an explicit xxx=ImStrv()
This is mostly for the benefit of cimgui parser, ideally we would do without.
2025-09-12 16:09:14 +02:00
ocornut
f9f2e1235f ImStrv: Step 2 - change ImStrv typedef to struct, perform all other logic conversion.
Squashed commits (initially a commit from rokups + many rework by ocornut. keeping them separate commits made rebasing unnecessarily tricking so merged from 2024/02)
ImStrv: many fixes (see details), added imconfig class extension example, added natvis description.
ImStrv: rework toward ensuring End is always set to constant can be compile time calculated
ImStrv: using length(), fix ambiguous empty() function, fix altered behaviors, removed unused operators.
ImStrv: various tweaks and fixes. removed ImGuiTextRange from ImGuiTextFilter, fix test engine hooks, removed constructor only used twice.
2025-09-12 16:09:13 +02:00
Rokas Kupstys
67882d4b94 ImStrv: Step 1 - change string type to ImStrv in API. (REBASED)
(last rebase amend 2024/12/11)
2025-09-12 16:07:16 +02:00
ocornut
36133d8ac4 InputText: Word-Wrap: hide vertical scrollbar but takes its width into account. (#3237, #952, #1062, #7363)
Also increase IMGUI_VERSION_NUM for good measure, forgot to increase it when moving to public api.
2025-09-12 16:03:18 +02:00
ocornut
b6a33f8ce1 InputText: Word-Wrap: amend 7f1e2bb to avoid triggering static analyzer. (#3237, #952, #1062, #7363)
And generally more logical this way anyhow.
2025-09-12 15:05:23 +02:00
ocornut
78c1d4a92c InputText: Word-Wrap: moving ImGuiInputTextFlags_WordWrap to public API. Added in demo. (#3237, #952, #1062, #7363) 2025-09-12 15:03:33 +02:00
ocornut
7f1e2bb8dd InputText: Word-Wrap: avoid word-wrap specific path InputTextLineIndexGetPosOffset() when word-wrap is disabled. (#3237, #952, #1062, #7363) 2025-09-12 15:03:33 +02:00
ocornut
2f3e85bc37 Comments 2025-09-12 15:03:33 +02:00
ocornut
8a94422246 InputText: optimize inactive path by avoiding an early ImStrlen(). 2025-09-11 21:26:10 +02:00
ocornut
ae832ce532 InputText: moved blocks so same text rendering code is now used for active and inactive states.
(ignore whitespace to visualize this change easily)
2025-09-11 21:26:04 +02:00
ocornut
1e52e7b90c InputText: Added a line index. Refactored cursor and selection rendering, now simpler, easier to reason about, and faster. (#3237, #952, #1062, #7363) 2025-09-11 21:26:01 +02:00
ocornut
67085d732a ImGuiTextIndex: rename member. 2025-09-11 21:25:56 +02:00
ocornut
f36c65661c InputText: fixed pressing End (without Shift) in a multi-line selection from mistakenly moving cursor based on selection start. 2025-09-11 18:45:07 +02:00
ocornut
e2b7d84e96 CI: disable pvs-studio 28 days warning (amend). 2025-09-11 15:15:48 +02:00
ocornut
271f476d08 CI: disable pvs-studio 28 days warning. 2025-09-11 15:12:51 +02:00
ocornut
e2f314d613 InputText: fixed misassignment to unused Scroll.y variable when using ImGuiInputTextFlags_NoHorizontalScroll.
Amend d474ed7f7 (#7913, #383)
2025-09-11 15:06:25 +02:00
ocornut
8eb22ea620 Demo: ShowStyleSelector(), ShowFontSelector(): remove ImGuiSelectableFlags_NoAutoClosePopups for now.
In this situation we kinda want keyboard Enter to select and close but ideally not click. We don't have separate options yet.
2025-09-10 22:42:12 +02:00
ocornut
55f590c1d1 Selectable: ImGuiSelectableFlags_SelectOnNav doesn't select when holding Ctrl, to be consistent with multi-select.
Amend e66afbb + remove needless line in CloseCurrentPopup() block
2025-09-10 22:29:42 +02:00
Harry Mander
5e5658e68f Debug Tools: fixed assertion failure when opening a combo box while using io.ConfigDebugBeginReturnValueOnce/ConfigDebugBeginReturnValueLoop. (#8931) 2025-09-10 19:12:03 +02:00
ocornut
013c4ed476 InputText: fixed gross buffer underflow introduced by a82f66a. (#3237, #952, #1062, #7363)
Would typically not crash by detected by sanitinizers.
2025-09-10 19:00:05 +02:00
ocornut
2f1d1c8b2f Focus, InputText: fixed an issue where SetKeyboardFocusHere() did not work on InputTextMultiline() with ImGuiInputTextFlags_AllowTabInput. (#8928) 2025-09-10 18:31:34 +02:00
ocornut
1cd08b883c TabBar: fixed calling TabBarQueueFocus() before submitting tabs. (#8929, #6681) 2025-09-10 18:03:34 +02:00
ocornut
4e98fb20e2 TabBar: Internals: added TabBarFindByID(), TabBarRemove() helpers.
Currently only for the benefit of TestEngine.
2025-09-10 17:59:26 +02:00
ocornut
045645e5f1 Demo: tweaked ShowFontSelector() and ShowStyleSelector() to update selection while navigating and to not close popup automatically. 2025-09-09 17:50:40 +02:00
ocornut
8e4955bb23 Selectable: moved ImGuiSelectableFlags_SelectOnNav to public API. 2025-09-09 17:42:14 +02:00
ocornut
e66afbbbe0 Selectable: ImGuiSelectableFlags_SelectOnNav doesn't close popups. 2025-09-09 17:33:03 +02:00
ocornut
2841c5135d Backends: OpenGL3: add GL_NEAREST and samplers functions in loader. 2025-09-08 17:24:39 +02:00
ocornut
bf52f4a83c Backends: OpenGL3: added HasBindSampler storage for readability and consistency. 2025-09-08 17:23:48 +02:00
ocornut
14e076c5bb Backends: Internal renaming of samplers. 2025-09-08 16:02:23 +02:00
ocornut
ea8a5a9e17 DrawList: made AddCallback() assert when passing a null callback. 2025-09-08 15:20:18 +02:00
ocornut
230418a75d InputText: Word-Wrap: attempt to track cursor while resizing frame/parent. (#3237, #952, #1062, #7363) 2025-09-08 11:56:22 +02:00
ocornut
16415aa39f InputText: Word-Wrap: added custom implementation for Home/End that is word-wrap friendly. (#3237, #952, #1062, #7363) 2025-09-08 11:56:22 +02:00
ocornut
985723ed94 InputText: Word-Wrap: mouse clicks on word-wrapping points set cursor side correctly. (#3237, #952, #1062, #7363) 2025-09-08 11:56:22 +02:00
ocornut
a82f66a9b0 InputText: Word-Wrap: added ImGuiInputTextFlags_WordWrap support. (#3237, #952, #1062, #7363) 2025-09-08 11:56:20 +02:00
ocornut
e422a38e4c InputText: internals: expose LineCount, GetPreferredOffsetX(). 2025-09-08 11:54:34 +02:00
ocornut
11fff1ccf5 ImFont::RenderText() takes ImDrawTextFlags_CpuFineClip instead of bool cpu_fine_clip + forward ImDrawTextFlags to word-wrap code.
(for #3237, #952, #1062, #7363)
2025-09-08 11:54:33 +02:00
ocornut
3cc7d1c81a InputText: InputTextCalcTextSize() uses ImFontCalcTextSizeEx().
(for #3237, #952, #1062, #7363)
2025-09-08 11:54:33 +02:00
ocornut
56189cd814 Internals: added ImDrawTextFlags_StopOnNewLine support to ImFontCalcTextSizeEx(), ImDrawTextFlags_WrapKeepTrailingBlanks to ImTextCalcWordWrapNextLineStart().
(for #3237, #952, #1062, #7363)
2025-09-08 11:54:33 +02:00
ocornut
a9945899c6 stb_textedit: extracted stb_textedit_move_line_start()/stb_textedit_move_line_end(), adding STB_TEXTEDIT_MOVELINESTART,STB_TEXTEDIT_MOVELINEEND support. (#3237, #952, #1062, #7363) 2025-09-08 11:54:33 +02:00
ocornut
bc6478f651 Internals: added ImDrawTextFlags_WrapKeepTrailingBlanks required for text-edit style word-wrapping.
(for #3237, #952, #1062, #7363)
2025-09-08 11:54:33 +02:00
ocornut
34ab6c8a89 Internals: extracted ImFont::CalcTextSizeA() into ImFontCalcTextSizeEx() so we can make change to its signature.
(for #3237, #952, #1062, #7363)
2025-09-08 11:54:33 +02:00
ocornut
c63b5bd8fb Internals: extracted ImFont::CalcWordWrapPosition() into ImFontCalcWordWrapPositionEx() so we can make change to its signature.
(for #3237, #952, #1062, #7363)
2025-09-08 11:54:33 +02:00
ocornut
8a35ce0e98 CalcWordWrapPosition() breaks on \n instead of relying on caller to do it + expose ImTextCalcWordWrapNextLineStart(). (#3237, #952, #1062, #7363)
Should be functional no-op, fingers crossed. Breaking on \n allows caller to count lines reliably.
2025-09-08 11:54:32 +02:00
yaz0r
f77f68a5ed CI: Windows: update to 1.4.326 + pull Vulkan from KhronosGroup's Vulkan-Headers and Vulkan-Loader. (#8925, #8778) 2025-09-08 11:42:28 +02:00