mirror of
https://github.com/Drezil/imgui.git
synced 2024-12-18 22:26:34 +00:00
Renamed ImGuiDockFamily to ImGuiWindowClass. Renamed CompatibleWithClassZero to DockingAllowUnclassed. (#2109)
This commit is contained in:
parent
238321c159
commit
e194219f2e
@ -38,7 +38,7 @@ HOW TO UPDATE?
|
|||||||
Set with `io.ConfigFlags |= ImGuiConfigFlags_DockingEnable;`.
|
Set with `io.ConfigFlags |= ImGuiConfigFlags_DockingEnable;`.
|
||||||
- Added DockSpace() API.
|
- Added DockSpace() API.
|
||||||
- Added ImGuiDockNodeFlags flags for DockSpace().
|
- Added ImGuiDockNodeFlags flags for DockSpace().
|
||||||
- Added SetNextWindowDock(), SetNextWindowDockFamily() API.
|
- Added SetNextWindowDock(), SetNextWindowClass() API.
|
||||||
- Added GetWindowDockId(), IsWindowDocked() API.
|
- Added GetWindowDockId(), IsWindowDocked() API.
|
||||||
- Added ImGuiWindowFlags_NoDocking window flag to disable the possibility for a window to be docked.
|
- Added ImGuiWindowFlags_NoDocking window flag to disable the possibility for a window to be docked.
|
||||||
Popup, Menu and Child windows always have the ImGuiWindowFlags_NoDocking flag set.
|
Popup, Menu and Child windows always have the ImGuiWindowFlags_NoDocking flag set.
|
||||||
|
@ -145,7 +145,7 @@ It's mostly a bunch of personal notes, probably incomplete. Feel free to query i
|
|||||||
- dock: B- tab bar: make selected tab always shows its full title?
|
- dock: B- tab bar: make selected tab always shows its full title?
|
||||||
- dock: B- tab bar: the order/focus restoring code could be part of TabBar and not DockNode? (#8)
|
- dock: B- tab bar: the order/focus restoring code could be part of TabBar and not DockNode? (#8)
|
||||||
- dock: B- nav: design interactions so nav controls can dock/undock
|
- dock: B- nav: design interactions so nav controls can dock/undock
|
||||||
- dock: B- dockspace: flag to lock the dock tree and/or sizes (ImGuiDockFlags_Locked?)
|
- dock: B- dockspace: flag to lock the dock tree and/or sizes (ImGuiDockNodeFlags_Locked?)
|
||||||
- dock: B- reintroduce collapsing a floating dock node. also collapsing a docked dock node!
|
- dock: B- reintroduce collapsing a floating dock node. also collapsing a docked dock node!
|
||||||
- dock: B- allow dragging a non-floating dock node by clicking on the title-bar-looking section (not just the collapse/menu button)
|
- dock: B- allow dragging a non-floating dock node by clicking on the title-bar-looking section (not just the collapse/menu button)
|
||||||
- dock: B- option to remember undocked window size? (instead of keeping their docked size) (relate to #2104)
|
- dock: B- option to remember undocked window size? (instead of keeping their docked size) (relate to #2104)
|
||||||
|
46
imgui.cpp
46
imgui.cpp
@ -5084,7 +5084,7 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
|
|||||||
{
|
{
|
||||||
window->SizeContentsExplicit = ImVec2(0.0f, 0.0f);
|
window->SizeContentsExplicit = ImVec2(0.0f, 0.0f);
|
||||||
}
|
}
|
||||||
window->DockFamily = g.NextWindowData.DockFamily;
|
window->WindowClass = g.NextWindowData.WindowClass;
|
||||||
if (g.NextWindowData.CollapsedCond)
|
if (g.NextWindowData.CollapsedCond)
|
||||||
SetWindowCollapsed(window, g.NextWindowData.CollapsedVal, g.NextWindowData.CollapsedCond);
|
SetWindowCollapsed(window, g.NextWindowData.CollapsedVal, g.NextWindowData.CollapsedCond);
|
||||||
if (g.NextWindowData.FocusCond)
|
if (g.NextWindowData.FocusCond)
|
||||||
@ -6531,10 +6531,10 @@ void ImGui::SetNextWindowDockId(ImGuiID id, ImGuiCond cond)
|
|||||||
g.NextWindowData.DockId = id;
|
g.NextWindowData.DockId = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ImGui::SetNextWindowDockFamily(const ImGuiDockFamily* family)
|
void ImGui::SetNextWindowClass(const ImGuiWindowClass* window_class)
|
||||||
{
|
{
|
||||||
ImGuiContext& g = *GImGui;
|
ImGuiContext& g = *GImGui;
|
||||||
g.NextWindowData.DockFamily = *family;
|
g.NextWindowData.WindowClass = *window_class;
|
||||||
}
|
}
|
||||||
|
|
||||||
// In window space (not screen space!)
|
// In window space (not screen space!)
|
||||||
@ -10679,7 +10679,7 @@ struct ImGuiDockNodeUpdateScanResults
|
|||||||
ImGuiDockNode* CentralNode;
|
ImGuiDockNode* CentralNode;
|
||||||
ImGuiDockNode* FirstNodeWithWindows;
|
ImGuiDockNode* FirstNodeWithWindows;
|
||||||
int CountNodesWithWindows;
|
int CountNodesWithWindows;
|
||||||
//ImGuiDockFamily DockFamilyForMerges;
|
//ImGuiWindowClass WindowClassForMerges;
|
||||||
|
|
||||||
ImGuiDockNodeUpdateScanResults() { CentralNode = FirstNodeWithWindows = NULL; CountNodesWithWindows = 0; }
|
ImGuiDockNodeUpdateScanResults() { CentralNode = FirstNodeWithWindows = NULL; CountNodesWithWindows = 0; }
|
||||||
};
|
};
|
||||||
@ -10802,16 +10802,16 @@ static void ImGui::DockNodeUpdate(ImGuiDockNode* node)
|
|||||||
if (node->LastFocusedNodeID == 0 && results.FirstNodeWithWindows != NULL)
|
if (node->LastFocusedNodeID == 0 && results.FirstNodeWithWindows != NULL)
|
||||||
node->LastFocusedNodeID = results.FirstNodeWithWindows->ID;
|
node->LastFocusedNodeID = results.FirstNodeWithWindows->ID;
|
||||||
|
|
||||||
// Copy the dock family from of our window so it can be used for proper dock filtering.
|
// Copy the window class from of our first window so it can be used for proper dock filtering.
|
||||||
// When node has mixed windows, prioritize the family with the most constraint (CompatibleWithNeutral = false) as the reference to copy.
|
// When node has mixed windows, prioritize the class with the most constraint (CompatibleWithClassZero = false) as the reference to copy.
|
||||||
// FIXME-DOCK: We don't recurse properly, this code could be reworked to work from DockNodeUpdateScanRec.
|
// FIXME-DOCK: We don't recurse properly, this code could be reworked to work from DockNodeUpdateScanRec.
|
||||||
if (ImGuiDockNode* first_node_with_windows = results.FirstNodeWithWindows)
|
if (ImGuiDockNode* first_node_with_windows = results.FirstNodeWithWindows)
|
||||||
{
|
{
|
||||||
node->DockFamily = first_node_with_windows->Windows[0]->DockFamily;
|
node->WindowClass = first_node_with_windows->Windows[0]->WindowClass;
|
||||||
for (int n = 1; n < first_node_with_windows->Windows.Size; n++)
|
for (int n = 1; n < first_node_with_windows->Windows.Size; n++)
|
||||||
if (first_node_with_windows->Windows[n]->DockFamily.CompatibleWithFamilyZero == false)
|
if (first_node_with_windows->Windows[n]->WindowClass.DockingAllowUnclassed == false)
|
||||||
{
|
{
|
||||||
node->DockFamily = first_node_with_windows->Windows[n]->DockFamily;
|
node->WindowClass = first_node_with_windows->Windows[n]->WindowClass;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -11272,13 +11272,13 @@ static bool DockNodeIsDropAllowedOne(ImGuiWindow* payload, ImGuiWindow* host_win
|
|||||||
if ((host_window->Flags & ImGuiWindowFlags_DockNodeHost) && host_window->DockNodeAsHost->IsDockSpace && payload->BeginOrderWithinContext < host_window->BeginOrderWithinContext)
|
if ((host_window->Flags & ImGuiWindowFlags_DockNodeHost) && host_window->DockNodeAsHost->IsDockSpace && payload->BeginOrderWithinContext < host_window->BeginOrderWithinContext)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
ImGuiDockFamily* host_family = host_window->DockNodeAsHost ? &host_window->DockNodeAsHost->DockFamily : &host_window->DockFamily;
|
ImGuiWindowClass* host_class = host_window->DockNodeAsHost ? &host_window->DockNodeAsHost->WindowClass : &host_window->WindowClass;
|
||||||
ImGuiDockFamily* payload_family = &payload->DockFamily;
|
ImGuiWindowClass* payload_class = &payload->WindowClass;
|
||||||
if (host_family->FamilyId != payload_family->FamilyId)
|
if (host_class->ClassId != payload_class->ClassId)
|
||||||
{
|
{
|
||||||
if (host_family->FamilyId != 0 && host_family->CompatibleWithFamilyZero && payload_family->FamilyId == 0)
|
if (host_class->ClassId != 0 && host_class->DockingAllowUnclassed && payload_class->ClassId == 0)
|
||||||
return true;
|
return true;
|
||||||
if (payload_family->FamilyId != 0 && payload_family->CompatibleWithFamilyZero && host_family->FamilyId == 0)
|
if (payload_class->ClassId != 0 && payload_class->DockingAllowUnclassed && host_class->ClassId == 0)
|
||||||
return true;
|
return true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -11928,7 +11928,7 @@ void ImGui::SetWindowDock(ImGuiWindow* window, ImGuiID dock_id, ImGuiCond cond)
|
|||||||
|
|
||||||
// Create an explicit dockspace node within an existing window. Also expose dock node flags and creates a CentralNode by default.
|
// Create an explicit dockspace node within an existing window. Also expose dock node flags and creates a CentralNode by default.
|
||||||
// The Central Node is always displayed even when empty and shrink/extend according to the requested size of its neighbors.
|
// The Central Node is always displayed even when empty and shrink/extend according to the requested size of its neighbors.
|
||||||
void ImGui::DockSpace(ImGuiID id, const ImVec2& size_arg, ImGuiDockNodeFlags dockspace_flags, const ImGuiDockFamily* dock_family)
|
void ImGui::DockSpace(ImGuiID id, const ImVec2& size_arg, ImGuiDockNodeFlags dockspace_flags, const ImGuiWindowClass* window_class)
|
||||||
{
|
{
|
||||||
ImGuiContext* ctx = GImGui;
|
ImGuiContext* ctx = GImGui;
|
||||||
ImGuiContext& g = *ctx;
|
ImGuiContext& g = *ctx;
|
||||||
@ -11943,7 +11943,7 @@ void ImGui::DockSpace(ImGuiID id, const ImVec2& size_arg, ImGuiDockNodeFlags doc
|
|||||||
node->IsCentralNode = true;
|
node->IsCentralNode = true;
|
||||||
}
|
}
|
||||||
node->Flags = dockspace_flags;
|
node->Flags = dockspace_flags;
|
||||||
node->DockFamily = dock_family ? *dock_family : ImGuiDockFamily();
|
node->WindowClass = window_class ? *window_class : ImGuiWindowClass();
|
||||||
|
|
||||||
// When a Dockspace transitioned form implicit to explicit this may be called a second time
|
// 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.
|
// 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.
|
||||||
@ -12006,7 +12006,7 @@ void ImGui::DockSpace(ImGuiID id, const ImVec2& size_arg, ImGuiDockNodeFlags doc
|
|||||||
// The limitation with this call is that your window won't have a menu bar.
|
// The limitation with this call is that your window won't have a menu bar.
|
||||||
// Even though we could pass window flags, it would also require the user to be able to call BeginMenuBar() somehow meaning we can't Begin/End in a single function.
|
// Even though we could pass window flags, it would also require the user to be able to call BeginMenuBar() somehow meaning we can't Begin/End in a single function.
|
||||||
// So if you want a menu bar you need to repeat this code manually ourselves. As with advanced other Docking API, we may change this function signature.
|
// So if you want a menu bar you need to repeat this code manually ourselves. As with advanced other Docking API, we may change this function signature.
|
||||||
ImGuiID ImGui::DockSpaceOverViewport(ImGuiViewport* viewport, ImGuiDockNodeFlags dockspace_flags, const ImGuiDockFamily* dock_family)
|
ImGuiID ImGui::DockSpaceOverViewport(ImGuiViewport* viewport, ImGuiDockNodeFlags dockspace_flags, const ImGuiWindowClass* window_class)
|
||||||
{
|
{
|
||||||
if (viewport == NULL)
|
if (viewport == NULL)
|
||||||
viewport = GetMainViewport();
|
viewport = GetMainViewport();
|
||||||
@ -12031,7 +12031,7 @@ ImGuiID ImGui::DockSpaceOverViewport(ImGuiViewport* viewport, ImGuiDockNodeFlags
|
|||||||
PopStyleVar(3);
|
PopStyleVar(3);
|
||||||
|
|
||||||
ImGuiID dockspace_id = GetID("Dockspace");
|
ImGuiID dockspace_id = GetID("Dockspace");
|
||||||
DockSpace(dockspace_id, ImVec2(0.0f, 0.0f), dockspace_flags, dock_family);
|
DockSpace(dockspace_id, ImVec2(0.0f, 0.0f), dockspace_flags, window_class);
|
||||||
End();
|
End();
|
||||||
|
|
||||||
return dockspace_id;
|
return dockspace_id;
|
||||||
@ -12299,7 +12299,7 @@ void ImGui::DockBuilderCopyDockspace(ImGuiID src_dockspace_id, ImGuiID dst_docks
|
|||||||
IM_ASSERT((in_window_remap_pairs->Size % 2) == 0);
|
IM_ASSERT((in_window_remap_pairs->Size % 2) == 0);
|
||||||
|
|
||||||
// Duplicate entire dock
|
// Duplicate entire dock
|
||||||
// FIXME: When overwriting dst_dockspace_id, windows that aren't part of our dockspace family but that are docked in a same node will be split apart,
|
// FIXME: When overwriting dst_dockspace_id, windows that aren't part of our dockspace window class but that are docked in a same node will be split apart,
|
||||||
// whereas we could attempt to at least keep them together in a new, same floating node.
|
// whereas we could attempt to at least keep them together in a new, same floating node.
|
||||||
ImVector<ImGuiID> node_remap_pairs;
|
ImVector<ImGuiID> node_remap_pairs;
|
||||||
DockBuilderCopyNode(src_dockspace_id, dst_dockspace_id, &node_remap_pairs);
|
DockBuilderCopyNode(src_dockspace_id, dst_dockspace_id, &node_remap_pairs);
|
||||||
@ -13126,7 +13126,7 @@ static void SettingsHandlerWindow_ReadLine(ImGuiContext*, ImGuiSettingsHandler*,
|
|||||||
else if (sscanf(line, "Collapsed=%d", &i) == 1) { settings->Collapsed = (i != 0); }
|
else if (sscanf(line, "Collapsed=%d", &i) == 1) { settings->Collapsed = (i != 0); }
|
||||||
else if (sscanf(line, "DockId=0x%X,%d", &u1, &i) == 2) { settings->DockId = u1; settings->DockOrder = (short)i; }
|
else if (sscanf(line, "DockId=0x%X,%d", &u1, &i) == 2) { settings->DockId = u1; settings->DockOrder = (short)i; }
|
||||||
else if (sscanf(line, "DockId=0x%X", &u1) == 1) { settings->DockId = u1; settings->DockOrder = -1; }
|
else if (sscanf(line, "DockId=0x%X", &u1) == 1) { settings->DockId = u1; settings->DockOrder = -1; }
|
||||||
else if (sscanf(line, "DockFamilyId=0x%X", &u1) == 1) { settings->DockFamilyId = u1; }
|
else if (sscanf(line, "ClassId=0x%X", &u1) == 1) { settings->ClassId = u1; }
|
||||||
}
|
}
|
||||||
|
|
||||||
static void SettingsHandlerWindow_WriteAll(ImGuiContext* imgui_ctx, ImGuiSettingsHandler* handler, ImGuiTextBuffer* buf)
|
static void SettingsHandlerWindow_WriteAll(ImGuiContext* imgui_ctx, ImGuiSettingsHandler* handler, ImGuiTextBuffer* buf)
|
||||||
@ -13153,7 +13153,7 @@ static void SettingsHandlerWindow_WriteAll(ImGuiContext* imgui_ctx, ImGuiSetting
|
|||||||
settings->ViewportPos = window->ViewportPos;
|
settings->ViewportPos = window->ViewportPos;
|
||||||
IM_ASSERT(window->DockNode == NULL || window->DockNode->ID == window->DockId);
|
IM_ASSERT(window->DockNode == NULL || window->DockNode->ID == window->DockId);
|
||||||
settings->DockId = window->DockId;
|
settings->DockId = window->DockId;
|
||||||
settings->DockFamilyId = window->DockFamily.FamilyId;
|
settings->ClassId = window->WindowClass.ClassId;
|
||||||
settings->DockOrder = window->DockOrder;
|
settings->DockOrder = window->DockOrder;
|
||||||
settings->Collapsed = window->Collapsed;
|
settings->Collapsed = window->Collapsed;
|
||||||
}
|
}
|
||||||
@ -13184,8 +13184,8 @@ static void SettingsHandlerWindow_WriteAll(ImGuiContext* imgui_ctx, ImGuiSetting
|
|||||||
buf->appendf("DockId=0x%08X\n", settings->DockId);
|
buf->appendf("DockId=0x%08X\n", settings->DockId);
|
||||||
else
|
else
|
||||||
buf->appendf("DockId=0x%08X,%d\n", settings->DockId, settings->DockOrder);
|
buf->appendf("DockId=0x%08X,%d\n", settings->DockId, settings->DockOrder);
|
||||||
if (settings->DockFamilyId != 0)
|
if (settings->ClassId != 0)
|
||||||
buf->appendf("DockFamilyId=0x%08X\n", settings->DockFamilyId);
|
buf->appendf("ClassId=0x%08X\n", settings->ClassId);
|
||||||
}
|
}
|
||||||
buf->appendf("\n");
|
buf->appendf("\n");
|
||||||
}
|
}
|
||||||
|
21
imgui.h
21
imgui.h
@ -15,7 +15,7 @@ Index of this file:
|
|||||||
// Flags & Enumerations
|
// Flags & Enumerations
|
||||||
// ImGuiStyle
|
// ImGuiStyle
|
||||||
// ImGuiIO
|
// ImGuiIO
|
||||||
// Misc data structures (ImGuiInputTextCallbackData, ImGuiSizeCallbackData, ImGuiPayload, ImGuiDockFamily)
|
// Misc data structures (ImGuiInputTextCallbackData, ImGuiSizeCallbackData, ImGuiPayload, ImGuiWindowClass)
|
||||||
// Obsolete functions
|
// Obsolete functions
|
||||||
// Helpers (ImVector, ImGuiOnceUponAFrame, ImGuiTextFilter, ImGuiTextBuffer, ImGuiStorage, ImGuiListClipper, ImColor)
|
// Helpers (ImVector, ImGuiOnceUponAFrame, ImGuiTextFilter, ImGuiTextBuffer, ImGuiStorage, ImGuiListClipper, ImColor)
|
||||||
// Draw List API (ImDrawCmd, ImDrawIdx, ImDrawVert, ImDrawChannel, ImDrawListFlags, ImDrawList, ImDrawData)
|
// Draw List API (ImDrawCmd, ImDrawIdx, ImDrawVert, ImDrawChannel, ImDrawListFlags, ImDrawList, ImDrawData)
|
||||||
@ -102,7 +102,7 @@ struct ImColor; // Helper functions to create a color that c
|
|||||||
typedef void* ImTextureID; // User data to identify a texture (this is whatever to you want it to be! read the FAQ about ImTextureID in imgui.cpp)
|
typedef void* ImTextureID; // User data to identify a texture (this is whatever to you want it to be! read the FAQ about ImTextureID in imgui.cpp)
|
||||||
#endif
|
#endif
|
||||||
struct ImGuiContext; // ImGui context (opaque)
|
struct ImGuiContext; // ImGui context (opaque)
|
||||||
struct ImGuiDockFamily; // Docking family for dock filtering
|
struct ImGuiWindowClass; // Window class/family for docking filtering or high-level identifiation of windows by user
|
||||||
struct ImGuiIO; // Main configuration and I/O between your application and ImGui
|
struct ImGuiIO; // Main configuration and I/O between your application and ImGui
|
||||||
struct ImGuiInputTextCallbackData; // Shared state of InputText() when using custom ImGuiInputTextCallback (rare/advanced use)
|
struct ImGuiInputTextCallbackData; // Shared state of InputText() when using custom ImGuiInputTextCallback (rare/advanced use)
|
||||||
struct ImGuiListClipper; // Helper to manually clip large list of items
|
struct ImGuiListClipper; // Helper to manually clip large list of items
|
||||||
@ -578,10 +578,10 @@ namespace ImGui
|
|||||||
// Note: you DO NOT need to call DockSpace() to use most Docking facilities!
|
// Note: you DO NOT need to call DockSpace() to use most Docking facilities!
|
||||||
// To dock windows: hold SHIFT anywhere while moving windows (if io.ConfigDockingWithShift == true) or drag windows from their title bar (if io.ConfigDockingWithShift = false)
|
// To dock windows: hold SHIFT anywhere while moving windows (if io.ConfigDockingWithShift == true) or drag windows from their title bar (if io.ConfigDockingWithShift = false)
|
||||||
// Use DockSpace() to create an explicit dock node _within_ an existing window. See Docking demo for details.
|
// Use DockSpace() to create an explicit dock node _within_ an existing window. See Docking demo for details.
|
||||||
IMGUI_API void DockSpace(ImGuiID id, const ImVec2& size = ImVec2(0, 0), ImGuiDockNodeFlags flags = 0, const ImGuiDockFamily* dock_family = NULL);
|
IMGUI_API void DockSpace(ImGuiID id, const ImVec2& size = ImVec2(0, 0), ImGuiDockNodeFlags flags = 0, const ImGuiWindowClass* window_class = NULL);
|
||||||
IMGUI_API ImGuiID DockSpaceOverViewport(ImGuiViewport* viewport = NULL, ImGuiDockNodeFlags dockspace_flags = 0, const ImGuiDockFamily* dock_family = NULL);
|
IMGUI_API ImGuiID DockSpaceOverViewport(ImGuiViewport* viewport = NULL, ImGuiDockNodeFlags dockspace_flags = 0, const ImGuiWindowClass* window_class = NULL);
|
||||||
IMGUI_API void SetNextWindowDockId(ImGuiID dock_id, ImGuiCond cond = 0); // set next window dock id (FIXME-DOCK)
|
IMGUI_API void SetNextWindowDockId(ImGuiID dock_id, ImGuiCond cond = 0); // set next window dock id (FIXME-DOCK)
|
||||||
IMGUI_API void SetNextWindowDockFamily(const ImGuiDockFamily* dock_family); // set next window user type (docking filters by same user_type)
|
IMGUI_API void SetNextWindowClass(const ImGuiWindowClass* window_class); // set next window class / user type (docking filters by same user_type)
|
||||||
IMGUI_API ImGuiID GetWindowDockId();
|
IMGUI_API ImGuiID GetWindowDockId();
|
||||||
IMGUI_API bool IsWindowDocked(); // is current window docked into another window?
|
IMGUI_API bool IsWindowDocked(); // is current window docked into another window?
|
||||||
|
|
||||||
@ -1470,14 +1470,13 @@ struct ImGuiPayload
|
|||||||
bool IsDelivery() const { return Delivery; }
|
bool IsDelivery() const { return Delivery; }
|
||||||
};
|
};
|
||||||
|
|
||||||
// [BETA] For SetNextWindowDockFamily() and DockSpace() function
|
// [BETA] Rarely used, very advanced uses only. Use with SetNextWindowClass() and DockSpace() functions.
|
||||||
struct ImGuiDockFamily
|
struct ImGuiWindowClass
|
||||||
{
|
{
|
||||||
ImGuiID FamilyId; // 0 = unaffiliated
|
ImGuiID ClassId; // User data. 0 = Default class (unclassed)
|
||||||
bool CompatibleWithFamilyZero; // true = can be docked/merged with an unaffiliated window
|
bool DockingAllowUnclassed; // true = can be docked/merged with an unclassed window
|
||||||
|
|
||||||
ImGuiDockFamily() { FamilyId = 0; CompatibleWithFamilyZero = true; }
|
ImGuiWindowClass() { ClassId = 0; DockingAllowUnclassed = true; }
|
||||||
ImGuiDockFamily(ImGuiID family_id, bool compatible_with_family_zero = true) { FamilyId = family_id; CompatibleWithFamilyZero = compatible_with_family_zero; }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
@ -1541,7 +1541,7 @@ static void ShowDemoWindowWidgets()
|
|||||||
if (test_window)
|
if (test_window)
|
||||||
{
|
{
|
||||||
// FIXME-DOCK: This window cannot be docked within the ImGui Demo window, this will cause a feedback loop and get them stuck.
|
// FIXME-DOCK: This window cannot be docked within the ImGui Demo window, this will cause a feedback loop and get them stuck.
|
||||||
// Could we fix this through an ImGuiDockFamily feature? Or an API call to tag our parent as "don't skip items"?
|
// Could we fix this through an ImGuiWindowClass feature? Or an API call to tag our parent as "don't skip items"?
|
||||||
ImGui::Begin("Title bar Hovered/Active tests", &test_window);
|
ImGui::Begin("Title bar Hovered/Active tests", &test_window);
|
||||||
if (ImGui::BeginPopupContextItem()) // <-- This is using IsItemHovered()
|
if (ImGui::BeginPopupContextItem()) // <-- This is using IsItemHovered()
|
||||||
{
|
{
|
||||||
|
@ -566,11 +566,11 @@ struct ImGuiWindowSettings
|
|||||||
ImVec2 ViewportPos;
|
ImVec2 ViewportPos;
|
||||||
ImGuiID ViewportId;
|
ImGuiID ViewportId;
|
||||||
ImGuiID DockId; // ID of last known DockNode (even if the DockNode is invisible because it has only 1 active window), or 0 if none.
|
ImGuiID DockId; // ID of last known DockNode (even if the DockNode is invisible because it has only 1 active window), or 0 if none.
|
||||||
ImGuiID DockFamilyId; // ID of dock family if specified
|
ImGuiID ClassId; // ID of window class if specified
|
||||||
short DockOrder; // Order of the last time the window was visible within its DockNode. This is used to reorder windows that are reappearing on the same frame. Same value between windows that were active and windows that were none are possible.
|
short DockOrder; // Order of the last time the window was visible within its DockNode. This is used to reorder windows that are reappearing on the same frame. Same value between windows that were active and windows that were none are possible.
|
||||||
bool Collapsed;
|
bool Collapsed;
|
||||||
|
|
||||||
ImGuiWindowSettings() { Name = NULL; ID = 0; Pos = Size = ViewportPos = ImVec2(0, 0); ViewportId = DockId = DockFamilyId = 0; DockOrder = -1; Collapsed = false; }
|
ImGuiWindowSettings() { Name = NULL; ID = 0; Pos = Size = ViewportPos = ImVec2(0, 0); ViewportId = DockId = ClassId = 0; DockOrder = -1; Collapsed = false; }
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ImGuiSettingsHandler
|
struct ImGuiSettingsHandler
|
||||||
@ -734,7 +734,7 @@ struct ImGuiNextWindowData
|
|||||||
float BgAlphaVal;
|
float BgAlphaVal;
|
||||||
ImGuiID ViewportId;
|
ImGuiID ViewportId;
|
||||||
ImGuiID DockId;
|
ImGuiID DockId;
|
||||||
ImGuiDockFamily DockFamily;
|
ImGuiWindowClass WindowClass;
|
||||||
ImVec2 MenuBarOffsetMinVal; // This is not exposed publicly, so we don't clear it.
|
ImVec2 MenuBarOffsetMinVal; // This is not exposed publicly, so we don't clear it.
|
||||||
|
|
||||||
ImGuiNextWindowData()
|
ImGuiNextWindowData()
|
||||||
@ -754,7 +754,7 @@ struct ImGuiNextWindowData
|
|||||||
void Clear()
|
void Clear()
|
||||||
{
|
{
|
||||||
PosCond = SizeCond = ContentSizeCond = CollapsedCond = SizeConstraintCond = FocusCond = BgAlphaCond = ViewportCond = DockCond = 0;
|
PosCond = SizeCond = ContentSizeCond = CollapsedCond = SizeConstraintCond = FocusCond = BgAlphaCond = ViewportCond = DockCond = 0;
|
||||||
DockFamily = ImGuiDockFamily();
|
WindowClass = ImGuiWindowClass();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -781,7 +781,7 @@ struct ImGuiDockNode
|
|||||||
ImVec2 Size; // Current size
|
ImVec2 Size; // Current size
|
||||||
ImVec2 SizeRef; // [Split node only] Last explicitly written-to size (overridden when using a splitter affecting the node), used to calculate Size.
|
ImVec2 SizeRef; // [Split node only] Last explicitly written-to size (overridden when using a splitter affecting the node), used to calculate Size.
|
||||||
int SplitAxis; // [Split node only] Split axis (X or Y)
|
int SplitAxis; // [Split node only] Split axis (X or Y)
|
||||||
ImGuiDockFamily DockFamily;
|
ImGuiWindowClass WindowClass;
|
||||||
|
|
||||||
ImGuiWindow* HostWindow;
|
ImGuiWindow* HostWindow;
|
||||||
ImGuiWindow* VisibleWindow;
|
ImGuiWindow* VisibleWindow;
|
||||||
@ -1201,6 +1201,7 @@ struct IMGUI_API ImGuiWindow
|
|||||||
char* Name;
|
char* Name;
|
||||||
ImGuiID ID; // == ImHash(Name)
|
ImGuiID ID; // == ImHash(Name)
|
||||||
ImGuiWindowFlags Flags, FlagsPreviousFrame; // See enum ImGuiWindowFlags_
|
ImGuiWindowFlags Flags, FlagsPreviousFrame; // See enum ImGuiWindowFlags_
|
||||||
|
ImGuiWindowClass WindowClass; // Advanced users only. Set with SetNextWindowClass()
|
||||||
ImGuiViewportP* Viewport; // Always set in Begin(), only inactive windows may have a NULL value here
|
ImGuiViewportP* Viewport; // Always set in Begin(), only inactive windows may have a NULL value here
|
||||||
ImGuiID ViewportId; // We backup the viewport id (since the viewport may disappear or never be created if the window is inactive)
|
ImGuiID ViewportId; // We backup the viewport id (since the viewport may disappear or never be created if the window is inactive)
|
||||||
ImVec2 ViewportPos; // We backup the viewport position (since the viewport may disappear or never be created if the window is inactive)
|
ImVec2 ViewportPos; // We backup the viewport position (since the viewport may disappear or never be created if the window is inactive)
|
||||||
@ -1247,7 +1248,6 @@ struct IMGUI_API ImGuiWindow
|
|||||||
ImGuiCond SetWindowDockAllowFlags; // store acceptable condition flags for SetNextWindowDock() use.
|
ImGuiCond SetWindowDockAllowFlags; // store acceptable condition flags for SetNextWindowDock() use.
|
||||||
ImVec2 SetWindowPosVal; // store window position when using a non-zero Pivot (position set needs to be processed when we know the window size)
|
ImVec2 SetWindowPosVal; // store window position when using a non-zero Pivot (position set needs to be processed when we know the window size)
|
||||||
ImVec2 SetWindowPosPivot; // store window pivot for positioning. ImVec2(0,0) when positioning from top-left corner; ImVec2(0.5f,0.5f) for centering; ImVec2(1,1) for bottom right.
|
ImVec2 SetWindowPosPivot; // store window pivot for positioning. ImVec2(0,0) when positioning from top-left corner; ImVec2(0.5f,0.5f) for centering; ImVec2(1,1) for bottom right.
|
||||||
ImGuiDockFamily DockFamily; // set with SetNextWindowDockFamily()
|
|
||||||
|
|
||||||
ImGuiWindowTempData DC; // Temporary per-window data, reset at the beginning of the frame. This used to be called ImGuiDrawContext, hence the "DC" variable name.
|
ImGuiWindowTempData DC; // Temporary per-window data, reset at the beginning of the frame. This used to be called ImGuiDrawContext, hence the "DC" variable name.
|
||||||
ImVector<ImGuiID> IDStack; // ID stack. ID are hashes seeded with the value at the top of the stack
|
ImVector<ImGuiID> IDStack; // ID stack. ID are hashes seeded with the value at the top of the stack
|
||||||
|
Loading…
Reference in New Issue
Block a user