Internals: Various renaming. e.g. NewFrameUpdateHoveredWindowAndCaptureFlags() to UpdateHoveredWindowAndCaptureFlags() + exposed UpdateMovingWindow() in imgui_internal.h.

This commit is contained in:
omar
2018-06-23 20:08:19 +02:00
parent 14ceaaf460
commit 79153cf19f
2 changed files with 9 additions and 9 deletions

View File

@ -441,7 +441,7 @@
Note: The 'io.WantCaptureMouse' is more accurate that any attempt to "check if the mouse is hovering a window" (don't do that!).
It handle mouse dragging correctly (both dragging that started over your application or over an imgui window) and handle e.g. modal windows blocking inputs.
Those flags are updated by ImGui::NewFrame(). Preferably read the flags after calling NewFrame() if you can afford it, but reading them before is also
perfectly fine, as the bool toggle fairly rarely. If you have on a touch device, you might find use for an early call to NewFrameUpdateHoveredWindowAndCaptureFlags().
perfectly fine, as the bool toggle fairly rarely. If you have on a touch device, you might find use for an early call to UpdateHoveredWindowAndCaptureFlags().
Note: Text input widget releases focus on "Return KeyDown", so the subsequent "Return KeyUp" event that your application receive will typically
have 'io.WantCaptureKeyboard=false'. Depending on your application logic it may or not be inconvenient. You might want to track which key-downs
were targeted for Dear ImGui, e.g. with an array of bool, and filter out the corresponding key-ups.)
@ -855,7 +855,6 @@ static void NavUpdate();
static void NavUpdateWindowing();
static void NavProcessItem(ImGuiWindow* window, const ImRect& nav_bb, const ImGuiID id);
static void UpdateMovingWindow();
static void UpdateMouseInputs();
static void UpdateManualResize(ImGuiWindow* window, const ImVec2& size_auto_fit, int* border_held, int resize_grip_count, ImU32 resize_grip_col[4]);
static void FocusFrontMostActiveWindow(ImGuiWindow* ignore_window);
@ -2070,7 +2069,7 @@ ImGuiWindow::ImGuiWindow(ImGuiContext* context, const char* name)
CollapseToggleWanted = false;
SkipItems = false;
Appearing = false;
CloseButton = false;
HasCloseButton = false;
BeginOrderWithinParent = -1;
BeginOrderWithinContext = -1;
BeginCount = 0;
@ -3503,7 +3502,7 @@ static void ImGui::NavUpdate()
#endif
}
static void ImGui::UpdateMovingWindow()
void ImGui::UpdateMovingWindow()
{
ImGuiContext& g = *GImGui;
if (g.MovingWindow != NULL)
@ -3592,7 +3591,7 @@ static void ImGui::UpdateMouseInputs()
}
// The reason this is exposed in imgui_internal.h is: on touch-based system that don't have hovering, we want to dispatch inputs to the right target (imgui vs imgui+app)
void ImGui::NewFrameUpdateHoveredWindowAndCaptureFlags()
void ImGui::UpdateHoveredWindowAndCaptureFlags()
{
ImGuiContext& g = *GImGui;
@ -3763,7 +3762,7 @@ void ImGui::NewFrame()
// Handle user moving window with mouse (at the beginning of the frame to avoid input lag or sheering)
UpdateMovingWindow();
NewFrameUpdateHoveredWindowAndCaptureFlags();
UpdateHoveredWindowAndCaptureFlags();
if (GetFrontMostPopupModal() != NULL)
g.ModalWindowDarkeningRatio = ImMin(g.ModalWindowDarkeningRatio + g.IO.DeltaTime * 6.0f, 1.0f);
@ -6030,7 +6029,7 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
window_just_activated_by_user |= (window != popup_ref.Window);
}
window->Appearing = (window_just_activated_by_user || window_just_appearing_after_hidden_for_resize);
window->CloseButton = (p_open != NULL);
window->HasCloseButton = (p_open != NULL);
if (window->Appearing)
SetWindowConditionAllowFlags(window, ImGuiCond_Appearing, true);