Lines Matching defs:window
129 ImGuiWindow* window = GetCurrentWindow();
130 if (window->SkipItems)
139 const ImVec2 text_pos(window->DC.CursorPos.x, window->DC.CursorPos.y + window->DC.CurrentLineTextBaseOffset);
140 const float wrap_pos_x = window->DC.TextWrapPos;
151 const ImRect clip_rect = window->ClipRect;
220 const float wrap_width = wrap_enabled ? CalcWrapWidthForPos(window->DC.CursorPos, wrap_pos_x) : 0.0f;
244 ImGuiWindow* window = GetCurrentWindow();
245 if (window->SkipItems)
312 ImGuiWindow* window = GetCurrentWindow();
313 if (window->SkipItems)
321 const ImRect value_bb(window->DC.CursorPos, window->DC.CursorPos + ImVec2(w, label_size.y + style.FramePadding.y*2));
322 const ImRect total_bb(window->DC.CursorPos, window->DC.CursorPos + ImVec2(w + (label_size.x > 0.0f ? style.ItemInnerSpacing.x : 0.0f), style.FramePadding.y*2) + label_size);
346 ImGuiWindow* window = GetCurrentWindow();
347 if (window->SkipItems)
356 const float text_base_offset_y = ImMax(0.0f, window->DC.CurrentLineTextBaseOffset); // Latch before ItemSize changes it
357 const float line_height = ImMax(ImMin(window->DC.CurrentLineSize.y, g.FontSize + g.Style.FramePadding.y*2), g.FontSize);
358 const ImRect bb(window->DC.CursorPos, window->DC.CursorPos + ImVec2(g.FontSize + (label_size.x > 0.0f ? (label_size.x + style.FramePadding.x*2) : 0.0f), ImMax(line_height, label_size.y))); // Empty text doesn't add padding
391 ImGuiWindow* window = GetCurrentWindow();
406 if ((flags & ImGuiButtonFlags_FlattenChildren) && g.HoveredRootWindow == window)
407 g.HoveredWindow = window;
410 if (id != 0 && window->DC.LastItemId != id)
430 FocusWindow(window);
434 if ((flags & ImGuiButtonFlags_FlattenChildren) && g.HoveredRootWindow == window)
454 SetActiveID(id, window);
456 SetFocusID(id, window);
457 FocusWindow(window);
465 SetActiveID(id, window); // Hold on ID
466 FocusWindow(window);
487 if (g.NavId == id && !g.NavDisableHighlight && g.NavDisableMouseHover && (g.ActiveId == 0 || g.ActiveId == id || g.ActiveId == window->MoveId))
500 SetActiveID(id, window);
502 SetFocusID(id, window);
546 ImGuiWindow* window = GetCurrentWindow();
547 if (window->SkipItems)
552 const ImGuiID id = window->GetID(label);
555 ImVec2 pos = window->DC.CursorPos;
556 if ((flags & ImGuiButtonFlags_AlignTextBaseLine) && style.FramePadding.y < window->DC.CurrentLineTextBaseOffset) // Try to vertically align buttons that are smaller/have no padding so that text baseline matches (bit hacky, since it shouldn't be a flag)
557 pos.y += window->DC.CurrentLineTextBaseOffset - style.FramePadding.y;
565 if (window->DC.ItemFlags & ImGuiItemFlags_ButtonRepeat)
579 //if (pressed && !(flags & ImGuiButtonFlags_DontClosePopups) && (window->Flags & ImGuiWindowFlags_Popup))
582 IMGUI_TEST_ENGINE_ITEM_INFO(id, label, window->DC.LastItemStatusFlags);
606 ImGuiWindow* window = GetCurrentWindow();
607 if (window->SkipItems)
613 const ImGuiID id = window->GetID(str_id);
615 const ImRect bb(window->DC.CursorPos, window->DC.CursorPos + size);
628 ImGuiWindow* window = GetCurrentWindow();
629 if (window->SkipItems)
633 const ImGuiID id = window->GetID(str_id);
634 const ImRect bb(window->DC.CursorPos, window->DC.CursorPos + size);
640 if (window->DC.ItemFlags & ImGuiItemFlags_ButtonRepeat)
661 // Button to close a window
665 ImGuiWindow* window = g.CurrentWindow;
667 // We intentionally allow interaction when clipped so that a mechanical Alt,Right,Validate sequence close a window.
680 window->DrawList->AddCircleFilled(center, ImMax(2.0f, radius), GetColorU32(held ? ImGuiCol_ButtonActive : ImGuiCol_ButtonHovered), 9);
685 window->DrawList->AddLine(center + ImVec2(+cross_extent,+cross_extent), center + ImVec2(-cross_extent,-cross_extent), cross_col, 1.0f);
686 window->DrawList->AddLine(center + ImVec2(+cross_extent,-cross_extent), center + ImVec2(-cross_extent,+cross_extent), cross_col, 1.0f);
694 ImGuiWindow* window = g.CurrentWindow;
703 window->DrawList->AddCircleFilled(bb.GetCenter() + ImVec2(0.0f, -0.5f), g.FontSize * 0.5f + 1.0f, col, 9);
704 RenderArrow(bb.Min + g.Style.FramePadding, window->Collapsed ? ImGuiDir_Right : ImGuiDir_Down, 1.0f);
706 // Switch to moving the window after mouse is moved beyond the initial drag threshold
708 StartMouseMovingWindow(window);
716 ImGuiWindow* window = g.CurrentWindow;
717 return window->GetID((direction == ImGuiLayoutType_Horizontal) ? "#SCROLLX" : "#SCROLLY");
723 // - We store values as normalized ratio and in a form that allows the window content to change while we are holding on a scrollbar
728 ImGuiWindow* window = g.CurrentWindow;
735 bool other_scrollbar = (horizontal ? window->ScrollbarY : window->ScrollbarX);
737 const ImRect window_rect = window->Rect();
738 const float border_size = window->WindowBorderSize;
740 ? ImRect(window->Pos.x + border_size, window_rect.Max.y - style.ScrollbarSize, window_rect.Max.x - other_scrollbar_size_w - border_size, window_rect.Max.y - border_size)
741 : ImRect(window_rect.Max.x - style.ScrollbarSize, window->Pos.y + border_size, window_rect.Max.x - border_size, window_rect.Max.y - other_scrollbar_size_w - border_size);
743 bb.Min.y += window->TitleBarHeight() + ((window->Flags & ImGuiWindowFlags_MenuBar) ? window->MenuBarHeight() : 0.0f);
749 // When we are too small, start hiding and disabling the grab (this reduce visual noise on very small window and facilitate using the resize grab)
763 window_rounding_corners = (((window->Flags & ImGuiWindowFlags_NoTitleBar) && !(window->Flags & ImGuiWindowFlags_MenuBar)) ? ImDrawCornerFlags_TopRight : 0) | (other_scrollbar ? 0 : ImDrawCornerFlags_BotRight);
764 window->DrawList->AddRectFilled(bb.Min, bb.Max, GetColorU32(ImGuiCol_ScrollbarBg), window->WindowRounding, window_rounding_corners);
769 float scroll_v = horizontal ? window->Scroll.x : window->Scroll.y;
770 float win_size_avail_v = (horizontal ? window->SizeFull.x : window->SizeFull.y) - other_scrollbar_size_w;
771 float win_size_contents_v = horizontal ? window->SizeContents.x : window->SizeContents.y;
819 window->Scroll.x = scroll_v;
821 window->Scroll.y = scroll_v;
839 window->DrawList->AddRectFilled(grab_rect.Min, grab_rect.Max, grab_col, style.ScrollbarRounding);
844 ImGuiWindow* window = GetCurrentWindow();
845 if (window->SkipItems)
848 ImRect bb(window->DC.CursorPos, window->DC.CursorPos + size);
857 window->DrawList->AddRect(bb.Min, bb.Max, GetColorU32(border_col), 0.0f);
858 window->DrawList->AddImage(user_texture_id, bb.Min + ImVec2(1, 1), bb.Max - ImVec2(1, 1), uv0, uv1, GetColorU32(tint_col));
862 window->DrawList->AddImage(user_texture_id, bb.Min, bb.Max, uv0, uv1, GetColorU32(tint_col));
872 ImGuiWindow* window = GetCurrentWindow();
873 if (window->SkipItems)
882 const ImGuiID id = window->GetID("#image");
886 const ImRect bb(window->DC.CursorPos, window->DC.CursorPos + size + padding * 2);
887 const ImRect image_bb(window->DC.CursorPos + padding, window->DC.CursorPos + padding + size);
900 window->DrawList->AddRectFilled(image_bb.Min, image_bb.Max, GetColorU32(bg_col));
901 window->DrawList->AddImage(user_texture_id, image_bb.Min, image_bb.Max, uv0, uv1, GetColorU32(tint_col));
908 ImGuiWindow* window = GetCurrentWindow();
909 if (window->SkipItems)
914 const ImGuiID id = window->GetID(label);
918 const ImVec2 pos = window->DC.CursorPos;
946 IMGUI_TEST_ENGINE_ITEM_INFO(id, label, window->DC.ItemFlags | ImGuiItemStatusFlags_Checkable | (*v ? ImGuiItemStatusFlags_Checked : 0));
967 ImGuiWindow* window = GetCurrentWindow();
968 if (window->SkipItems)
973 const ImGuiID id = window->GetID(label);
977 const ImVec2 pos = window->DC.CursorPos;
995 window->DrawList->AddCircleFilled(center, radius, GetColorU32((held && hovered) ? ImGuiCol_FrameBgActive : hovered ? ImGuiCol_FrameBgHovered : ImGuiCol_FrameBg), 16);
999 window->DrawList->AddCircleFilled(center, radius - pad, GetColorU32(ImGuiCol_CheckMark), 16);
1004 window->DrawList->AddCircle(center + ImVec2(1,1), radius, GetColorU32(ImGuiCol_BorderShadow), 16, style.FrameBorderSize);
1005 window->DrawList->AddCircle(center, radius, GetColorU32(ImGuiCol_Border), 16, style.FrameBorderSize);
1027 ImGuiWindow* window = GetCurrentWindow();
1028 if (window->SkipItems)
1034 ImVec2 pos = window->DC.CursorPos;
1045 RenderRectFilledRangeH(window->DrawList, bb, GetColorU32(ImGuiCol_PlotHistogram), 0.0f, fraction, style.FrameRounding);
1062 ImGuiWindow* window = GetCurrentWindow();
1063 if (window->SkipItems)
1068 const float line_height = ImMax(ImMin(window->DC.CurrentLineSize.y, g.FontSize + g.Style.FramePadding.y*2), g.FontSize);
1069 const ImRect bb(window->DC.CursorPos, window->DC.CursorPos + ImVec2(g.FontSize, line_height));
1096 ImGuiWindow* window = GetCurrentWindow();
1097 if (window->SkipItems)
1104 ImGuiWindow* window = GetCurrentWindow();
1105 if (window->SkipItems)
1108 const ImRect bb(window->DC.CursorPos, window->DC.CursorPos + size);
1115 ImGuiWindow* window = GetCurrentWindow();
1116 if (window->SkipItems)
1120 const ImGuiLayoutType backup_layout_type = window->DC.LayoutType;
1121 window->DC.LayoutType = ImGuiLayoutType_Vertical;
1122 if (window->DC.CurrentLineSize.y > 0.0f) // In the event that we are on a line with items that is smaller that FontSize high, we will preserve its height.
1126 window->DC.LayoutType = backup_layout_type;
1131 ImGuiWindow* window = GetCurrentWindow();
1132 if (window->SkipItems)
1136 window->DC.CurrentLineSize.y = ImMax(window->DC.CurrentLineSize.y, g.FontSize + g.Style.FramePadding.y * 2);
1137 window->DC.CurrentLineTextBaseOffset = ImMax(window->DC.CurrentLineTextBaseOffset, g.Style.FramePadding.y);
1143 ImGuiWindow* window = GetCurrentWindow();
1144 if (window->SkipItems)
1149 ImGuiSeparatorFlags flags = (window->DC.LayoutType == ImGuiLayoutType_Horizontal) ? ImGuiSeparatorFlags_Vertical : ImGuiSeparatorFlags_Horizontal;
1158 if (window->DC.ColumnsSet)
1161 float x1 = window->Pos.x;
1162 float x2 = window->Pos.x + window->Size.x;
1163 if (!window->DC.GroupStack.empty())
1164 x1 += window->DC.Indent.x;
1166 const ImRect bb(ImVec2(x1, window->DC.CursorPos.y), ImVec2(x2, window->DC.CursorPos.y+1.0f));
1170 if (window->DC.ColumnsSet)
1175 window->DrawList->AddLine(bb.Min, ImVec2(bb.Max.x,bb.Min.y), GetColorU32(ImGuiCol_Separator));
1180 if (window->DC.ColumnsSet)
1183 window->DC.ColumnsSet->LineMinY = window->DC.CursorPos.y;
1189 ImGuiWindow* window = GetCurrentWindow();
1190 if (window->SkipItems)
1194 float y1 = window->DC.CursorPos.y;
1195 float y2 = window->DC.CursorPos.y + window->DC.CurrentLineSize.y;
1196 const ImRect bb(ImVec2(window->DC.CursorPos.x, y1), ImVec2(window->DC.CursorPos.x + 1.0f, y2));
1201 window->DrawList->AddLine(ImVec2(bb.Min.x, bb.Min.y), ImVec2(bb.Min.x, bb.Max.y), GetColorU32(ImGuiCol_Separator));
1210 ImGuiWindow* window = g.CurrentWindow;
1212 const ImGuiItemFlags item_flags_backup = window->DC.ItemFlags;
1213 window->DC.ItemFlags |= ImGuiItemFlags_NoNav | ImGuiItemFlags_NoNavDefaultFocus;
1215 window->DC.ItemFlags = item_flags_backup;
1259 window->DrawList->AddRectFilled(bb_render.Min, bb_render.Max, col, g.Style.FrameRounding);
1287 ImGuiWindow* window = GetCurrentWindow();
1288 if (window->SkipItems)
1294 const ImGuiID id = window->GetID(label);
1299 const ImRect frame_bb(window->DC.CursorPos, window->DC.CursorPos + ImVec2(w, label_size.y + style.FramePadding.y*2.0f));
1313 window->DrawList->AddRectFilled(frame_bb.Min, ImVec2(frame_bb.Max.x - arrow_size, frame_bb.Max.y), frame_col, style.FrameRounding, ImDrawCornerFlags_Left);
1316 window->DrawList->AddRectFilled(ImVec2(frame_bb.Max.x - arrow_size, frame_bb.Min.y), frame_bb.Max, GetColorU32((popup_open || hovered) ? ImGuiCol_ButtonHovered : ImGuiCol_Button), style.FrameRounding, (w <= arrow_size) ? ImDrawCornerFlags_All : ImDrawCornerFlags_Right);
1327 if (window->DC.NavLayerCurrent == 0)
1328 window->NavLastIds[0] = id;
1356 // Peak into expected window size so we can position it
1863 ImGuiWindow* window = GetCurrentWindow();
1864 if (window->SkipItems)
1872 const ImGuiID id = window->GetID(label);
1876 const ImRect frame_bb(window->DC.CursorPos, window->DC.CursorPos + ImVec2(w, label_size.y + style.FramePadding.y*2.0f));
1895 const bool tab_focus_requested = FocusableItemRegister(window, id);
1898 SetActiveID(id, window);
1899 SetFocusID(id, window);
1900 FocusWindow(window);
1910 window->DC.CursorPos = frame_bb.Min;
1911 FocusableItemUnregister(window);
1933 IMGUI_TEST_ENGINE_ITEM_INFO(id, label, window->DC.ItemFlags);
1939 ImGuiWindow* window = GetCurrentWindow();
1940 if (window->SkipItems)
1987 ImGuiWindow* window = GetCurrentWindow();
1988 if (window->SkipItems)
2032 ImGuiWindow* window = GetCurrentWindow();
2033 if (window->SkipItems)
2299 ImGuiWindow* window = GetCurrentWindow();
2300 if (window->SkipItems)
2305 const ImGuiID id = window->GetID(label);
2309 const ImRect frame_bb(window->DC.CursorPos, window->DC.CursorPos + ImVec2(w, label_size.y + style.FramePadding.y*2.0f));
2326 const bool tab_focus_requested = FocusableItemRegister(window, id);
2330 SetActiveID(id, window);
2331 SetFocusID(id, window);
2332 FocusWindow(window);
2342 window->DC.CursorPos = frame_bb.Min;
2343 FocusableItemUnregister(window);
2359 window->DrawList->AddRectFilled(grab_bb.Min, grab_bb.Max, GetColorU32(g.ActiveId == id ? ImGuiCol_SliderGrabActive : ImGuiCol_SliderGrab), style.GrabRounding);
2369 IMGUI_TEST_ENGINE_ITEM_INFO(id, label, window->DC.ItemFlags);
2376 ImGuiWindow* window = GetCurrentWindow();
2377 if (window->SkipItems)
2454 ImGuiWindow* window = GetCurrentWindow();
2455 if (window->SkipItems)
2460 const ImGuiID id = window->GetID(label);
2463 const ImRect frame_bb(window->DC.CursorPos, window->DC.CursorPos + size);
2481 SetActiveID(id, window);
2482 SetFocusID(id, window);
2483 FocusWindow(window);
2499 window->DrawList->AddRectFilled(grab_bb.Min, grab_bb.Max, GetColorU32(g.ActiveId == id ? ImGuiCol_SliderGrabActive : ImGuiCol_SliderGrab), style.GrabRounding);
2646 ImGuiWindow* window = GetCurrentWindow();
2647 if (window->SkipItems)
2709 ImGuiWindow* window = GetCurrentWindow();
2710 if (window->SkipItems)
3131 ImGuiWindow* window = GetCurrentWindow();
3132 if (window->SkipItems)
3152 const ImGuiID id = window->GetID(label);
3155 const ImRect frame_bb(window->DC.CursorPos, window->DC.CursorPos + size);
3158 ImGuiWindow* draw_window = window;
3207 const bool focus_requested = FocusableItemRegister(window, id, (flags & (ImGuiInputTextFlags_CallbackCompletion|ImGuiInputTextFlags_AllowTabInput)) == 0); // Using completion callback disable keyboard tabbing
3208 const bool focus_requested_by_code = focus_requested && (window->FocusIdxAllCounter == window->FocusIdxAllRequestCurrent);
3257 SetActiveID(id, window);
3258 SetFocusID(id, window);
3259 FocusWindow(window);
3798 IMGUI_TEST_ENGINE_ITEM_INFO(id, label, window->DC.ItemFlags);
3830 ImGuiWindow* window = GetCurrentWindow();
3831 if (window->SkipItems)
3959 SetNextWindowPos(window->DC.LastItemRect.GetBL() + ImVec2(-1,style.ItemSpacing.y));
4011 if ((window->DC.LastItemStatusFlags & ImGuiItemStatusFlags_HoveredRect) && !(flags & ImGuiColorEditFlags_NoDragDrop) && BeginDragDropTarget())
4028 window->DC.LastItemId = g.ActiveId;
4031 MarkItemEdited(window->DC.LastItemId);
4059 ImGuiWindow* window = GetCurrentWindow();
4064 window->DrawList->AddRectFilled(p_min, p_max, col_bg1, rounding, rounding_corners_flags);
4081 window->DrawList->AddRectFilled(ImVec2(x1,y1), ImVec2(x2,y2), col_bg2, rounding_corners_flags_cell ? rounding : 0.0f, rounding_corners_flags_cell);
4087 window->DrawList->AddRectFilled(p_min, p_max, col, rounding, rounding_corners_flags);
4105 ImGuiWindow* window = GetCurrentWindow();
4106 ImDrawList* draw_list = window->DrawList;
4131 ImVec2 picker_pos = window->DC.CursorPos;
4400 MarkItemEdited(window->DC.LastItemId);
4412 ImGuiWindow* window = GetCurrentWindow();
4413 if (window->SkipItems)
4417 const ImGuiID id = window->GetID(desc_id);
4423 const ImRect bb(window->DC.CursorPos, window->DC.CursorPos + size);
4444 window->DrawList->AddRectFilled(bb_inner.Min, ImVec2(mid_x, bb_inner.Max.y), GetColorU32(col_without_alpha), rounding, ImDrawCornerFlags_TopLeft|ImDrawCornerFlags_BotLeft);
4453 window->DrawList->AddRectFilled(bb_inner.Min, bb_inner.Max, GetColorU32(col_source), rounding, ImDrawCornerFlags_All);
4459 window->DrawList->AddRect(bb.Min, bb.Max, GetColorU32(ImGuiCol_FrameBg), rounding); // Color button are often in need of some sort of border
4647 ImGuiWindow* window = GetCurrentWindow();
4648 if (window->SkipItems)
4650 return TreeNodeBehavior(window->GetID(label), 0, label, NULL);
4665 ImGuiWindow* window = GetCurrentWindow();
4666 if (window->SkipItems)
4669 return TreeNodeBehavior(window->GetID(label), flags, label, NULL);
4692 ImGuiWindow* window = GetCurrentWindow();
4693 if (window->SkipItems)
4698 return TreeNodeBehavior(window->GetID(str_id), flags, g.TempBuffer, label_end);
4703 ImGuiWindow* window = GetCurrentWindow();
4704 if (window->SkipItems)
4709 return TreeNodeBehavior(window->GetID(ptr_id), flags, g.TempBuffer, label_end);
4719 ImGuiWindow* window = g.CurrentWindow;
4720 ImGuiStorage* storage = window->DC.StateStorage;
4753 if (g.LogEnabled && !(flags & ImGuiTreeNodeFlags_NoAutoOpenOnLog) && window->DC.TreeDepth < g.LogAutoExpandMaxDepth)
4761 ImGuiWindow* window = GetCurrentWindow();
4762 if (window->SkipItems)
4775 const float text_base_offset_y = ImMax(padding.y, window->DC.CurrentLineTextBaseOffset); // Latch before ItemSize changes it
4776 const float frame_height = ImMax(ImMin(window->DC.CurrentLineSize.y, g.FontSize + style.FramePadding.y*2), label_size.y + padding.y*2);
4777 ImRect frame_bb = ImRect(window->DC.CursorPos, ImVec2(window->Pos.x + GetContentRegionMax().x, window->DC.CursorPos.y + frame_height));
4781 frame_bb.Min.x -= (float)(int)(window->WindowPadding.x*0.5f) - 1;
4782 frame_bb.Max.x += (float)(int)(window->WindowPadding.x*0.5f) - 1;
4799 window->DC.TreeDepthMayJumpToParentOnPop |= (1 << window->DC.TreeDepth);
4802 window->DC.LastItemStatusFlags |= ImGuiItemStatusFlags_HasDisplayRect;
4803 window->DC.LastItemDisplayRect = frame_bb;
4809 IMGUI_TEST_ENGINE_ITEM_INFO(window->DC.LastItemId, label, window->DC.ItemFlags | (is_leaf ? 0 : ImGuiItemStatusFlags_Openable) | (is_open ? ImGuiItemStatusFlags_Opened : 0));
4857 window->DC.StateStorage->SetInt(id, is_open);
4907 IMGUI_TEST_ENGINE_ITEM_INFO(id, label, window->DC.ItemFlags | (is_leaf ? 0 : ImGuiItemStatusFlags_Openable) | (is_open ? ImGuiItemStatusFlags_Opened : 0));
4913 ImGuiWindow* window = GetCurrentWindow();
4915 window->DC.TreeDepth++;
4921 ImGuiWindow* window = GetCurrentWindow();
4923 window->DC.TreeDepth++;
4929 ImGuiWindow* window = GetCurrentWindow();
4931 window->DC.TreeDepth++;
4932 window->IDStack.push_back(id);
4938 ImGuiWindow* window = g.CurrentWindow;
4941 window->DC.TreeDepth--;
4942 if (g.NavMoveDir == ImGuiDir_Left && g.NavWindow == window && NavMoveRequestButNoResultYet())
4943 if (g.NavIdIsAlive && (window->DC.TreeDepthMayJumpToParentOnPop & (1 << window->DC.TreeDepth)))
4945 SetNavID(window->IDStack.back(), g.NavLayer);
4948 window->DC.TreeDepthMayJumpToParentOnPop &= (1 << window->DC.TreeDepth) - 1;
4950 IM_ASSERT(window->IDStack.Size > 1); // There should always be 1 element in the IDStack (pushed during window creation). If this triggers you called TreePop/PopID too much.
4980 ImGuiWindow* window = GetCurrentWindow();
4981 if (window->SkipItems)
4984 return TreeNodeBehavior(window->GetID(label), flags | ImGuiTreeNodeFlags_CollapsingHeader, label);
4989 ImGuiWindow* window = GetCurrentWindow();
4990 if (window->SkipItems)
4996 ImGuiID id = window->GetID(label);
5004 ImVec2 button_center = ImVec2(ImMin(window->DC.LastItemRect.Max.x, window->ClipRect.Max.x) - g.Style.FramePadding.x - button_radius, window->DC.LastItemRect.GetCenter().y);
5005 if (CloseButton(window->GetID((void*)((intptr_t)id+1)), button_center, button_radius))
5023 ImGuiWindow* window = GetCurrentWindow();
5024 if (window->SkipItems)
5030 if ((flags & ImGuiSelectableFlags_SpanAllColumns) && window->DC.ColumnsSet) // FIXME-OPT: Avoid if vertically clipped.
5033 ImGuiID id = window->GetID(label);
5036 ImVec2 pos = window->DC.CursorPos;
5037 pos.y += window->DC.CurrentLineTextBaseOffset;
5042 ImVec2 window_padding = window->WindowPadding;
5044 float w_draw = ImMax(label_size.x, window->Pos.x + max_x - window_padding.x - pos.x);
5061 if ((flags & ImGuiSelectableFlags_SpanAllColumns) && window->DC.ColumnsSet)
5080 if (!g.NavDisableMouseHover && g.NavWindow == window && g.NavLayer == window->DC.NavLayerCurrent)
5083 SetNavID(id, window->DC.NavLayerCurrent);
5096 if ((flags & ImGuiSelectableFlags_SpanAllColumns) && window->DC.ColumnsSet)
5107 if (pressed && (window->Flags & ImGuiWindowFlags_Popup) && !(flags & ImGuiSelectableFlags_DontClosePopups) && !(window->DC.ItemFlags & ImGuiItemFlags_SelectableDontClosePopup))
5132 // Tip: To have a list filling the entire window width, PushItemWidth(-1) and pass an non-visible label e.g. "##empty"
5135 ImGuiWindow* window = GetCurrentWindow();
5136 if (window->SkipItems)
5146 ImRect frame_bb(window->DC.CursorPos, window->DC.CursorPos + frame_size);
5148 window->DC.LastItemRect = bb; // Forward storage for ListBoxFooter.. dodgy.
5251 ImGuiWindow* window = GetCurrentWindow();
5252 if (window->SkipItems)
5257 const ImGuiID id = window->GetID(label);
5265 const ImRect frame_bb(window->DC.CursorPos, window->DC.CursorPos + frame_size);
5338 window->DrawList->AddLine(pos0, pos1, v_hovered == v1_idx ? col_hovered : col_base);
5344 window->DrawList->AddRectFilled(pos0, pos1, v_hovered == v1_idx ? col_hovered : col_base);
5513 // When the user has left the menu layer (typically: closed menus through activation of an item), we restore focus to the previous window
5523 ImGuiWindow* window = GetCurrentWindow();
5524 if (window->SkipItems)
5526 if (!(window->Flags & ImGuiWindowFlags_MenuBar))
5529 IM_ASSERT(!window->DC.MenuBarAppending);
5533 // We don't clip with current window clipping rectangle as it is already set to the area below. However we clip with window full rect.
5535 ImRect bar_rect = window->MenuBarRect();
5536 ImRect clip_rect(ImFloor(bar_rect.Min.x + 0.5f), ImFloor(bar_rect.Min.y + window->WindowBorderSize + 0.5f), ImFloor(ImMax(bar_rect.Min.x, bar_rect.Max.x - window->WindowRounding) + 0.5f), ImFloor(bar_rect.Max.y + 0.5f));
5537 clip_rect.ClipWith(window->OuterRectClipped);
5540 window->DC.CursorPos = ImVec2(bar_rect.Min.x + window->DC.MenuBarOffset.x, bar_rect.Min.y + window->DC.MenuBarOffset.y);
5541 window->DC.LayoutType = ImGuiLayoutType_Horizontal;
5542 window->DC.NavLayerCurrent = ImGuiNavLayer_Menu;
5543 window->DC.NavLayerCurrentMask = (1 << ImGuiNavLayer_Menu);
5544 window->DC.MenuBarAppending = true;
5551 ImGuiWindow* window = GetCurrentWindow();
5552 if (window->SkipItems)
5562 if (nav_earliest_child->ParentWindow == window && nav_earliest_child->DC.ParentLayoutType == ImGuiLayoutType_Horizontal && g.NavMoveRequestForward == ImGuiNavForward_None)
5565 // This involve a one-frame delay which isn't very problematic in this situation. We could remove it by scoring in advance for multiple window (probably not worth the hassle/cost)
5566 IM_ASSERT(window->DC.NavLayerActiveMaskNext & 0x02); // Sanity check
5567 FocusWindow(window);
5568 SetNavIDWithRectRel(window->NavLastIds[1], 1, window->NavRectRel[1]);
5576 IM_ASSERT(window->Flags & ImGuiWindowFlags_MenuBar);
5577 IM_ASSERT(window->DC.MenuBarAppending);
5580 window->DC.MenuBarOffset.x = window->DC.CursorPos.x - window->MenuBarRect().Min.x; // Save horizontal position so next append can reuse it. This is kinda equivalent to a per-layer CursorPos.
5581 window->DC.GroupStack.back().AdvanceCursor = false;
5583 window->DC.LayoutType = ImGuiLayoutType_Vertical;
5584 window->DC.NavLayerCurrent = ImGuiNavLayer_Main;
5585 window->DC.NavLayerCurrentMask = (1 << ImGuiNavLayer_Main);
5586 window->DC.MenuBarAppending = false;
5591 ImGuiWindow* window = GetCurrentWindow();
5592 if (window->SkipItems)
5597 const ImGuiID id = window->GetID(label);
5603 bool menuset_is_open = !(window->Flags & ImGuiWindowFlags_Popup) && (g.OpenPopupStack.Size > g.BeginPopupStack.Size && g.OpenPopupStack[g.BeginPopupStack.Size].OpenParentId == window->IDStack.back());
5606 g.NavWindow = window; // Odd hack to allow hovering across menus of a same menu-set (otherwise we wouldn't be able to hover parent)
5611 ImVec2 popup_pos, pos = window->DC.CursorPos;
5612 if (window->DC.LayoutType == ImGuiLayoutType_Horizontal)
5617 popup_pos = ImVec2(pos.x - 1.0f - (float)(int)(style.ItemSpacing.x * 0.5f), pos.y - style.FramePadding.y + window->MenuBarHeight());
5618 window->DC.CursorPos.x += (float)(int)(style.ItemSpacing.x * 0.5f);
5623 window->DC.CursorPos.x += (float)(int)(style.ItemSpacing.x * (-1.0f + 0.5f)); // -1 spacing to compensate the spacing added when Selectable() did a SameLine(). It would also work to call SameLine() ourselves after the PopStyleVar().
5629 float w = window->MenuColumns.DeclColumns(label_size.x, 0.0f, (float)(int)(g.FontSize * 1.20f)); // Feedback to next frame
5633 RenderArrow(pos + ImVec2(window->MenuColumns.Pos[2] + extra_w + g.FontSize * 0.30f, 0.0f), ImGuiDir_Right);
5637 const bool hovered = enabled && ItemHoverable(window->DC.LastItemRect, id);
5642 if (window->DC.LayoutType == ImGuiLayoutType_Vertical) // (window->Flags & (ImGuiWindowFlags_Popup|ImGuiWindowFlags_ChildMenu))
5646 if (g.HoveredWindow == window && g.OpenPopupStack.Size > g.BeginPopupStack.Size && g.OpenPopupStack[g.BeginPopupStack.Size].ParentWindow == window && !(window->Flags & ImGuiWindowFlags_MenuBar))
5653 ImVec2 tb = (window->Pos.x < next_window->Pos.x) ? next_window_rect.GetTL() : next_window_rect.GetTR();
5654 ImVec2 tc = (window->Pos.x < next_window->Pos.x) ? next_window_rect.GetBL() : next_window_rect.GetBR();
5656 ta.x += (window->Pos.x < next_window->Pos.x) ? -0.5f : +0.5f; // to avoid numerical issues
5660 //window->DrawList->PushClipRectFullScreen(); window->DrawList->AddTriangleFilled(ta, tb, tc, moving_within_opened_triangle ? IM_COL32(0,128,0,128) : IM_COL32(128,0,0,128)); window->DrawList->PopClipRect(); // Debug
5664 want_close = (menu_is_open && !hovered && g.HoveredWindow == window && g.HoveredIdPreviousFrame != 0 && g.HoveredIdPreviousFrame != id && !moving_within_opened_triangle);
5702 IMGUI_TEST_ENGINE_ITEM_INFO(id, label, window->DC.ItemFlags | ImGuiItemStatusFlags_Openable | (menu_is_open ? ImGuiItemStatusFlags_Opened : 0));
5720 if (window->Flags & (ImGuiWindowFlags_Popup|ImGuiWindowFlags_ChildMenu))
5734 ImGuiWindow* window = g.CurrentWindow;
5735 if (g.NavWindow && g.NavWindow->ParentWindow == window && g.NavMoveDir == ImGuiDir_Left && NavMoveRequestButNoResultYet() && window->DC.LayoutType == ImGuiLayoutType_Vertical)
5746 ImGuiWindow* window = GetCurrentWindow();
5747 if (window->SkipItems)
5752 ImVec2 pos = window->DC.CursorPos;
5757 if (window->DC.LayoutType == ImGuiLayoutType_Horizontal)
5762 window->DC.CursorPos.x += (float)(int)(style.ItemSpacing.x * 0.5f);
5766 window->DC.CursorPos.x += (float)(int)(style.ItemSpacing.x * (-1.0f + 0.5f)); // -1 spacing to compensate the spacing added when Selectable() did a SameLine(). It would also work to call SameLine() ourselves after the PopStyleVar().
5771 float w = window->MenuColumns.DeclColumns(label_size.x, shortcut_size.x, (float)(int)(g.FontSize * 1.20f)); // Feedback for next frame
5777 RenderText(pos + ImVec2(window->MenuColumns.Pos[1] + extra_w, 0.0f), shortcut, NULL, false);
5781 RenderCheckMark(pos + ImVec2(window->MenuColumns.Pos[2] + extra_w + g.FontSize * 0.40f, g.FontSize * 0.134f * 0.5f), GetColorU32(enabled ? ImGuiCol_Text : ImGuiCol_TextDisabled), g.FontSize * 0.866f);
5784 IMGUI_TEST_ENGINE_ITEM_INFO(window->DC.LastItemId, label, window->DC.ItemFlags | ImGuiItemStatusFlags_Checkable | (selected ? ImGuiItemStatusFlags_Checked : 0));
5866 ImGuiWindow* window = g.CurrentWindow;
5867 if (window->SkipItems)
5870 ImGuiID id = window->GetID(str_id);
5872 ImRect tab_bar_bb = ImRect(window->DC.CursorPos.x, window->DC.CursorPos.y, window->InnerClipRect.Max.x, window->DC.CursorPos.y + g.FontSize + g.Style.FramePadding.y * 2);
5880 ImGuiWindow* window = g.CurrentWindow;
5881 if (window->SkipItems)
5885 window->IDStack.push_back(tab_bar->ID);
5913 window->DC.CursorPos.x = tab_bar->BarRect.Min.x;
5919 const float separator_min_x = tab_bar->BarRect.Min.x - window->WindowPadding.x;
5920 const float separator_max_x = tab_bar->BarRect.Max.x + window->WindowPadding.x;
5921 window->DrawList->AddLine(ImVec2(separator_min_x, y), ImVec2(separator_max_x, y), col, 1.0f);
5929 ImGuiWindow* window = g.CurrentWindow;
5930 if (window->SkipItems)
5941 tab_bar->ContentsHeight = ImMax(window->DC.CursorPos.y - tab_bar->BarRect.Max.y, 0.0f);
5943 window->DC.CursorPos.y = tab_bar->BarRect.Max.y + tab_bar->ContentsHeight;
6032 // and we cannot wait for the next BeginTabItem() call. We cannot compute this width within TabBarAddTab() because font size depends on the active window.
6130 ImGuiWindow* window = GImGui->CurrentWindow;
6131 return window->GetID(label);
6207 ImGuiWindow* window = g.CurrentWindow;
6212 const ImVec2 backup_cursor_pos = window->DC.CursorPos;
6213 //window->DrawList->AddRect(ImVec2(tab_bar->BarRect.Max.x - scrolling_buttons_width, tab_bar->BarRect.Min.y), ImVec2(tab_bar->BarRect.Max.x, tab_bar->BarRect.Max.y), IM_COL32(255,0,0,255));
6216 bool want_clip_rect = !avail_bar_rect.Contains(ImRect(window->DC.CursorPos, window->DC.CursorPos + ImVec2(scrolling_buttons_width, 0.0f)));
6232 window->DC.CursorPos = ImVec2(tab_bar->BarRect.Max.x - scrolling_buttons_width, tab_bar->BarRect.Min.y);
6235 window->DC.CursorPos = ImVec2(tab_bar->BarRect.Max.x - scrolling_buttons_width + arrow_button_size.x, tab_bar->BarRect.Min.y);
6252 window->DC.CursorPos = backup_cursor_pos;
6261 ImGuiWindow* window = g.CurrentWindow;
6265 const ImVec2 backup_cursor_pos = window->DC.CursorPos;
6266 window->DC.CursorPos = ImVec2(tab_bar->BarRect.Min.x - g.Style.FramePadding.y, tab_bar->BarRect.Min.y);
6289 window->DC.CursorPos = backup_cursor_pos;
6346 ImGuiWindow* window = g.CurrentWindow;
6347 if (window->SkipItems)
6427 const ImVec2 backup_main_cursor_pos = window->DC.CursorPos;
6431 window->DC.CursorPos = tab_bar->BarRect.Min + ImVec2((float)(int)tab->Offset - tab_bar->ScrollingAnim, 0.0f);
6432 ImVec2 pos = window->DC.CursorPos;
6445 window->DC.CursorPos = backup_main_cursor_pos;
6487 display_draw_list = GetOverlayDrawList(window);
6493 ImDrawList* display_draw_list = window->DrawList;
6507 const ImGuiID close_button_id = p_open ? window->GetID((void*)((intptr_t)id + 1)) : 0;
6515 // Restore main window position so user can draw there
6518 window->DC.CursorPos = backup_main_cursor_pos;