From 74977868669033a63c32abee8e08aa33bccb412b Mon Sep 17 00:00:00 2001 From: David Pethes Date: Thu, 1 Jun 2017 23:48:11 +0200 Subject: [PATCH] add TreeNodeEx and related fixes --- src/ImGui.NET/ColorTarget.cs | 2 +- src/ImGui.NET/ImGui.cs | 13 +++++++++---- src/ImGui.NET/ImGuiNative.cs | 6 +++++- src/ImGui.NET/TreeNodeFlags.cs | 2 +- 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/src/ImGui.NET/ColorTarget.cs b/src/ImGui.NET/ColorTarget.cs index 2d885fa..6237d30 100644 --- a/src/ImGui.NET/ColorTarget.cs +++ b/src/ImGui.NET/ColorTarget.cs @@ -9,6 +9,7 @@ TextDisabled, WindowBg, ChildWindowBg, + PopupBg, Border, BorderShadow, /// @@ -49,7 +50,6 @@ PlotHistogram, PlotHistogramHovered, TextSelectedBg, - TooltipBg, /// /// darken entire screen when a modal window is active /// diff --git a/src/ImGui.NET/ImGui.cs b/src/ImGui.NET/ImGui.cs index 73b4346..6840d90 100644 --- a/src/ImGui.NET/ImGui.cs +++ b/src/ImGui.NET/ImGui.cs @@ -1052,14 +1052,14 @@ namespace ImGuiNET ImGuiNative.igSetTooltip(text); } - public static void SetNextTreeNodeOpened(bool opened) + public static void SetNextTreeNodeOpen(bool opened) { - ImGuiNative.igSetNextTreeNodeOpened(opened, SetCondition.Always); + ImGuiNative.igSetNextTreeNodeOpen(opened, SetCondition.Always); } - public static void SetNextTreeNodeOpened(bool opened, SetCondition setCondition) + public static void SetNextTreeNodeOpen(bool opened, SetCondition setCondition) { - ImGuiNative.igSetNextTreeNodeOpened(opened, setCondition); + ImGuiNative.igSetNextTreeNodeOpen(opened, setCondition); } public static bool TreeNode(string label) @@ -1067,6 +1067,11 @@ namespace ImGuiNET return ImGuiNative.igTreeNode(label); } + public static bool TreeNodeEx(string label, TreeNodeFlags flags = 0) + { + return ImGuiNative.igTreeNodeEx(label); + } + public static void TreePop() { ImGuiNative.igTreePop(); diff --git a/src/ImGui.NET/ImGuiNative.cs b/src/ImGui.NET/ImGuiNative.cs index fbb41f1..55fe1f2 100644 --- a/src/ImGui.NET/ImGuiNative.cs +++ b/src/ImGui.NET/ImGuiNative.cs @@ -454,6 +454,10 @@ namespace ImGuiNET [DllImport(cimguiLib)] [return: MarshalAs(UnmanagedType.I1)] public static extern bool igTreeNode(string str_label_id); + + [DllImport(cimguiLib)] + [return: MarshalAs(UnmanagedType.I1)] + public static extern bool igTreeNodeEx(string label, TreeNodeFlags flags = 0); [DllImport(cimguiLib)] [return: MarshalAs(UnmanagedType.I1)] @@ -470,7 +474,7 @@ namespace ImGuiNET [DllImport(cimguiLib)] public static extern void igTreePop(); [DllImport(cimguiLib)] - public static extern void igSetNextTreeNodeOpened(bool opened, SetCondition cond); + public static extern void igSetNextTreeNodeOpen(bool opened, SetCondition cond); [DllImport(cimguiLib)] [return: MarshalAs(UnmanagedType.I1)] public static extern bool igCollapsingHeader(string label, TreeNodeFlags flags = 0); diff --git a/src/ImGui.NET/TreeNodeFlags.cs b/src/ImGui.NET/TreeNodeFlags.cs index 933a683..96c122a 100644 --- a/src/ImGui.NET/TreeNodeFlags.cs +++ b/src/ImGui.NET/TreeNodeFlags.cs @@ -22,7 +22,7 @@ namespace ImGuiNET /// NoTreePushOnOpen = 1 << 3, /// - /// Don't do a TreePush() when open (e.g. for CollapsingHeader) = no extra indent nor pushing on ID stack + /// Don't automatically and temporarily open node when Logging is active (by default logging will automatically open tree nodes) /// NoAutoOpenOnLog = 1 << 4, ///