- window: resizing from any sides? done. > need backends to honor mouse cursors properly. (#822)
- window: resize from borders: support some form of outer padding to make it easier to grab borders. (#822)
- window: begin with *p_open == false should return false.
- window: fix resize glitch when collapsing an AlwaysAutoResize window.
- window: begin with *p_open == false could return false.
- window: get size/pos helpers given names (see discussion in #249)
- window: a collapsed window can be stuck behind the main menu bar?
- window: when window is very small, prioritize resize button over close button.
@ -28,7 +29,8 @@ It's mostly a bunch of personal notes, probably incomplete. Feel free to query i
- window: using SetWindowPos() inside Begin() and moving the window with the mouse reacts a very ugly glitch. We should just defer the SetWindowPos() call.
- window: GetWindowSize() returns (0,0) when not calculated? (#1045)
- window: freeze window flag: if not focused/hovered, return false, render with previous ImDrawList. and/or reduce refresh rate.
!- scrolling: allow immediately effective change of scroll after Begin() if we haven't appended items yet.
- window: investigate better auto-positioning for new windows.
- scrolling: allow immediately effective change of scroll after Begin() if we haven't appended items yet.
- scrolling/clipping: separator on the initial position of a window is not visible (cursorpos.y <= clippos.y). (2017-08-20: can't repro)
- drawdata: make it easy to clone (or swap?) a ImDrawData so user can easily save that data if they use threaded rendering.
@ -218,6 +220,7 @@ It's mostly a bunch of personal notes, probably incomplete. Feel free to query i
- drag and drop: add demo. (#143, #479)
- drag and drop: have some way to know when a drag begin from BeginDragDropSource() pov
- drag and drop: allow using with other mouse buttons (where activeid won't be set). (#1637)
- drag and drop: make it easier and provide a demo to have tooltip both are source and target site, with a more detailed one on target site (tooltip ordering problem)
- drag and drop: test with reordering nodes (in a list, or a tree node). (#143)
- drag and drop: test integrating with os drag and drop.
#include<GL/gl3w.h> // This example is using gl3w to access OpenGL functions. You may freely use any other OpenGL loader such as: glew, glad, glLoadGen, etc.
#include<GL/gl3w.h> // This example is using gl3w to access OpenGL functions. You may use another OpenGL loader/header such as: glew, glext, glad, glLoadGen, etc.
//#include <glew.h>
#include<GLFW/glfw3.h>
//#include <glext.h>
//#include <glad/glad.h>
#include<GLFW/glfw3.h> // Include glfw3.h after our OpenGL definitions
#include<GL/gl3w.h> // This example is using gl3w to access OpenGL functions. You may freely use any other OpenGL loader such as: glew, glad, glLoadGen, etc.
//#include <glew.h>
#include<SDL.h>
#include<GL/gl3w.h> // This example is using gl3w to access OpenGL functions. You may use another OpenGL loader/header such as: glew, glext, glad, glLoadGen, etc.
#include<GL/gl3w.h> // This example is using gl3w to access OpenGL functions. You may freely use any other OpenGL loader such as: glew, glad, glLoadGen, etc.
#include<GL/gl3w.h> // This example is using gl3w to access OpenGL functions. You may use another OpenGL loader/header such as: glew, glext, glad, glLoadGen, etc.
// The default tooltip position is a little offset to give space to see the context menu (it's also clamped within the current viewport/monitor)
// In the context of a dragging tooltip we try to reduce that offset and we enforce following the cursor.
// Whatever we do we want to call SetNextWindowPos() to enforce a tooltip position and disable clipping the tooltip without our display area, like regular tooltip do.
//PushStyleVar(ImGuiStyleVar_Alpha, g.Style.Alpha * 0.60f); // This would be nice but e.g ColorButton with checkboard has issue with transparent colors :(
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)
window->RootWindowForTitleBarHighlight=window->RootWindowForTabbing=parent_window->RootWindowForTitleBarHighlight;// Same value in master branch, will differ for docking
// Discard the drag if have not called SetDragDropPayload()
if(g.DragDropPayload.DataFrameCount==-1)
ClearDragDrop();
}
voidImGui::BeginDragDropTooltip()
{
// The default tooltip position is a little offset to give space to see the context menu (it's also clamped within the current viewport/monitor)
// In the context of a dragging tooltip we try to reduce that offset and we enforce following the cursor.
// Whatever we do we want to call SetNextWindowPos() to enforce a tooltip position and disable clipping the tooltip without our display area, like regular tooltip do.
//PushStyleVar(ImGuiStyleVar_Alpha, g.Style.Alpha * 0.60f); // This would be nice but e.g ColorButton with checkboard has issue with transparent colors :(
BeginTooltipEx(0,true);
}
voidImGui::EndDragDropTooltip()
{
EndTooltip();
g.DragDropWithinSourceOrTarget=false;
}
// Use 'cond' to choose to submit payload on drag start or every frame
ImGuiDragDropFlags_SourceNoPreviewTooltip=1<<0,// By default, a successful call to BeginDragDropSource opens a tooltip so you can display a preview or description of the source contents. This flag disable this behavior.
ImGuiDragDropFlags_SourceNoDisableHover=1<<1,// By default, when dragging we clear data so that IsItemHovered() will return true, to avoid subsequent user code submitting tooltips. This flag disable this behavior so you can still call IsItemHovered() on the source item.
ImGuiDragDropFlags_SourceNoDisableHover=1<<1,// By default, when dragging we clear data so that IsItemHovered() will return false, to avoid subsequent user code submitting tooltips. This flag disable this behavior so you can still call IsItemHovered() on the source item.
ImGuiDragDropFlags_SourceNoHoldToOpenOthers=1<<2,// Disable the behavior that allows to open tree nodes and collapsing header by holding over them while dragging a source item.
ImGuiDragDropFlags_SourceAllowNullID=1<<3,// Allow items such as Text(), Image() that have no unique identifier to be used as drag source, by manufacturing a temporary identifier based on their window-relative position. This is extremely unusual within the dear imgui ecosystem and so we made it explicit.
ImGuiDragDropFlags_SourceExtern=1<<4,// External source (from outside of imgui), won't attempt to read current item/window info. Will always return true. Only one Extern source can be active simultaneously.
ImGui::SameLine();ShowHelpMarker("Click on the colored square to open a color picker.\nRight-click on the colored square to show options.\nCTRL+click on individual component to input value.\n");
ImGui::SameLine();ShowHelpMarker("Click on the colored square to open a color picker.\nClick and hold to use drag and drop.\nRight-click on the colored square to show options.\nCTRL+click on individual component to input value.\n");
ImGui::SetDragDropPayload("DND_DEMO_CELL",&n,sizeof(int));// Set payload to carry the index of our item (could be anything)
if(mode==Mode_Copy){ImGui::Text("Copy %s",names[n]);}// Display preview (could be anything, e.g. when dragging an image we could decide to display the filename and a small preview of the image, etc.)
ImGuiWindow*ParentWindow;// If we are a child _or_ popup window, this is pointing to our parent. Otherwise NULL.
ImGuiWindow*RootWindow;// Point to ourself or first ancestor that is not a child window.
ImGuiWindow*RootWindowForTitleBarHighlight;// Point to ourself or first ancestor which will display TitleBgActive color when this window is active.
ImGuiWindow*RootWindowForTabbing;// Point to ourself or first ancestor which can be CTRL-Tabbed into.
ImGuiWindow*RootWindowForNav;// Point to ourself or first ancestor which doesn't have the NavFlattened flag.
ImGuiWindow*NavLastChildNavWindow;// When going to the menu bar, we remember the child window we came from. (This could probably be made implicit if we kept g.Windows sorted by last focused including child window.)
IMGUI_APIvoidBeginColumns(constchar*str_id,intcount,ImGuiColumnsFlagsflags=0);// setup number of columns. use an identifier to distinguish multiple column sets. close with EndColumns().