// Special handling for the 1st item after Begin() which represent the title bar. When the window is collapsed (SkipItems==true) that last item will never be overwritten so we need to detect tht case.
// Special handling for the dummy item after Begin() which represent the title bar or tab.
// When the window is collapsed (SkipItems==true) that last item will never be overwritten so we need to detect the case.
IM_ASSERT(g.Windows.Size==g.WindowsSortBuffer.Size);// we done something wrong
// This usually assert if there is a mismatch between the ImGuiWindowFlags_ChildWindow / ParentWindow values and DC.ChildWindows[] in parents, aka we've done something wrong.
if(windows_to_render_front_most[n]&&IsWindowActiveAndVisible(windows_to_render_front_most[n]))// NavWindowingTarget is always temporarily displayed as the front-most window
// When the window cannot fit all contents (either because of constraints, either because screen is too small): we are growing the size on the other axis to compensate for expected scrollbar. FIXME: Might turn bigger than DisplaySize-WindowPadding.
// Maximum window size is determined by the display size
if(is_popup||is_menu)// Popups and menus bypass style.WindowMinSize by default, but we give then a non-zero minimum size to facilitate understanding problematic cases (e.g. empty popups)
if(!window_pos_set_by_api&&window->AutoFitFramesX<=0&&window->AutoFitFramesY<=0&&g.IO.DisplaySize.x>0.0f&&g.IO.DisplaySize.y>0.0f)// Ignore zero-sized display explicitly to avoid losing positions if a window manager reports zero-sized window when initializing or minimizing.
if(g.IO.DisplaySize.x>0.0f&&g.IO.DisplaySize.y>0.0f)// Ignore zero-sized display explicitly to avoid losing positions if a window manager reports zero-sized window when initializing or minimizing.
// As we highlight the title bar when want_focus is set, multiple reappearing windows will have have their title bar highlighted on their reappearing frame.
// After Begin() we fill the last item / hovered data based on title bar data. It is a standard behavior (to allow creation of context menus on title bar only, etc.).
// We fill last item data based on Title Bar, in order for IsItemHovered() and IsItemActive() to be usable after Begin().
// This is useful to allow creating context menus on title bar only, etc.
// FIXME: This code is faulty and we may want to eventually to replace or remove the 'apply_focus_to_window_under=true' path completely.
// Instead of using g.OpenPopupStack[remaining-1].Window etc. we should find the highest root window that is behind the popups we are closing.
// The current code will set focus to the parent of the popup window which is incorrect.
// It rarely manifested until now because UpdateMouseMovingWindow() would call FocusWindow() again on the clicked window,
// It rarely manifested until now because UpdateMouseMovingWindowNewFrame() would call FocusWindow() again on the clicked window,
// leading to a chain of focusing A (clicked window) then B (parent window of the popup) then A again.
// However if the clicked window has the _NoMove flag set we would be left with B focused.
// For now, we have disabled this path when called from ClosePopupsOverWindow() because the users of ClosePopupsOverWindow() don't need to alter focus anyway,
IMGUI_APIboolIsWindowFocused(ImGuiFocusedFlagsflags=0);// is current window focused? or its root/child, depending on flags. see flags for options.
IMGUI_APIboolIsWindowHovered(ImGuiHoveredFlagsflags=0);// is current window hovered (and typically: not blocked by a popup/modal)? see flags for options. NB: If you are trying to check whether your mouse should be dispatched to imgui or to your app, you should use the 'io.WantCaptureMouse' boolean for that! Please read the FAQ!
IMGUI_APIImDrawList*GetWindowDrawList();// get draw list associated to the window, to append your own drawing primitives
IMGUI_APIImDrawList*GetWindowDrawList();// get draw list associated to the current window, to append your own drawing primitives
IMGUI_APIImVec2GetWindowPos();// get current window position in screen space (useful if you want to do your own drawing via the DrawList API)
IMGUI_APIImVec2GetWindowSize();// get current window size
IMGUI_APIfloatGetWindowWidth();// get current window width (shortcut for GetWindowSize().x)
@ -1281,7 +1282,7 @@ struct ImGuiIO
ImGuiConfigFlagsConfigFlags;// = 0 // See ImGuiConfigFlags_ enum. Set by user/application. Gamepad/keyboard navigation options, etc.
ImGuiBackendFlagsBackendFlags;// = 0 // See ImGuiBackendFlags_ enum. Set by back-end (imgui_impl_xxx files or custom back-end) to communicate features supported by the back-end.
ImVec2DisplaySize;// <unset> // Main display size, in pixels. For clamping windows positions.
ImVec2DisplaySize;// <unset> // Main display size, in pixels.
floatDeltaTime;// = 1.0f/60.0f // Time elapsed since last frame, in seconds.
floatIniSavingRate;// = 5.0f // Minimum time between saving positions/sizes to .ini file, in seconds.
constchar*IniFilename;// = "imgui.ini" // Path to .ini file. Set NULL to disable automatic .ini loading/saving, if e.g. you want to manually load/save from memory.
@ -1298,16 +1299,16 @@ struct ImGuiIO
floatFontGlobalScale;// = 1.0f // Global scale all fonts
boolFontAllowUserScaling;// = false // Allow user scaling text of individual window with CTRL+Wheel.
ImFont*FontDefault;// = NULL // Font to use on NewFrame(). Use NULL to uses Fonts->Fonts[0].
ImVec2DisplayFramebufferScale;// = (1.0f,1.0f) // For retina display or other situations where window coordinates are different from framebuffer coordinates. User storage only, presently not used by ImGui.
ImVec2DisplayFramebufferScale;// = (1.0f,1.0f) // For hi-dpi/retina display or other situations where window coordinates are different from framebuffer coordinates. User storage only, presently not used by ImGui.
ImVec2DisplayVisibleMin;// <unset> // [OBSOLETE] If you use DisplaySize as a virtual space larger than your screen, set DisplayVisibleMin/Max to the visible area.
ImVec2DisplayVisibleMax;// <unset> // [OBSOLETE] Just use io.DisplaySize! If the values are the same, we defaults to Min=(0.0f) and Max=DisplaySize
// Miscellaneous configuration options
// Miscellaneous options
boolMouseDrawCursor;// = false // Request ImGui to draw a mouse cursor for you (if you are on a platform without a mouse cursor). Cannot be easily renamed to 'io.ConfigXXX' because this is frequently used by back-end implementations.
boolConfigMacOSXBehaviors;// = defined(__APPLE__) // OS X style: Text editing cursor movement using Alt instead of Ctrl, Shortcuts using Cmd/Super instead of Ctrl, Line/Text Start and End using Cmd+Arrows instead of Home/End, Double click selects by word instead of selecting whole text, Multi-selection in lists uses Cmd/Super instead of Ctrl (was called io.OptMacOSXBehaviors prior to 1.63)
boolConfigInputTextCursorBlink;// = true // Set to false to disable blinking cursor, for users who consider it distracting. (was called: io.OptCursorBlink prior to 1.63)
boolConfigWindowsResizeFromEdges;// = true // Enable resizing of windows from their edges and from the lower-left corner. This requires (io.BackendFlags & ImGuiBackendFlags_HasMouseCursors) because it needs mouse cursor feedback. (This used to be the a per-window ImGuiWindowFlags_ResizeFromAnySide flag)
boolConfigWindowsMoveFromTitleBarOnly;// = false // [BETA] Set to true to only allow moving windows when clicked+dragged from the title bar. Windows without a title bar are not affected.
boolConfigWindowsMoveFromTitleBarOnly;// = false // [BETA] Set to true to only allow moving windows when clicked+dragged from the title bar. Windows without a title bar are not affected.
// 1D vector (this odd construct is used to facilitate the transition between 1D and 2D, and the maintenance of some branches/patches)
structImVec1
{
floatx;
ImVec1(){x=0.0f;}
ImVec1(float_x){x=_x;}
};
enumImGuiButtonFlags_
{
ImGuiButtonFlags_None=0,
@ -352,6 +345,19 @@ enum ImGuiSeparatorFlags_
ImGuiSeparatorFlags_Vertical=1<<1
};
// Transient per-window flags, reset at the beginning of the frame. For child window, inherited from parent on first Begin().
// This is going to be exposed in imgui.h when stabilized enough.
enumImGuiItemFlags_
{
ImGuiItemFlags_NoTabStop=1<<0,// false
ImGuiItemFlags_ButtonRepeat=1<<1,// false // Button() will return true multiple times based on io.KeyRepeatDelay and io.KeyRepeatRate settings.
ImGuiItemFlags_Disabled=1<<2,// false // [BETA] Disable interactions but doesn't affect visuals yet. See github.com/ocornut/imgui/issues/211
ImGuiItemFlags_NoNav=1<<3,// false
ImGuiItemFlags_NoNavDefaultFocus=1<<4,// false
ImGuiItemFlags_SelectableDontClosePopup=1<<5,// false // MenuItem/Selectable() automatically closes current Popup window
ImGuiItemFlags_Default_=0
};
// Storage for LastItem data
enumImGuiItemStatusFlags_
{
@ -460,6 +466,15 @@ enum ImGuiPopupPositionPolicy
ImGuiPopupPositionPolicy_ComboBox
};
// 1D vector (this odd construct is used to facilitate the transition between 1D and 2D, and the maintenance of some branches/patches)
structImVec1
{
floatx;
ImVec1(){x=0.0f;}
ImVec1(float_x){x=_x;}
};
// 2D axis aligned bounding-box
// NB: we can't rely on ImVec2 math operators being available here
structIMGUI_APIImRect
@ -585,8 +600,8 @@ struct ImGuiWindowSettings
structImGuiSettingsHandler
{
constchar*TypeName;// Short description stored in .ini file. Disallowed characters: '[' ']'
ImGuiIDTypeHash;// == ImHash(TypeName, 0, 0)
constchar*TypeName;// Short description stored in .ini file. Disallowed characters: '[' ']'
ImGuiIDTypeHash;// == ImHashStr(TypeName, 0, 0)
void*(*ReadOpenFn)(ImGuiContext*ctx,ImGuiSettingsHandler*handler,constchar*name);// Read: Called when entering into a new ini entry e.g. "[Window][Name]"
void(*ReadLineFn)(ImGuiContext*ctx,ImGuiSettingsHandler*handler,void*entry,constchar*line);// Read: Called for every line of text within an ini entry
void(*WriteAllFn)(ImGuiContext*ctx,ImGuiSettingsHandler*handler,ImGuiTextBuffer*out_buf);// Write: Output every entries into 'out_buf'