Commit Graph

575 Commits

Author SHA1 Message Date
omar
ea9f5d7600 Added optional misc/stl/imgui_stl.h wrapper to use with STL types (e.g. InputText with std::string). (#2035, #2006, #1443, #1008) 2018-08-22 13:25:08 +02:00
omar
8d639ec60d InputText: callback InsertChars() support resize callbacks correctly (followup to 24ff259) + fixed demo to use those functions. (#2006, #1443, #1008). 2018-08-22 13:09:44 +02:00
omar
9f393c38e9 InputText: Renamed ImGuiTextEditCallback to ImGuiInputTextCallback, ImGuiTextEditCallbackData to ImGuiInputTextCallbackData for consistency. Kept redirection types (will obsolete). 2018-08-22 12:46:45 +02:00
omar
4de6e1f7e4 InputText: Internal renaming of some fields + final copy uses edit_state.CurLenA+1 instead of buf_size. 2018-08-21 15:14:10 +02:00
omar
e5f2295398 Merge branch 'master' into viewport
# Conflicts:
#	examples/imgui_impl_opengl2.cpp
#	examples/imgui_impl_opengl3.cpp
#	imgui.cpp
2018-08-13 17:50:48 -07:00
omar
9d8a0374d3 Use literals in place of LLONG_MIN, LLONG_MAX ULLONG_MAX if they are not available. Amend 498c0dcb4c. We prefer using the defines if available in limits.h because they somehow tend to work without warnings when enabling strict C++03 compilation. The 3 literals are fallbacks.. (#1926). 2018-08-06 13:07:19 +02:00
omar
8ef0ca9765 Merge branch 'master' into viewport
# Conflicts:
#	examples/imgui_impl_dx11.cpp
#	examples/imgui_impl_glfw.cpp
#	examples/imgui_impl_sdl.cpp
#	imgui.cpp
2018-08-01 12:27:56 +02:00
omar
87e2fea09d Renamed io.OptResizeWindowsFromEdges to ConfigResizeWindowsFromEdges, io.OptCursorBlink to io.ConfigCursorBlink, io.OptMacOSXBehaviors to ConfigMacOSXBehaviors for consistency. (#1427, #1495, #822, #473, #650)
Demo: Exposed flags in Demo.
2018-08-01 11:50:57 +02:00
omar
671e516377 Demo: Fix using ambiguous InputFloat() call which redirect to obsolete version. (#1990) 2018-07-31 18:38:15 +02:00
omar
9824bf1ba1 Merge branch 'master' into viewport
# Conflicts:
#	examples/imgui_impl_opengl3.cpp
#	imgui.cpp
2018-07-31 12:12:56 +02:00
omar
d5400d9517 Fixes for pre-C++11 compilers.
That said, I think we can consider upgrading requirement to an early VS-friendly subset of C++11. The thing I would like the most from C++11 are forward-declared enum (from VS 2012 onward).
2018-07-30 17:42:27 +02:00
omar
2a67aeaa3d Visual Studio: calling into _vsnprintf. (#1085) 2018-07-30 16:01:06 +02:00
omar
6d78045ff8 Demo: Added extra demo in the Basic Horizontal Layout section. (#1977) + PR guidelines 2018-07-30 14:33:27 +02:00
omar
352695bc57 Merge branch 'master' into viewport
# Conflicts:
#	examples/imgui_impl_sdl.cpp
#	imgui.cpp
2018-07-24 16:50:49 +02:00
omar
e07f5d4c78 Changed ImGui::GetTime() return value from float to double to avoid accumulating floating point imprecisions over time. 2018-07-22 18:46:41 +02:00
omar
23b67e6ff5 Merge branch 'master' into viewport
# Conflicts:
#	imgui.cpp
2018-07-17 19:52:14 +02:00
omar
7b4fbf4301 Viewport: Removed the need for the back-end to fill io.MousePosViewport, it seems unnecessary at this point. (#1542) 2018-07-17 16:37:10 +02:00
omar
0c207b7bc9 Demo: Clarified the use of IsItemHovered()/IsItemActive() right after being in the "Active, Focused, Hovered & Focused Tests" section. This will be of more importance with the introduction of tabs. 2018-07-17 11:49:41 +02:00
omar
ee98a069f0 Merge branch 'master' into viewport
# Conflicts:
#	examples/imgui_impl_dx10.cpp
#	examples/imgui_impl_dx11.cpp
#	imgui_demo.cpp
2018-07-16 22:25:36 +02:00
omar
d3be9185b3 Demo: Fixed spacing from b629f90 change. 2018-07-16 22:24:39 +02:00
omar
73e13a0762 Examples: Tweaked the main.cpp example structure for all examples. (There are a few hidden agendas here: 1) I would like to avoid encouraging people from using the implicit "Debug" window, and promote using Begin/End. In spite of my best attempt, there are a few feature of the upcoming docking system that cannot work 100% properly for the implicit Debug window, so future proof let's not put that feature in the spotlight too much for new users. 2) Moved dumb hardcoded positions into a single spot that can be replaced with a viewport relative position and not affect other demo windows. 3) Calling ShowDemoWindow before anything else, also for the benefit of a specific docking demo which will have an ordering constraint which is not really problematic in a real app but shouldn't be put forward in the demo. 2018-07-16 22:17:34 +02:00
omar
badde9a970 Demo: Spacing. 2018-07-12 11:58:50 +02:00
omar
b30b82835a Merge branch 'master' into viewport
# Conflicts:
#	imgui.cpp
#	imgui_demo.cpp
#	imgui_internal.h
2018-07-12 11:48:49 +02:00
omar
b629f90393 Demo: Re-ordered example app code to match their menu order and forward declaration order + added header to delimitate them. 2018-07-12 11:42:33 +02:00
omar
dd61c4802a Nav: Added a CTRL+TAB window list and changed the highlight system accordingly. (#787) 2018-07-09 19:22:49 +02:00
omar
c7016c25e8 Nav: Added a CTRL+TAB window list and changed the highlight system accordingly. (#787) 2018-07-09 19:16:48 +02:00
omar
14cef31467 Merge branch 'master' into viewport
# Conflicts:
#	imgui.cpp
2018-07-09 16:24:01 +02:00
omar
6201cad2b4 Examples: Comments, Demo: Log early out, TODO. (#1553) 2018-07-09 11:43:53 +02:00
omar
17efd7b3b0 Demo: Added basic Drag and Drop demo. (#143, #1931) 2018-07-08 20:06:49 +02:00
omar
770cba0bd0 Merge branch 'master' into viewport
# Conflicts:
#	examples/imgui_impl_glfw.cpp
#	examples/imgui_impl_glfw.h
#	examples/imgui_impl_sdl.cpp
#	examples/imgui_impl_sdl.h
#	examples/imgui_impl_win32.cpp
#	examples/imgui_impl_win32.h
#	imgui.cpp
#	imgui_internal.h
2018-07-02 20:13:16 +02:00
omar
62b3d7c51e Fixed software Hand cursor from not actually working. Fixed demo from crashing. Fixed typo and extraneous trailing space. Added Changelogs. (#1913, #1914) 2018-06-29 16:36:40 +02:00
omar
c38fe6b0e1 Merge branch 'master' into viewport
# Conflicts:
#	imgui.cpp
2018-06-26 12:41:36 +02:00
omar
14ceaaf460 ArrowButton: Fixed to honor PushButtonRepeat() setting (and internals' ImGuiItemFlags_ButtonRepeat). Setup current line text baseline so that ArrowButton() + SameLine() + Text() are aligned properly. 2018-06-26 12:37:20 +02:00
omar
c1d8dee6c5 Version 1.63 WIP 2018-06-25 09:40:09 +02:00
omar
fb0106fad2 Demo: Fixed incorrect response to Begin() returning false in overlay demo (which cannot happen since we don't have a title bar, but that doesn't make it a good behaving demo!). 2018-06-25 09:32:55 +02:00
omar
00418d13e3 Demo: Fixed mismatched TreePush/TreePop in Property Editor, due to incorrect revert in 826d77185e (#1895) 2018-06-22 17:45:03 +02:00
omar
ce500f8727 Merge branch 'master' into viewport
# Conflicts:
#	examples/imgui_impl_glfw.cpp
#	examples/imgui_impl_win32.cpp
2018-06-22 12:01:42 +02:00
omar
1b74e3be02 Version 1.62 2018-06-22 09:41:25 +02:00
omar
70b0bd13aa Merge branch 'master' into viewport
# Conflicts:
#	examples/imgui_impl_opengl2.cpp
#	examples/imgui_impl_opengl2.h
#	examples/imgui_impl_opengl3.cpp
#	examples/imgui_impl_opengl3.h
#	imgui.cpp
#	imgui.h
2018-06-14 15:30:15 +02:00
omar
826d77185e Revert 640c0566: TreeNode: Fixed nodes with ImGuiTreeNodeFlags_Leaf flag always returning true which was meaningless -> more flexible to keep allowing it by default so it setup an ID scope. 2018-06-14 15:10:46 +02:00
omar
d57fc7fb97 Added IsItemDeactivatedAfterChange() if the last item was active previously, isn't anymore, and during its active state modified a value. Note that you may still get false positive. (#820, #956, #1875) 2018-06-13 00:10:33 +02:00
omar
be4b8b5615 Internals: Added GetItemID(), GetFocusID() for consistency. Made GetActiveID() inline. Comments, fixed typos, demo tweaks. 2018-06-13 00:02:19 +02:00
omar
3569d74f98 Demo: Moved test of the Hovered/Active/Focused functions to the Widgets section. 2018-06-12 18:51:23 +02:00
omar
cd455a4600 Added IsItemDeactivated() to query if the last item was active previously but isn't anymore. Useful for Undo/Redo patterns. (#820, #956, #1875) 2018-06-12 18:44:33 +02:00
omar
c725710c6d Comments 2018-06-12 18:25:04 +02:00
omar
93b032ea92 Merge branch 'master' into viewport
# Conflicts:
#	examples/opengl3_example/imgui_impl_glfw_gl3.cpp
#	examples/sdl_opengl3_example/imgui_impl_sdl_gl3.cpp
#	imgui.cpp
2018-06-05 15:51:52 +02:00
omar
2bdf0b54a2 Changelog formatting update, Todo, comments. Tweak Child demo. Shuffle some code in NavUpdate(). 2018-06-05 15:34:22 +02:00
omar
03c8a78f04 Merge branch 'master' into viewport
# Conflicts:
#	examples/opengl2_example/imgui_impl_glfw_gl2.cpp
#	examples/opengl3_example/imgui_impl_glfw_gl3.cpp
#	examples/sdl_opengl3_example/imgui_impl_sdl_gl3.cpp
#	examples/sdl_opengl3_example/imgui_impl_sdl_gl3.h
#	examples/vulkan_example/imgui_impl_glfw_vulkan.cpp
2018-05-25 12:44:56 +02:00
omar
bf56b6b9a5 ColorEdit3, ColorEdit4, ColorButton: Added ImGuiColorEditFlags_NoDragDrop flag to disable ColorEditX as drag target and ColorButton as drag source. (#1826) 2018-05-21 10:13:21 +02:00
omar
01429e7d16 Merge branch 'master' into viewport
# Conflicts:
#	examples/opengl3_example/imgui_impl_glfw_gl3.cpp
#	examples/sdl_opengl3_example/imgui_impl_sdl_gl3.cpp
#	imgui.cpp
#	imgui.h
2018-05-17 15:03:56 +02:00
omar
d5c8f404b2 Remove trailing white spaces. 2018-05-17 14:12:37 +02:00
omar
640c056602 TreeNode: Fixed nodes with ImGuiTreeNodeFlags_Leaf flag always returning true which was meaningless. Tweak demo. 2018-05-14 23:36:37 +02:00
omar
036dce634e Version 1.62 WIP 2018-05-14 19:19:19 +02:00
omar
b0fb340b57 Merge branch 'master' into viewport
# Conflicts:
#	imgui.cpp
2018-05-14 13:15:21 +02:00
omar
78b28d545f Version 1.61 + todo additions 2018-05-14 12:34:47 +02:00
omar
d7cc4bc317 Demo: Tweaked custom rendering custom, added a Thickness drag. Clarified use of vertical/horizontal line. Add a single pixel demo (wowow) 2018-05-13 23:42:19 +02:00
omar
3f29ed6fd5 ColorEdit: Fixed not being able to pass the ImGuiColorEditFlags_NoAlpha or ImGuiColorEditFlags_HDR flags to SetColorEditOptions(). Demo tweak. 2018-05-13 23:41:43 +02:00
omar
d53bae4c14 Demo: Fixing build due to using INT_MAX, UINT_MAX, LLONG_MAX, ULLONG_MAX. 2018-05-12 18:58:59 +02:00
omar
8adbf081af Demo: Renamed "fixed overlay" to "simple overlay" because it's not fixed any more! 2018-05-12 18:07:22 +02:00
omar
a7a1b3b0a7 Demo: Added demo for DragScalar(), InputScalar(), SliderScalar(). (#643) 2018-05-12 17:53:34 +02:00
omar
85f3ba844c Merge branch 'master' into viewport
# Conflicts:
#	examples/sdl_opengl2_example/imgui_impl_sdl_gl2.cpp
#	examples/sdl_opengl3_example/imgui_impl_sdl_gl3.cpp
#	imgui.cpp
#	imgui.h
2018-05-11 22:22:41 +02:00
omar
fc7fc83f9e Data types: DragScalar, InputScalar: default parameters. Added IM_STATIC_ASSERT(). Comments. 2018-05-11 19:27:27 +02:00
omar
0dc18a6ca6 Documentation tweaks, comments 2018-05-11 16:54:50 +02:00
omar
8149408408 Merge branch 'data_types'
# Conflicts:
#	CHANGELOG.txt
#	imgui.cpp
2018-05-11 16:48:50 +02:00
omar
14f575ff76 Scrolling: Fixed a case where using SetScrollHere(1.0f) at the bottom of a window on the same frame the window height has been growing would have the scroll clamped using the previous height. (#1804) 2018-05-10 14:31:04 +02:00
omar
4ff23d3306 Merge branch 'master' into viewport
# Conflicts:
#	examples/imgui_impl_dx9.cpp
#	imgui.cpp
#	imgui.h
2018-05-07 22:23:58 +02:00
omar
787a475650 Skip missing font glyphs to 1) avoid using space for missing glyphs and 2) allow merging fonts with overlapping ranges. Demo: Fixed displaying ? instead of greyed out empty box. (#1671, #1703) 2018-05-07 18:03:00 +02:00
omar
f4c16fbb99 Internals: Data types: Made format string optional. DragBehavior: Moved a bit of code outside of the template. Slider tidying up. Removed unnecessary call to fabsf(). 2018-05-04 17:57:47 +02:00
omar
dcd26f1295 DragFloat, DragInt: Default format string is none is passed to the function. Fixed demo using old style %.0f. 2018-05-04 16:41:48 +02:00
omar
086c3925c4 Internals: Fixed DragInt* default format string. InputScalar(), InputScalarN(), removed InputFloatN(), InputInt(). Note that DragInt2/3/4 will %f format strings will currently be broken. (#320, #643, #708, #1011) 2018-05-03 19:42:35 +02:00
omar
4780ac1ca4 Internals: Data types: Added s64, u64 data types. Added support in InputScalar(). Removed internal.h InputScalarEx() to InputScalar(). Removed cheap-relative-operators support in recently added U32 data path, since this is heading toward being legacy code. + Fixed InputDouble parsing code. (#1011, #320, #708) 2018-05-03 17:34:22 +02:00
omar
d9fa1f869e Comments about using "power curves". Demo tweaks. (#648) 2018-05-03 17:34:15 +02:00
omar
429f48bb4f Clarified usage of ListBoxHeader() before we rename those functions + fixed demo code that didn't honor it correctly. (#1783) 2018-04-29 12:20:22 +02:00
Branimir Karadžić
d317951b37 Demo: Fixed demo from using obsolete functions. 2018-04-28 10:33:48 +02:00
omar
f80314754c InputFloat,InputFloat2,InputFloat3,InputFloat4: Added variations taking a more flexible and consistent optional "const char* format" parameter instead of "int decimal_precision". This allow using custom formats to display values in scientific notation, and is generally more consistent with other API. Obsoleted functions using the optional "int decimal_precision" parameter. (#648) 2018-04-28 00:11:40 +02:00
omar
c47d34cf70 Viewport: Exposing SetNextWindowViewport(). Used in demo and old/obsolete SetNextWindowPosCenter() (which is an interesting case). Fixed back-end likely crash calling GetFocus() after viewport destruction. Fixed metrics crash. 2018-04-27 15:13:22 +02:00
omar
e3453d0dc4 Misc: Comments and shallow/small changes (merged from viewport branch to minimize branch drift). 2018-04-25 17:58:53 +02:00
omar
3b9b1956cd Merge branch 'master' into viewport
# Conflicts:
#	examples/allegro5_example/imgui_impl_a5.cpp
#	examples/allegro5_example/imgui_impl_a5.h
#	examples/allegro5_example/imgui_impl_allegro5.cpp
#	examples/allegro5_example/imgui_impl_allegro5.h
#	examples/allegro5_example/main.cpp
#	examples/imgui_impl_allegro5.cpp
#	examples/imgui_impl_allegro5.h
#	imgui.cpp
#	imgui_internal.h
2018-04-25 15:32:04 +02:00
omar
dc03c93164 Internals: Removed misleading ImRect::FixInverted + fix minor formatting in Readme.
Demo: Fixed Overlay: Added a context menu item to enable freely moving the window.
2018-04-24 14:19:10 +02:00
omar
456bbffcc4 Viewport: Switched to using unified platform-absolute mouse coordinates, which simplify lots of problems and simplify/reduce tricky conversions, makes ImVec2 less ambiguous. Fixed various viewport/windowing/popups/synchronization bugs. Settings on host-viewport are stored as relative (made settings decently compatible between viewport enable/disabled settings). Merged ImGuiViewport::Pos and ::PlatformPos. Tweaked thumbnails. Better, smaller code. (#1542) 2018-04-20 21:36:36 +02:00
omar
1c385c2ca4 Merge branch 'master' into viewport
# Conflicts:
#	examples/imgui_impl_dx10.cpp
#	examples/imgui_impl_dx11.cpp
#	examples/imgui_impl_dx12.cpp
#	examples/imgui_impl_dx9.cpp
#	examples/opengl2_example/imgui_impl_glfw_gl2.cpp
#	examples/opengl3_example/imgui_impl_glfw_gl3.cpp
#	examples/sdl_opengl2_example/imgui_impl_sdl_gl2.cpp
#	examples/sdl_opengl3_example/imgui_impl_sdl_gl3.cpp
#	examples/vulkan_example/imgui_impl_glfw_vulkan.cpp
#	imgui.cpp
#	imgui_internal.h
2018-04-18 19:06:49 +02:00
omar
6a0b2627ad BeginMainMenuBar: Followup to 1e41bad9. Removed public window flag. DisplaySafeAreaPadding defaults to (3,3) instead of (4.4). Comments, tab to spaces, Changelog. (#1439) 2018-04-18 17:37:35 +02:00
omar
38e357ef10 Viewport: Virtual mouse position are patched immediately when viewports are moved in the virtual space, avoiding interaction glitchs on a resizing frame. (#1542) 2018-04-12 19:57:35 +02:00
omar
56ad2a2d74 Merge branch 'master' into viewport
# Conflicts:
#	examples/imgui_impl_dx10.cpp
#	examples/opengl2_example/imgui_impl_glfw_gl2.cpp
#	examples/opengl3_example/imgui_impl_glfw_gl3.cpp
#	examples/vulkan_example/main.cpp
#	imgui.h
2018-04-09 19:35:14 +02:00
omar
6f1f5cbc20 Version 1.61 WIP 2018-04-09 14:02:32 +02:00
omar
3a29ddbcfa Version 1.60 2018-04-08 00:45:02 +02:00
omar
f421e73b40 Merge branch 'master' into viewport
# Conflicts:
#	examples/imgui_impl_dx10.cpp
#	examples/imgui_impl_dx11.cpp
#	examples/imgui_impl_dx12.cpp
#	examples/imgui_impl_dx9.cpp
#	examples/opengl2_example/imgui_impl_glfw_gl2.cpp
#	examples/opengl3_example/imgui_impl_glfw_gl3.cpp
#	examples/sdl_opengl2_example/imgui_impl_sdl_gl2.cpp
#	examples/sdl_opengl3_example/imgui_impl_sdl_gl3.cpp
#	examples/vulkan_example/imgui_impl_glfw_vulkan.cpp
#	imgui.cpp
#	imgui.h
#	imgui_internal.h
2018-04-06 23:36:23 +02:00
omar
72b7f48870 Renamed ImGuiConfigFlags_NoSetMouseCursor to ImGuiConfigFlags_NoMouseCursorChange. Followup to 75c3793db5 two weeks ago. (#787, #1495, #1202) + comments 2018-04-06 18:12:21 +02:00
omar
0cad274b87 Merge branch 'master' into viewport
# Conflicts:
#	examples/imgui_impl_dx10.cpp
#	examples/imgui_impl_dx11.cpp
#	examples/imgui_impl_dx12.cpp
#	examples/imgui_impl_dx9.cpp
#	examples/opengl2_example/imgui_impl_glfw_gl2.cpp
#	examples/opengl3_example/imgui_impl_glfw_gl3.cpp
#	examples/sdl_opengl2_example/imgui_impl_sdl_gl2.cpp
#	examples/sdl_opengl2_example/imgui_impl_sdl_gl2.h
#	examples/sdl_opengl3_example/imgui_impl_sdl_gl3.cpp
#	examples/sdl_opengl3_example/imgui_impl_sdl_gl3.h
#	imgui.cpp
2018-04-04 19:39:42 +02:00
omar
c19b27813d Added InputDouble() function. We use a format string instead of a decimal_precision parameter to also for "%e" and variants. (#1011) May transition the other InputXXX function to use format strings as well. 2018-03-22 18:58:40 +01:00
omar
172570acae Merge branch 'master' into viewport
# Conflicts:
#	examples/imgui_impl_dx10.cpp
#	examples/imgui_impl_dx11.cpp
#	examples/imgui_impl_dx12.cpp
#	examples/imgui_impl_dx9.cpp
#	examples/opengl2_example/imgui_impl_glfw_gl2.cpp
#	examples/opengl3_example/imgui_impl_glfw_gl3.cpp
#	examples/sdl_opengl2_example/imgui_impl_sdl_gl2.cpp
#	examples/sdl_opengl3_example/imgui_impl_sdl_gl3.cpp
#	examples/vulkan_example/imgui_impl_glfw_vulkan.cpp
#	imgui.h
2018-03-20 22:14:34 +01:00
omar
75c3793db5 IO: Added ImGuiConfigFlags_NoSetMouseCursors. Added ImGuiBackendFlags_HasMouseCursors, ImGuiBackendFlags_HasSetMousePos. (#787, #1495, #1202) 2018-03-20 21:19:23 +01:00
omar
170f44e6f0 IO: Renamed io.WantMoveMouse to io.WantSetMousePos (was added in 1.52, _not_ used by core and only honored by some binding ahead of merging the Nav branch) + internal renaming (#787) 2018-03-20 20:12:34 +01:00
omar
c29971cf72 Merge branch 'master' into viewport
# Conflicts:
#	examples/sdl_opengl2_example/main.cpp
#	examples/sdl_opengl3_example/main.cpp
#	examples/vulkan_example/main.cpp
2018-03-20 16:05:31 +01:00
omar
166411287f Demo: Added more complete Combo demo. (#1658) 2018-03-19 14:44:37 +01:00
omar
33ad8b2f0c Nav: Track nav input source more generally (gamepad vs keyboard) (#787) + update todos and demo tweaks 2018-03-19 13:20:18 +01:00
omar
c50198debe Viewport: Obsoleted io.DisplayPos (which was a Viewport branch thing), added ImDrawData::DisplayPos, DisplaySize (#1542) wip 2018-03-13 16:20:27 +01:00
omar
f6fc28dfd2 Merge branch 'master' into viewport (inc Vulkan resize fix merge #1042) 2018-03-12 17:50:32 +01:00
omar
111ea7af77 Misc comments, todos + reintroduced removed ImGuiCol defines under !IMGUI_DISABLE_OBSOLETE_FUNCTIONS wrap. 2018-03-12 17:24:15 +01:00
omar
1f6ad7a894 ImFont: Added FindGlyphNoFallback. Fixed MergeMode broken by 1ef1acbd8d 2018-03-10 10:33:12 +01:00