Commit Graph

1840 Commits

Author SHA1 Message Date
omar
9ad4c5da7e Fix zealous warnings + Internals: Renamed members from XxxxID to XxxxxId to be more consistent with rest of the codebase (still some inconsistency left that are harder to fix) 2020-01-16 23:44:05 +01:00
omar
44174b1fa1 Merge branch 'master' into docking
# Conflicts:
#	examples/imgui_impl_win32.cpp
#	examples/imgui_impl_win32.h
#	imgui.cpp
#	imgui_internal.h
2020-01-14 20:01:27 +01:00
omar
ff5299e0e0 Docs: FAQ, Comments. 2020-01-12 22:09:18 +01:00
omar
861f786d81 Merge branch 'master' into docking
# Conflicts:
#	docs/CHANGELOG.txt
#	examples/imgui_impl_opengl3.cpp
#	imgui.cpp
2020-01-10 14:38:09 +01:00
omar
d581939387 Removed trailing spaces. 2020-01-06 15:24:16 +01:00
omar
0dd02dd90d Happy new year!
Comments, Replaced pictures, Removed Patreon
2020-01-06 12:41:37 +01:00
omar
dc66f83db8 Additional duplicated comments about usage of std::string and input text resize callback (#2006, #1443, #1008) 2019-12-25 17:46:35 +01:00
omar
c706ff6f3a Merge branch 'master' into docking
# Conflicts:
#	examples/imgui_impl_sdl.cpp
#	imgui.cpp
2019-12-18 20:49:41 +01:00
omar
a610f1da52 Bezier Tweaks, fixed parameter order of 3831d50 2019-12-17 16:43:05 +01:00
omar
9d444062f9 Limiting Columns()/BeginColumns() api to 64 columns (#125)
While the current code technically supports it, future code may not so we're putting the restriction ahead.
2019-12-17 13:25:46 +01:00
omar
992736dc5d Merge branch 'refs/heads/master' into docking
# Conflicts:
#	docs/CHANGELOG.txt
#	examples/imgui_impl_glfw.cpp
#	examples/imgui_impl_sdl.cpp
#	examples/imgui_impl_win32.cpp
#	imgui.cpp
#	imgui_internal.h
#	imgui_widgets.cpp
2019-12-13 17:06:27 +01:00
omar
3a800f2dc9 DragFloat: Mention usage of FLT_MAX, INT_MAX etc. explicitly. (#2931) 2019-12-13 11:56:51 +01:00
Ben Carter
0e74103659 ImDrawList: Add AddNgon(), AddNgonFilled() API. 2019-12-09 11:23:06 +01:00
omar
f9c26d23de Removed redirecting functions/enums that were marked obsolete in 1.53 (December 2017).
Comments
2019-12-08 16:38:27 +01:00
Ben Carter
697f15e339 Added PrimUnreserve() API. Obsoleted calling ImDrawList::PrimReserve() with a negative count. 2019-12-08 16:06:32 +01:00
omar
f656e7775e Inputs: Added ImGuiMouseButton enum for convenience (e.g. ImGuiMouseButton_Right=1).
We forever guarantee that the existing value will not changes so existing code is free to use 0/1/2.
2019-12-06 16:29:36 +01:00
omar
6cbed03d4a Comments, clarified mouse button ordering. 2019-12-06 16:29:32 +01:00
omar
b521cd357d Removed implicit default parameter to IsMouseDragging(int button = 0) to be consistent with other mouse functions.
(none of the other functions have it).
2019-12-05 18:33:36 +01:00
Rokas Kupstys
945a509773 Implement ImGuiMouseCursor_NotAllowed mouse cursor. 2019-12-05 15:32:10 +01:00
omar
abaf0256b8 Version 1.75 WIP
Added message to font file loading assert.
2019-11-28 20:58:16 +01:00
omar
a1e4af62d3 Docking: Fix bug added in 71a58261 + Misc docking omments 2019-11-28 20:52:46 +01:00
omar
813e0c18e6 Merge branch 'master' into docking
# Conflicts:
#	docs/CHANGELOG.txt
#	examples/imgui_impl_dx10.cpp
#	examples/imgui_impl_dx10.h
#	examples/imgui_impl_dx11.cpp
#	examples/imgui_impl_dx11.h
#	examples/imgui_impl_dx12.cpp
#	examples/imgui_impl_dx12.h
#	examples/imgui_impl_dx9.cpp
#	examples/imgui_impl_dx9.h
#	examples/imgui_impl_metal.h
#	examples/imgui_impl_metal.mm
#	examples/imgui_impl_opengl3.cpp
#	examples/imgui_impl_opengl3.h
#	examples/imgui_impl_vulkan.cpp
#	imgui.cpp
#	imgui.h
#	imgui_internal.h
2019-11-26 12:23:43 +01:00
omar
bdce833636 Version 1.74 2019-11-25 18:38:53 +01:00
omar
26d177bc03 Docs: Moved misc/fonts/README.txt to docs/FONTS.txt. + tweaks 2019-11-25 18:29:28 +01:00
omar
3a82994429 Docking: Can undock from the small triangle button. (#2109,. #2645) 2019-11-22 23:12:16 +01:00
omar
106184bbea Docking: Fixed node->HasCloseButton not honoring ImGuiDockNodeFlags_NoCloseButton in a floating node, leading to empty space at the right of tab-bars with those flags. (#2109) 2019-11-22 23:11:21 +01:00
omar
51e2e9b239 ImVector: Added shrink() helper. ImFont::RenderText minor optimisation for debug build. Misc: Metrics shows tab names because we now have them. 2019-11-22 14:06:51 +01:00
omar
51a02b319c Added IM_UNICODE_CODEPOINT_MAX. Changed specs of ImFontAtlas::AddCustomRectRegular() (breaking change). 2019-11-21 14:13:17 +01:00
omar
ca63349eb4 Renamed XX-bits -> XX-bit in comments to match what the world appears to be using. 2019-11-20 11:58:25 +01:00
omar
c3fd4ae473 Docking: comments 2019-11-12 11:06:02 +01:00
omar
69b5c2f541 Merge branch 'master' into docking
# Conflicts:
#	imgui.cpp
#	imgui_internal.h
2019-11-08 15:45:12 +01:00
omar
57dc34f4e8 TreeNode: Added IsItemToggledOpen() to explicitly query if item was just open/closed, facilitating interactions with custom multi-selections patterns. (#1896, #1861) 2019-11-08 15:30:15 +01:00
omar
09b2310237 Internals: Added index of helpers and shuffled a few things. 2019-11-06 20:37:47 +01:00
omar
b3e94f5de8 Merge branch 'master' into docking
# Conflicts:
#	examples/imgui_impl_opengl3.cpp
#	imgui_widgets.cpp
2019-10-29 17:21:19 +01:00
stfx
6bf5aed325 Declaration and assignment can be joined, Member function may be 'const'. (#2875) 2019-10-29 17:11:49 +01:00
omar
0cbb96895a Merge branch 'master' into docking
# Conflicts:
#	examples/imgui_impl_dx12.cpp
#	imgui.cpp
#	imgui.h
#	imgui_widgets.cpp
2019-10-24 15:11:37 +02:00
omar
23c1ff4907 Removed redirecting functions/enums names that were marked obsolete in 1.52 (October 2017).
- Begin() [old 5 args version]     -> use Begin() [3 args], use SetNextWindowSize() SetNextWindowBgAlpha() if needed
- IsRootWindowOrAnyChildHovered()  -> use IsWindowHovered(ImGuiHoveredFlags_RootAndChildWindows)
- AlignFirstTextHeightToWidgets()  -> use AlignTextToFramePadding();
- SetNextWindowPosCenter()         -> use SetNextWindowPos() with a pivot of (0.5f, 0.5f)
- ImFont::Glyph                    -> use ImFontGlyph
If you were still using the old names, read "API Breaking Changes" section of imgui.cpp to find out the new names or equivalent features, or see how they were implemented until 1.73.
2019-10-22 14:45:11 +02:00
omar
048b73dfaa Various comments + Doc: Examples readme. Moved main menu bar code below menu bar code. 2019-10-21 20:57:07 +02:00
omar
7feccf9ab2 Merge branch 'master' into docking
# Conflicts:
#	examples/imgui_impl_dx10.cpp
#	examples/imgui_impl_dx10.h
#	examples/imgui_impl_dx11.cpp
#	examples/imgui_impl_dx11.h
#	examples/imgui_impl_dx9.cpp
#	examples/imgui_impl_dx9.h
#	examples/imgui_impl_glfw.cpp
#	examples/imgui_impl_opengl2.cpp
#	examples/imgui_impl_opengl2.h
#	examples/imgui_impl_opengl3.cpp
#	examples/imgui_impl_opengl3.h
#	imgui.cpp
2019-10-18 16:50:30 +02:00
omar
bf746c4215 DragScalar, SliderScalar, InputScalar: Added p_ prefix to parameter that are pointers to the datato clarify how they are used, and more comments redirecting to the demo code. (#2844) 2019-10-11 12:04:28 +02:00
omar
bf4880f6a2 Merge branch 'master' into docking 2019-10-07 19:14:37 +02:00
omar
8aad3482a4 ImVector: Fixed index_from_ptr() not asserting when passed end() element. 2019-10-07 17:22:55 +02:00
omar
e0c0e53edf Merge branch 'master' into docking
# Conflicts:
#	docs/CHANGELOG.txt
2019-10-04 19:22:42 +02:00
omar
892dfb1dea InputText, Nav: Fixed Home/End key broken when activating Keyboard Navigation. (#787)
Small refactor of ActiveIdUsingXXX inputs flags toward a little more consistent system. (#2637)
2019-10-02 15:57:36 +02:00
omar
c262276988 Version 1.74 WIP 2019-09-30 14:27:56 +02:00
omar
6994bf10bc Merge branch 'master' into docking + fix for RenderMouseCursor()
# Conflicts:
#	docs/CHANGELOG.txt
#	examples/imgui_impl_opengl3.cpp
#	imgui.cpp
#	imgui_draw.cpp
#	imgui_internal.h
2019-09-24 17:14:51 +02:00
omar
d5efe16157 Version 1.73 2019-09-24 17:02:26 +02:00
omar
3233d85d2f Merge branch 'master' into docking 2019-09-22 22:16:11 +02:00
omar
f47a0a85cc ImVector: added find, find_erase, find_erase_unsorted helpers. 2019-09-22 19:06:20 +02:00
omar
eab03f4467 Selectable: Added ImGuiSelectableFlags_AllowItemOverlap flag in public api (was previously internal only). 2019-09-22 19:03:51 +02:00
omar
af93c21cf9 Merge branch 'master' into docking
# Conflicts:
#	imgui.cpp
#	imgui_internal.h
2019-09-18 17:27:14 +02:00
omar
9d02ed51e3 TreeNode: Added ImGuiTreeNodeFlags_SpanAvailWidth and ImGuiTreeNodeFlags_SpanFullWidth flags (#2451, #2438, #1897)
Added demo bits.
2019-09-18 17:13:41 +02:00
omar
575df6f192 Merge branch 'master' into docking
# Conflicts:
#	examples/imgui_impl_opengl3.cpp
#	imgui.cpp
#	imgui_draw.cpp
#	imgui_internal.h
2019-09-17 16:35:50 +02:00
omar
b48dc067ae Style: Allow style.WindowMenuButtonPosition to be set to ImGuiDir_None to hide the collapse button. (#2634, #2639)
+ Fix #2775
2019-09-17 16:33:15 +02:00
omar
3b014d0c31 Merge branch 'features/ellipsis_rendering'
# Conflicts:
#	imgui.cpp
2019-09-17 12:07:30 +02:00
omar
7d5a17e5e4 Remove trailing spaces (grep for ' \r?$' in visual studio) 2019-09-17 11:33:18 +02:00
omar
57623c15dd Font: Narrow ellipsis: various minor stylistic tweaks (#2775) 2019-09-17 11:13:34 +02:00
Rokas Kupstys
45405f0dc9 Font: implement a way to draw narrow ellipsis without relying on hardcoded 1 pixel dots. (#2775)
This changeset implements several pieces of the puzzle that add up to a narrow ellipsis rendering.

## EllipsisCodePoint

`ImFontConfig` and `ImFont` received `ImWchar EllipsisCodePoint = -1;` field. User may configure `ImFontConfig::EllipsisCodePoint` a unicode codepoint that will be used for rendering narrow ellipsis. Not setting this field will automatically detect a suitable character or fall back to rendering 3 dots with minimal spacing between them. Autodetection prefers codepoint 0x2026 (narrow ellipsis) and falls back to 0x0085 (NEXT LINE) when missing. Wikipedia indicates that codepoint 0x0085 was used as ellipsis in some older windows fonts. So does default Dear ImGui font. When user is merging fonts - first configured and present ellipsis codepoint will be used, ellipsis characters from subsequently merged fonts will be ignored.

## Narrow ellipsis

Rendering a narrow ellipsis is surprisingly not straightforward task. There are cases when ellipsis is bigger than the last visible character therefore `RenderTextEllipsis()` has to hide last two characters. In a subset of those cases ellipsis is as big as last visible character + space before it. `RenderTextEllipsis()` tries to work around this case by taking free space between glyph edges into account. Code responsible for this functionality is within `if (text_end_ellipsis != text_end_full) { ... }`.

## Fallback (manually rendered dots)

There are cases when font does not have ellipsis character defined. In this case RenderTextEllipsis() falls back to rendering ellipsis as 3 dots, but with reduced spacing between them. 1 pixel space is used in all cases. This results in a somewhat wider ellipsis, but avoids issues where spaces between dots are uneven (visible in larger/monospace fonts) or squish dots way too much (visible in default font where dot is essentially a pixel). This fallback method obsoleted `RenderPixelEllipsis()` and this function was removed. Note that fallback ellipsis will always be somewhat wider than it could be, however it will fit in visually into every font used unlike what `RenderPixelEllipsis()` produced.
2019-09-17 11:13:07 +02:00
omar
0bdc145343 Merge branch 'master' into docking
# Conflicts:
#	imgui.cpp
#	imgui_internal.h
2019-08-31 19:19:00 +02:00
omar
b59ec7b9b7 DragInt, DragFloat, DragScalar: Using (v_min > v_max) allows locking any edit to the value. 2019-08-30 20:30:21 +02:00
omar
bfcdaeb610 Disable with ConfigWindowsMemoryCompactTimer < 0.0f (#2636) 2019-08-28 20:30:36 +02:00
omar
62f75c7fb1 Added a mechanism to compact/free the larger allocations of unused windows (buffers are compacted when a window is unused for 60 seconds, as per io.ConfigWindowsMemoryCompactTimer = 60.0f). Note that memory usage has never been reported as a problem, so this is merely a touch of overzealous luxury. (#2636) 2019-08-28 20:28:36 +02:00
omar
c8418015c2 SliderScalar: Improved assert when using U32 or U64 types with a large v_max value. (#2765)
+  misc minor stuff.
2019-08-28 15:19:10 +02:00
omar
e1fca8d982 Merge branch 'master' into docking
# Conflicts:
#	imgui.cpp
#	imgui_internal.h
2019-08-23 12:21:49 +02:00
omar
c4ff1b3578 ImDrawList: clarified the name of many parameters so reading the code is a little easier. (#2740) 2019-08-22 17:43:57 +02:00
omar
3fb5cf3541 Using offsetof() when available in C++11. Avoids Clang sanitizer complaining about old-style macros. (#94) 2019-08-22 16:55:42 +02:00
omar
aedcd2fb1a Merge branch 'master' into docking
# Conflicts:
#	docs/CHANGELOG.txt
#	examples/imgui_impl_dx11.cpp
#	imgui.cpp
2019-08-19 21:49:53 +02:00
omar
f624455d7b Version 1.73 WIP 2019-08-01 10:57:13 -07:00
omar
b8d8355f10 Merge branch 'master' into docking
# Conflicts:
#	docs/CHANGELOG.txt
#	imgui.cpp
2019-07-31 14:34:58 -07:00
omar
6a0d0dab5a Version 1.72b (patch for nav) 2019-07-31 14:31:06 -07:00
omar
9183e7c426 Version 1.73 WIP 2019-07-29 15:54:32 -07:00
omar
a1164399b0 Merge branch 'master' into docking
# Conflicts:
#	docs/CHANGELOG.txt
2019-07-27 18:21:41 -07:00
omar
ecb9b1e2eb Version 1.72 2019-07-27 18:15:07 -07:00
omar
d057550209 Fixed Clang 8.0 warning "empty expression statement has no effect; remove unnecessary ';' to silence this" warning [-Wextra-semi-stmt]
+ Comment
2019-07-24 17:07:05 -07:00
omar
e5b905481d Viewport: Refactored ViewportFlagsOverrideMask+ViewportFlagsOverrideValue into ViewportFlagsOverrideSet+ViewportFlagsOverrideClear which appears easier to grasp. (#1542)
(cherry picked from commit 9437630872e7ca19065bee78fcafaab54a0d5bf2)
2019-07-24 13:45:18 -07:00
omar
81b24bd728 Docking: Moving types in imgui.h 2019-07-23 13:37:52 -07:00
omar
db2581bee9 Merge branch 'master' into docking
# Conflicts:
#	imgui.cpp
2019-07-23 13:35:01 -07:00
omar
51853292cc ImDrawList: Using ImDrawCornerFlags instead of int in various apis.
Demo: Using ImGuiColorEditrFlags instead of int.
2019-07-23 10:41:48 -07:00
omar
0e6a096afd Docking: Renamed io.ConfigDockingTabBarOnSingleWindows to io.ConfigDockingAlwaysTabBar. (#2109)
Added ImGuiWindowClass::DockingAlwaysTabBar to set on individual windows.
2019-07-22 11:29:22 -07:00
omar
6f8d34768d Docking: Removed seemingly unnecessary test in TabItemEx() for undocking tab leading to window move. Added ImGuiDockNode::IsFloatingNode() helper to clarify code intent in various places. 2019-07-22 11:02:44 -07:00
omar
9cda3035fd Merge branch 'master' into docking
# Conflicts:
#	examples/imgui_impl_dx10.cpp
#	examples/imgui_impl_dx11.cpp
#	examples/imgui_impl_glfw.cpp
#	examples/imgui_impl_sdl.cpp
#	imgui.cpp
2019-07-22 10:29:14 -07:00
omar
363d33f64e Increased IMGUI_VERSION_NUM to facilitate transition of OSX clipboard support for framework using/embedding any version of imgui. Amend 29d9394. (#2546) 2019-07-22 10:23:27 -07:00
omar
f0348ddffc Amend 0f86116, renamed to ImGuiKey_KeyPadEnter Changelog.. (#2677, #2005) 2019-07-21 18:39:50 -07:00
Aaron Cooper
0f86116a69 Adding an ImGuiKey 'ImGuiKey_EnterSecondary' to support platforms that differentiate the enter (return key) and the numpad enter key. 2019-07-21 18:29:11 -07:00
omar
7fd34d4f30 Merge branch 'master' into docking
# Conflicts:
#	imgui.cpp
#	imgui_internal.h
2019-07-17 18:48:16 -07:00
omar
ea79992d9a Fixed old SetWindowFontScale() api value from not being inherited by child window. Added comments about the right way to scale your UI (load a font at the right side, rebuild atlas, scale style).
+ Added missing IMGUI_API marker to the EmptyString storage used by ImGuiTextBuffer. (#2672)
2019-07-17 10:01:49 -07:00
omar
56e10f1c35 Merge branch 'master' into docking
# Conflicts:
#	imgui.cpp
#	imgui.h
2019-07-16 18:29:31 -07:00
omar
e6a286b3a5 Style: Added style.ColorButtonButton (left/right, defaults to ImGuiDir_Right) to move the color button of ColorEdit3/ColorEdit4 functions to either side of the inputs. 2019-07-16 16:43:21 -07:00
omar
a35f42f123 Removed TreeAdvanceToLabelPos() which is rarely used and only does SetCursorPosX(GetCursorPosX() + GetTreeNodeToLabelSpacing()). Kept redirection function (will obsolete). (#581, #324) 2019-07-15 18:30:20 -07:00
omar
7a9d32acee Fixed unnecessary test in UpdateMouseWheel() (thanks PVS).
TreeNodeBehavior: avoid computing bg_col for non-framed non-active tree nodes.
Comments, binaries update, minor typos.
2019-07-15 18:30:20 -07:00
omar
dd80db87a6 Viewport: Added ImGuiViewportFlags_NoAutoMerge to prevent merging into host viewport in a per-window basis via the ImGuiWindowClass override mechanism. (#1542) 2019-07-15 13:35:21 -07:00
omar
e461e7bc7a Moved ImGuiColumnsFlags erroneously forward declared in imgui.h + demo bit. 2019-07-14 12:29:23 -07:00
omar
d52c6316c8 Renamed ImFontAtlas::CustomRect to ImFontAtlasCustomRect. Keep redirection typedef (will obsolete). 2019-07-12 11:58:46 +02:00
omar
e66799f79a Prefixed internal structs exposed in imgui.h with a fully qualified name to facilitate auto-generation with cimgui. 2019-07-12 11:54:22 +02:00
omar
d23f1b1409 fonts/binary_to_compress: display error message when failing to open file + misc comments. 2019-07-10 12:58:11 +02:00
omar
1f54c16f52 Merge branch 'master' into docking
# Conflicts:
#	docs/CHANGELOG.txt
#	imgui.cpp
2019-07-02 18:47:10 +02:00
kevreco
caf119a982 Added 'SetScrollHereX' and 'SetScrollFromPosX' (#1580) 2019-07-01 12:15:48 +02:00
omar
41e2d4b5ae ImDrawListSplitter: Fixed memory leak when using low-level split api (was not affecting ImDrawList api, also this type was added in 1.71 and not advertised as a public-facing feature). 2019-06-20 16:09:45 +02:00
omar
f563e1a504 Internals: Renamed GetFrontMostPopupModal() to GetTopMostPopupModal() to be consistent. Renamed other locals to follow that terminology. 2019-06-19 18:16:38 +02:00
omar
adbbd17cb6 Addendum to #2635. Add support for multi-viewports in SDL+DX!! example. making all Win32-centric back-ends handle PlatformHandleRaw. Using the field to use/store the HWND for internal purpose in SDL/GLFW back-ends. (#1542) 2019-06-18 23:37:57 +02:00