Docking: Renamed ImGuiDockSpaceFlags to ImGuiDockNodeFlags. Clarified in comments/demos that DockSpace creates a Node. Renamed IsExplicitRoot to IsDockSpace. Assert against explicitly calling DockSpace twice in a frame.
// We can have NULL pointers when we delete nodes, but because ID are recycled this should amortize nicely (and our node count will never be very high)
// Move ourselves to the Menu layer + Undo SkipItems flag in order to draw over the title bar (even if the window is collapsed)
// Move ourselves to the Menu layer (so we can be accessed by tapping Alt) + undo SkipItems flag in order to draw over the title bar even if the window is collapsed
// When a Dockspace transitioned form implicit to explicit this may be called a second time
// It is possible that the node has already been claimed by a docked window which appeared before the DockSpace() node, so we overwrite IsDockSpace again.
if(node->LastFrameActive==g.FrameCount)
{
IM_ASSERT(node->IsDockSpace==false&&"Cannot call DockSpace() twice a frame with the same ID");
node->IsDockSpace=true;
return;
}
node->IsDockSpace=true;
// Keep alive mode, this is allow windows docked into this node so stay docked even if they are not visible
// Note how we are testing for LastFrameAlive and NOT LastFrameActive. A DockSpace can be maintained alive while being inactive with ImGuiDockSpaceFlags_KeepAliveOnly.
// Undock if our dockspace node disappeared
// Note how we are testing for LastFrameAlive and NOT LastFrameActive. A DockSpace node can be maintained alive while being inactive with ImGuiDockNodeFlags_KeepAliveOnly.
if(dock_node->LastFrameAlive<g.FrameCount)
{
// If the window has been orphaned (lost its dockspace), transition the docknode to an implicit node processed in DockContextUpdateDocking()
// If the window has been orphaned, transition the docknode to an implicit node processed in DockContextUpdateDocking()
@ -111,7 +111,7 @@ typedef int ImGuiColorEditFlags; // -> enum ImGuiColorEditFlags_ // Flags: f
typedefintImGuiColumnsFlags;// -> enum ImGuiColumnsFlags_ // Flags: for Columns(), BeginColumns()
typedefintImGuiConfigFlags;// -> enum ImGuiConfigFlags_ // Flags: for io.ConfigFlags
typedefintImGuiComboFlags;// -> enum ImGuiComboFlags_ // Flags: for BeginCombo()
typedefintImGuiDockSpaceFlags;// -> enum ImGuiDockSpaceFlags_ // Flags: for DockSpace()
typedefintImGuiDockNodeFlags;// -> enum ImGuiDockNodeFlags_ // Flags: for DockSpace()
typedefintImGuiDragDropFlags;// -> enum ImGuiDragDropFlags_ // Flags: for *DragDrop*()
typedefintImGuiFocusedFlags;// -> enum ImGuiFocusedFlags_ // Flags: for IsWindowFocused()
typedefintImGuiHoveredFlags;// -> enum ImGuiHoveredFlags_ // Flags: for IsItemHovered(), IsWindowHovered() etc.
@ -517,8 +517,9 @@ namespace ImGui
// Docking
// [BETA API] Enable with io.ConfigFlags |= ImGuiConfigFlags_DockingEnable.
// Note: you DO NOT need to call DockSpace() to use most Docking facilities! You can hold SHIFT anywhere while moving windows. Use DockSpace() if you need to create an explicit docking space _within_ an existing window. See Docking demo for details)
IMGUI_APIvoidSetNextWindowDock(ImGuiIDdock_id,ImGuiCondcond=0);// set next window dock id (FIXME-DOCK)
IMGUI_APIvoidSetNextWindowUserType(ImGuiIDuser_type);// FIXME-DOCK: set next window user type (docking filters by same user_type)
IMGUI_APIboolIsWindowDocked();// is current window docked into another window?
@ -782,11 +783,11 @@ enum ImGuiTabItemFlags_
};
// Flags for ImGui::DockSpace()
enumImGuiDockSpaceFlags_
enumImGuiDockNodeFlags_
{
ImGuiDockSpaceFlags_None=0,
ImGuiDockSpaceFlags_KeepAliveOnly=1<<0,// Don't create/display the dockspace but keep it alive. Windows docked into this dockspace won't be undocked.
ImGuiDockSpaceFlags_NoSplit=1<<1// Disable splitting the dockspace into smaller nodes. Useful e.g. when embedding dockspaces into a main root one.
ImGuiDockNodeFlags_None =0,
ImGuiDockNodeFlags_KeepAliveOnly =1<<0,// Don't display the dockspace node but keep it alive. Windows docked into this dockspace node won't be undocked.
ImGuiDockNodeFlags_NoSplit =1<<1// Disable splitting the node into smaller nodes. Useful e.g. when embedding dockspaces into a main root one (the root one may have splitting disableed to reduce confusion)
if(show_app_dockspace)ShowExampleAppDockSpace(&show_app_dockspace);// Process the Docking app first, as explicit DockSpace() needs to be submitted early (read comments near the DockSpace function)
if(show_app_dockspace)ShowExampleAppDockSpace(&show_app_dockspace);// Process the Docking app first, as explicit DockSpace() nodes needs to be submitted early (read comments near the DockSpace function)
if(show_app_documents)ShowExampleAppDocuments(&show_app_documents);// Process the Document app next, as it may also use a DockSpace()
// We are using the ImGuiWindowFlags_NoDocking flag to make the parent window not dockable into.
// Because 1) it would be confusing to have two docking targets within each others.
// and 2) we want our main DockSpace to always be visible (never hidden within a tab bar): if the DockSpace disappear its child windows will be orphaned.
// and 2) we want our main DockSpace node to always be visible (never hidden within a tab bar): if the DockSpace node disappear its child windows will be orphaned.
"You can _always_ dock _any_ window into another by holding the SHIFT key while moving a window. Try it now!""\n"
"This demo app has nothing to do with it!""\n\n"
"This demo app only demonstrate the use of ImGui::DockSpace() which allows you to specify a docking spot _within_ another window. This is useful so you can decorate your main application window (e.g. with a menu bar).""\n\n"
"This demo app only demonstrate the use of ImGui::DockSpace() which allows you to manually create a docking node _within_ another window. This is useful so you can decorate your main application window (e.g. with a menu bar).""\n\n"
"ImGui::DockSpace() comes with one hard constraint: it needs to be submitted _before_ any window which may be docked into it. Therefore, if you use a dock spot as the central point of your application, you'll probably want it to be part of the very first window you are submitting to imgui every frame.""\n\n"
"(NB: because of this constraint, the implicit \"Debug\" window can not be docked into an explicit DockSpace(), because that window is submitted as part of the NewFrame() call. An easy workaround is that you can create your own implicit \"Debug##2\" window after calling DockSpace() and leave it in the window stack for anyone to use.)"
"(NB: because of this constraint, the implicit \"Debug\" window can not be docked into an explicit DockSpace() node, because that window is submitted as part of the NewFrame() call. An easy workaround is that you can create your own implicit \"Debug##2\" window after calling DockSpace() and leave it in the window stack for anyone to use.)"