mirror of
				https://github.com/Drezil/imgui.git
				synced 2025-10-31 13:11:05 +01:00 
			
		
		
		
	Merge branch 'master' into viewport
# Conflicts: # imgui.cpp # imgui.h # imgui_internal.h
This commit is contained in:
		
							
								
								
									
										41
									
								
								imgui.cpp
									
									
									
									
									
								
							
							
						
						
									
										41
									
								
								imgui.cpp
									
									
									
									
									
								
							| @@ -374,6 +374,8 @@ CODE | ||||
|  - 2018/XX/XX (1.XX) - removed io.DisplayVisibleMin, io.DisplayVisibleMax settings (they were used to clip within the (0,0)..DisplaySize range, I don't know of anyone using it) | ||||
|  | ||||
|  | ||||
|  - 2019/01/06 (1.67) - renamed io.InputCharacters[], marked internal as was always intended. Please don't access directly, and use AddInputCharacter() instead! | ||||
|  - 2019/01/06 (1.67) - renamed ImFontAtlas::GlyphRangesBuilder to ImFontGlyphRangesBuilder. Keep redirection typedef (will obsolete). | ||||
|  - 2018/12/10 (1.67) - renamed io.ConfigResizeWindowsFromEdges to io.ConfigWindowsResizeFromEdges as we are doing a large pass on configuration flags. | ||||
|  - 2018/10/12 (1.66) - renamed misc/stl/imgui_stl.* to misc/cpp/imgui_stdlib.* in prevision for other C++ helper files. | ||||
|  - 2018/09/28 (1.66) - renamed SetScrollHere() to SetScrollHereY(). Kept redirection function (will obsolete). | ||||
| @@ -390,6 +392,9 @@ CODE | ||||
|  - 2018/08/01 (1.63) - renamed io.OptCursorBlink to io.ConfigCursorBlink [-> io.ConfigInputTextCursorBlink in 1.65], io.OptMacOSXBehaviors to ConfigMacOSXBehaviors for consistency. | ||||
|  - 2018/07/22 (1.63) - changed ImGui::GetTime() return value from float to double to avoid accumulating floating point imprecisions over time. | ||||
|  - 2018/07/08 (1.63) - style: renamed ImGuiCol_ModalWindowDarkening to ImGuiCol_ModalWindowDimBg for consistency with other features. Kept redirection enum (will obsolete). | ||||
|  - 2018/06/08 (1.62) - examples: the imgui_impl_xxx files have been split to separate platform (Win32, Glfw, SDL2, etc.) from renderer (DX11, OpenGL, Vulkan,  etc.). | ||||
|                        old binding will still work as is, however prefer using the separated bindings as they will be updated to be multi-viewport conformant. | ||||
|                        when adopting new bindings follow the main.cpp code of your preferred examples/ folder to know which functions to call. | ||||
|  - 2018/06/06 (1.62) - renamed GetGlyphRangesChinese() to GetGlyphRangesChineseFull() to distinguish other variants and discourage using the full set. | ||||
|  - 2018/06/06 (1.62) - TreeNodeEx()/TreeNodeBehavior(): the ImGuiTreeNodeFlags_CollapsingHeader helper now include the ImGuiTreeNodeFlags_NoTreePushOnOpen flag. See Changelog for details.  | ||||
|  - 2018/05/03 (1.61) - DragInt(): the default compile-time format string has been changed from "%.0f" to "%d", as we are not using integers internally any more. | ||||
| @@ -438,6 +443,7 @@ CODE | ||||
|                        removed the IsItemRectHovered()/IsWindowRectHovered() names introduced in 1.51 since they were merely more consistent names for the two functions we are now obsoleting. | ||||
|  - 2017/10/17 (1.52) - marked the old 5-parameters version of Begin() as obsolete (still available). Use SetNextWindowSize()+Begin() instead! | ||||
|  - 2017/10/11 (1.52) - renamed AlignFirstTextHeightToWidgets() to AlignTextToFramePadding(). Kept inline redirection function (will obsolete). | ||||
|  - 2017/09/26 (1.52) - renamed ImFont::Glyph to ImFontGlyph. Keep redirection typedef (will obsolete). | ||||
|  - 2017/09/25 (1.52) - removed SetNextWindowPosCenter() because SetNextWindowPos() now has the optional pivot information to do the same and more. Kept redirection function (will obsolete). | ||||
|  - 2017/08/25 (1.52) - io.MousePos needs to be set to ImVec2(-FLT_MAX,-FLT_MAX) when mouse is unavailable/missing. Previously ImVec2(-1,-1) was enough but we now accept negative mouse coordinates. In your binding if you need to support unavailable mouse, make sure to replace "io.MousePos = ImVec2(-1,-1)" with "io.MousePos = ImVec2(-FLT_MAX,-FLT_MAX)". | ||||
|  - 2017/08/22 (1.51) - renamed IsItemHoveredRect() to IsItemRectHovered(). Kept inline redirection function (will obsolete). -> (1.52) use IsItemHovered(ImGuiHoveredFlags_RectOnly)! | ||||
| @@ -829,7 +835,7 @@ CODE | ||||
|  | ||||
|       // Or create your own custom ranges (e.g. for a game you can feed your entire game script and only build the characters the game need) | ||||
|       ImVector<ImWchar> ranges; | ||||
|       ImFontAtlas::GlyphRangesBuilder builder; | ||||
|       ImFontGlyphRangesBuilder builder; | ||||
|       builder.AddText("Hello world");                        // Add a string (here "Hello world" contains 7 unique characters) | ||||
|       builder.AddChar(0x7262);                               // Add a specific character | ||||
|       builder.AddRanges(io.Fonts->GetGlyphRangesJapanese()); // Add one of the default ranges | ||||
| @@ -1186,22 +1192,23 @@ ImGuiIO::ImGuiIO() | ||||
| // - on Windows you can get those using ToAscii+keyboard state, or via the WM_CHAR message | ||||
| void ImGuiIO::AddInputCharacter(ImWchar c) | ||||
| { | ||||
|     const int n = ImStrlenW(InputCharacters); | ||||
|     if (n + 1 < IM_ARRAYSIZE(InputCharacters)) | ||||
|     { | ||||
|         InputCharacters[n] = c; | ||||
|         InputCharacters[n+1] = '\0'; | ||||
|     } | ||||
|     InputQueueCharacters.push_back(c); | ||||
| } | ||||
|  | ||||
| void ImGuiIO::AddInputCharactersUTF8(const char* utf8_chars) | ||||
| { | ||||
|     // We can't pass more wchars than ImGuiIO::InputCharacters[] can hold so don't convert more | ||||
|     const int wchars_buf_len = sizeof(ImGuiIO::InputCharacters) / sizeof(ImWchar); | ||||
|     ImWchar wchars[wchars_buf_len]; | ||||
|     ImTextStrFromUtf8(wchars, wchars_buf_len, utf8_chars, NULL); | ||||
|     for (int i = 0; i < wchars_buf_len && wchars[i] != 0; i++) | ||||
|         AddInputCharacter(wchars[i]); | ||||
|     while (*utf8_chars != 0) | ||||
|     { | ||||
|         unsigned int c = 0; | ||||
|         utf8_chars += ImTextCharFromUtf8(&c, utf8_chars, NULL); | ||||
|         if (c > 0 && c <= 0xFFFF) | ||||
|             InputQueueCharacters.push_back((ImWchar)c); | ||||
|     } | ||||
| } | ||||
|  | ||||
| void ImGuiIO::ClearInputCharacters() | ||||
| { | ||||
|     InputQueueCharacters.resize(0); | ||||
| } | ||||
|  | ||||
| //----------------------------------------------------------------------------- | ||||
| @@ -2560,6 +2567,7 @@ void ImGui::SetActiveID(ImGuiID id, ImGuiWindow* window) | ||||
|     } | ||||
| } | ||||
|  | ||||
| // FIXME-NAV: The existence of SetNavID/SetNavIDWithRectRel/SetFocusID is incredibly messy and confusing and needs some explanation or refactoring. | ||||
| void ImGui::SetFocusID(ImGuiID id, ImGuiWindow* window) | ||||
| { | ||||
|     ImGuiContext& g = *GImGui; | ||||
| @@ -3898,7 +3906,7 @@ void ImGui::EndFrame() | ||||
|  | ||||
|     // Clear Input data for next frame | ||||
|     g.IO.MouseWheel = g.IO.MouseWheelH = 0.0f; | ||||
|     memset(g.IO.InputCharacters, 0, sizeof(g.IO.InputCharacters)); | ||||
|     g.IO.InputQueueCharacters.resize(0); | ||||
|     memset(g.IO.NavInputs, 0, sizeof(g.IO.NavInputs)); | ||||
| } | ||||
|  | ||||
| @@ -5160,6 +5168,7 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags) | ||||
|         // Position child window | ||||
|         if (flags & ImGuiWindowFlags_ChildWindow) | ||||
|         { | ||||
|             IM_ASSERT(parent_window->Active); | ||||
|             window->BeginOrderWithinParent = (short)parent_window->DC.ChildWindows.Size; | ||||
|             parent_window->DC.ChildWindows.push_back(window); | ||||
|             if (!(flags & ImGuiWindowFlags_Popup) && !window_pos_set_by_api && !window_is_child_tooltip) | ||||
| @@ -6936,7 +6945,7 @@ void ImGui::OpenPopupEx(ImGuiID id) | ||||
|     popup_ref.OpenPopupPos = NavCalcPreferredRefPos(); | ||||
|     popup_ref.OpenMousePos = IsMousePosValid(&g.IO.MousePos) ? g.IO.MousePos : popup_ref.OpenPopupPos; | ||||
|  | ||||
|     //printf("[%05d] OpenPopupEx(0x%08X)\n", g.FrameCount, id); | ||||
|     //IMGUI_DEBUG_LOG("OpenPopupEx(0x%08X)\n", g.FrameCount, id); | ||||
|     if (g.OpenPopupStack.Size < current_stack_size + 1) | ||||
|     { | ||||
|         g.OpenPopupStack.push_back(popup_ref); | ||||
| @@ -8437,7 +8446,7 @@ static void ImGui::NavUpdate() | ||||
|     ImGuiContext& g = *GImGui; | ||||
|     g.IO.WantSetMousePos = false; | ||||
| #if 0 | ||||
|     if (g.NavScoringCount > 0) printf("[%05d] NavScoringCount %d for '%s' layer %d (Init:%d, Move:%d)\n", g.FrameCount, g.NavScoringCount, g.NavWindow ? g.NavWindow->Name : "NULL", g.NavLayer, g.NavInitRequest || g.NavInitResultId != 0, g.NavMoveRequest); | ||||
|     if (g.NavScoringCount > 0) IMGUI_DEBUG_LOG("NavScoringCount %d for '%s' layer %d (Init:%d, Move:%d)\n", g.FrameCount, g.NavScoringCount, g.NavWindow ? g.NavWindow->Name : "NULL", g.NavLayer, g.NavInitRequest || g.NavInitResultId != 0, g.NavMoveRequest); | ||||
| #endif | ||||
|  | ||||
|     // Set input source as Gamepad when buttons are pressed before we map Keyboard (some features differs when used with Gamepad vs Keyboard) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user