944f414cc6
Internals: A few selected math helpers are now using template to handle all supported types. Added ImPow() to wrap float/double in a standard manner without calling pow(double) when not needed in Drag code.
omar2018-05-04 18:13:27 +02:00
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().
omar2018-05-04 15:31:17 +02:00
dcd26f1295
DragFloat, DragInt: Default format string is none is passed to the function. Fixed demo using old style %.0f.
omar2018-05-04 15:29:33 +02:00
dbe16b6a70
Made IMGUI_DISABLE_OBSOLETE_FUNCTIONS exceptionally not affect the layout of ImGuiIO. (#1695)
omar2018-05-04 14:55:38 +02:00
f47c756755
Internals: Missing const, some renaming. Tweak legacy fast path.
omar2018-05-03 21:53:26 +02:00
0699ae161f
DragInt, DragScalar: Actually made the fast-past handle the now-most-common case..
omar2018-05-03 21:49:38 +02:00
7640439747
DragInt: Patch old format strings to replace %f by %d when using the DragInt() entry point. (#320, #643, #708, #1011)
omar2018-05-03 21:28:59 +02:00
17d3c6305e
Ran a spell checker for sanity.
omar2018-05-03 21:11:53 +02:00
069b284f17
Internals: Tidying up internal helpers. Fixed a case ImParseFormatTrimDecorations() can return an off by one (out of bound) pointer if the format string is invalid. Extracted ImParseFormatFindEnd() out of TrimDecorations so we can use it to find the format type and replace the %f in old Int apis.
omar2018-05-03 20:22:29 +02:00
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)
omar2018-05-03 19:36:47 +02:00
6c932479f2
Internal: DragScalar(), InputScalar() now support signed/unsigned, 32/64 bits, float/double data types. (#320, #643, #708, #1011)
omar2018-05-03 17:32:50 +02:00
93b8580a8d
Internals: DragFloat: Fixed power handling. Use an temporary accumulator and no absolute values so we will be able to manipulate double as well as 64-bit integers. (#1011, #708, #320)
omar2018-05-03 14:05:17 +02:00
3f04fd0644
Internals: DragFloat: Removed DragSpeedScaleFast/DragSpeedScaleSlow since it's not yet usable and Nav version doesn't have an equivalent.
omar2018-05-03 14:04:25 +02:00
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)
omar2018-05-02 14:07:20 +02:00
d9fa1f869e
Comments about using "power curves". Demo tweaks. (#648)
omar2018-05-03 12:50:34 +02:00
8a370f6491
SliderFloat: Fixed grab size and steps with %g format. (#642, #1301)
omar2018-05-02 19:46:57 +02:00
10e3f17235
DragFloat/SliderFloat internal InputScalar trim leading/trailing spaces emitted from the format string when presenting an edit box to the user. (#648) Follow up to 6881d065b8omar2018-05-03 11:59:20 +02:00
a62f195e83
Internals: Renamed IsCharIsSpace() to IsCharIsBlank*() to match standard terminlogy and added ascii/u16 variations.
omar2018-05-03 11:57:51 +02:00
ef05141a06
Internals: InputScalarEx: Tweak internals so there is a fast path for the simple case. (in particular because it makes it clear what the extra code is for, so people tempted to create their own InputText data transform/handler understand how little is actually needed)
omar2018-04-30 20:12:14 +02:00
ed756d474e
Internals: Added ImGuiDataType_Uint32 data type which is usable with InputScalarEx().
omar2018-04-30 20:02:33 +02:00
7df985bc5c
Nav: Fixed hovering a Selectable() with the mouse so that it update the navigation cursor. Fixed c8b9b2c6 which was incorrect (#787)
omar2018-04-30 19:40:25 +02:00
a1da7f9860
Internals: Tweaked ParseFormatPrecision(), clarified its more limited purpose, allowing 2-digits precisions since it makes (some) sense for doubles. (#648)
omar2018-04-30 16:52:16 +02:00
92f0165f85
DragFloat, SliderFloat: Rounding scalar using the provided format string instead of parsed precision. (#648)
omar2018-04-30 16:44:57 +02:00
6881d065b8
DragFloat/SliderFloat internal InputScalar trip trailing decoration off the format string when presenting an edit box to the user. (#648)
omar2018-04-30 15:59:59 +02:00
d7e24416dd
DragFloat/SliderFloat internal InputScalar relies on the user supplied format string to format and parse value. (#648) The trailing text after the format will be displayed in the InputText but not affect back parsing. Ideally we can try to strip it later.
omar2018-04-30 11:08:45 +02:00
429f48bb4f
Clarified usage of ListBoxHeader() before we rename those functions + fixed demo code that didn't honor it correctly. (#1783)
omar2018-04-29 12:19:44 +02:00
f2e9dddeca
DragDrop: Removed const qualifier from ImGuiPayload 's void* data, easing casting on user side.
omar2018-04-28 10:43:15 +02:00
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)
omar2018-04-28 00:11:40 +02:00
73445ff248
Renamed all "display_format" arguments to "format" to emphasis that they also affect rounding of values. (#648, #642)
omar2018-04-27 23:44:27 +02:00
8a38271a7c
SliderFloat, DragFloat: Fix to allow input of scientific notation when Ctrl+Clicking a slider or drag, matching the change done in c19b2781 for InputFloat(). (#648, #1011)
omar2018-04-27 23:18:28 +02:00
066550de68
DragFloat, DragInt: Cancel mouse tweak when current value is initially past the min/max boundaries and mouse is pushing in the same direction (keyboard/gamepad version already did this).
omar2018-04-27 19:15:25 +02:00
1d99b5f963
Internals: Reordered parameters of DataTypeFormatString() internal helper functions and shallow tweaks.
omar2018-04-27 17:32:31 +02:00
101f9b42b7
InputText: Fixed returning true when edition is cancelled with Esc and the current buffer matches the initial value.
omar2018-04-27 17:19:49 +02:00
28edece04f
Comments, minor tweaks
omar2018-04-26 14:56:46 +02:00
eb1c36fdfb
Added IMGUI_CHECKVERSION() macro to compare version string and data structure sizes in order to catch issues with mismatching compilation unit settings. (#1695, #1769)
omar2018-04-25 22:07:14 +02:00
711a63befc
Misc: Stop moving window if mouse position becomes invalid. Flagged menus are _NoMove for sanity.
omar2018-04-25 17:55:26 +02:00
d317d90610
Misc: NavCalcPreferredRefPos selects between mouse and nav reference position + added sanity assert (merged from viewport branch to minimize branch drift).
omar2018-04-25 17:53:24 +02:00
9cbca8c127
Begin: Shuffled some code, _should_ have no side-effect. Clear NextWindowData in one call and more consistently. (merged from viewport branch to minimize branch drift).
omar2018-04-25 17:48:46 +02:00
e3453d0dc4
Misc: Comments and shallow/small changes (merged from viewport branch to minimize branch drift).
omar2018-04-25 16:38:13 +02:00
b28535d1da
ImGuiTextBuffer::appendfv needs to va_end the args_copy.
Bruce Mitchenerandomar2018-04-25 22:32:24 +07:00
01fa934222
Internals: Removed unecessary Pos/PosFloat separation, only reason appears to be mostly pre-1.0. The only piece of code that I expected sub-pixel window position to matter actually already round its delta (wrongly so, will fix later/separately if we want).
omar2018-04-25 15:24:26 +02:00
46698c96c5
Removed presumably obsolete MovingWindow tests which prevent move/merge logic in viewport branch from working in all situations (e.g. docking away when ActiveId is the ID of a tab)
omar2018-04-24 16:48:26 +02:00
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.
omar2018-04-23 21:38:53 +02:00
7b6b7038c5
Window: Relaxed the internal stack size checker to allow Push/Begin/Pop/.../End patterns to be used with PushStyleColor, PushStyleVar, PushFont without causing a false positive assert. (#1767)
omar2018-04-23 11:26:23 +02:00
22773e03a2
InputText: On Mac OS X, support Cmd+Shift+Z for Redo. Cmd+Y is also supported as major apps seems to default to support both. (#1765)
omar2018-04-23 11:15:13 +02:00
037d5a7e98
Columns: Fixed a bug introduced in 1.51 where columns would affect the contents size of their container, often creating feedback loops when ImGuiWindowFlags_AlwaysAutoResize was used. (#1760)
omar2018-04-20 16:03:21 +02:00
49a451d247
Window: Fixed windows using the ImGuiWindowFlags_NoSavedSettings flag from not using the same default position as other windows. (#1760)
omar2018-04-20 15:40:12 +02:00
f93dce9513
InputText: Tweak to make the if statement more readable + update Changelog (#1747)
omar2018-04-19 16:21:32 +02:00
6beafe555c
Update issue template so that removing the carriage return doesn't merge the user's text with the list/bullet item.
omar2018-04-19 14:47:29 +02:00
f5700f238d
Documentations for Github users. Metrics: Fixed display of NavRectRel, added display of ParentWindow.
omar2018-04-18 22:19:50 +02:00
bcac02809f
Examples: Allegro 5: Renamed bindings from imgui_impl_a5.cpp to imgui_impl_allegro5.cpp.
omar2018-04-18 21:55:12 +02:00
3913297384
Examples: Allegro 5: Added support for 32-bit indices setup via defining ImDrawIdx, to avoid an unecessary conversion (Allegro 5 doesn't support 16-bit indices).
omar2018-04-18 21:51:14 +02:00
6d6f4a85f6
Fixed DisplaySafeAreaPadding not affecting popups/tooltips/menus at it should have (partly broken in 2e5577f44f).
omar2018-04-18 17:39:20 +02:00
6a0b2627ad
BeginMainMenuBar: Followup to 1e41bad9. Removed public window flag. DisplaySafeAreaPadding defaults to (3,3) instead of (4.4). Comments, tab to spaces, Changelog. (#1439)
omar2018-04-18 15:38:04 +02:00
1e41bad90f
Added DisplaySafeAreaPadding to MainMenuBar height and fixed starting x position. Fixes main menu bar problems with TVs. (#1439)
Doug Binksandomar2018-04-18 11:46:15 +01:00
7241dc61d4
Fixed default proportional item width lagging by one frame on resize + miscellaneous minor tweaks.
omar2018-04-16 19:37:00 +02:00
d1d2bbf86a
Internals: Popup: Moved popup/menu/tooltip positioning code (viewport branch needs it organized in a different manner, so we are pushing the bulk of it here to minimize differences).
omar2018-04-11 15:33:11 +02:00
bfc0efaae9
Internals: Window: Aggregating ImDrawList into the ImGuiWindow structure.
omar2018-04-11 12:43:38 +02:00
84fe711bdf
Settings: Fixed saving an empty .ini file if CreateContext/DestroyContext are called without a single call to NewFrame(). (#1741)
omar2018-04-11 10:08:23 +02:00
296f03374b
NewFrame: Prevent division by zero in frame rate calculation if io.DeltaTime is continuously zero. (#1740, #881)
omar2018-04-10 23:48:27 +02:00
928a4ad315
Begin: moved tooltip position code in an else block. Misc comments
omar2018-04-10 16:51:16 +02:00
52cac135c9
Internals: Renamed GetFrontMostModalRootWindow() to GetFrontMostPopupModal() and exposed in imgui_internal.h (#1738)
omar2018-04-10 15:04:36 +02:00
9117632bf0
Misc: IM_DELETE() helper function added in 1.60 doesn't clear the input _pointer_ reference, more consistent with expectation and allows passing r-value.
omar2018-04-09 20:42:49 +02:00
660c157880
Examples: Added missing calls for ::DestroyWindow, glfwDestroyWindow() + fix old comments.
omar2018-04-09 19:16:47 +02:00
6f1f5cbc20
Version 1.61 WIP
omar2018-04-09 14:02:32 +02:00
dd079fe6e6
Version 1.60 (missed the string). Will retag.
omar2018-04-09 13:52:24 +02:00
54fca1d1b8
Fixed erroneous call to io.Fonts->ClearInputData() + ClearTexData() that was left in DX10 example but removed in 1.47 (Nov 2015) in every other back-ends. (fixes 6cee2fca94) (#1733, ~#1731) + assert
omar2018-04-09 13:13:06 +02:00
c2fc978983
Style: Default style is now StyleColorsDark()! Toward a 1.60 release :) (#707)
omar2018-04-06 23:25:25 +02:00
0734a12d25
IO: ImGuiConfigFlags_NoMouse disable hovering so it is not destructive. Amend 2464e62a1aomar2018-04-06 23:05:53 +02:00
e88fb10d7c
NewFrame: Extract some code into a NewFrameUpdateHoveredWindowAndCaptureFlags() which can be of use with touch-based inputs systems.
omar2018-04-06 19:29:00 +02:00
c1bdab6d5b
Comments about io.WantCapture flags + todo entries.
omar2018-04-06 19:28:00 +02:00
ac2027c415
NewFrame: Extract some code into a NewFrameUpdateMouseInputs function. Moved settings saving higher up in the function so it is next to its peers.
omar2018-04-06 18:43:31 +02:00
2464e62a1a
IO: Added ImGuiConfigFlags_NoMouse to force clear/disable mouse inputs in NewFrame().
omar2018-04-06 18:17:41 +02:00
72b7f48870
Renamed ImGuiConfigFlags_NoSetMouseCursor to ImGuiConfigFlags_NoMouseCursorChange. Followup to 75c3793db5 two weeks ago. (#787, #1495, #1202) + comments
omar2018-04-06 18:12:21 +02:00
18a243bef0
Columns: Fixed calling Columns() again with the same number of columns. (#125)
omar2018-04-06 17:50:50 +02:00
fc30462f18
Hide new windows for one frame until they calculate their size. Also fixes SetNextWindowPos() given a non-zero pivot. (#1694)
omar2018-04-04 19:35:08 +02:00
5aa3f99b4c
Internal: using more consistent comparaison with HiddenFrames to not imply it could be -1. Tweaked comments.
omar2018-04-04 17:21:36 +02:00
4649967112
Added extra comments and assertions to avoid user combining ImGuiCond flags. (#1694)
omar2018-04-04 15:01:01 +02:00
cd1e6e384f
Tooltip windows uses PopupBorderSize (#1697) + commented out debug stuff.
omar2018-04-04 12:39:24 +02:00
1e116e6c17
Removed need for -Wnocast-qual on modern Clang/Xcode as a token of good behavior. Unfortunately the old stb_ decompress code is a little const clunky. + warning fix in stb_textedit which is already in master afaik.
omar2018-04-03 23:18:43 +02:00
84fbc49403
BeginChild: named child don't include the full id inside their name (#1698)
omar2018-04-03 22:13:35 +02:00
78610a54d2
Fixed Clang zealous cast-call warning (on par with GCC) which decided to warn against explicit C-style casts now.
omar2018-04-03 20:55:30 +02:00