add ImGuiTreeNodeFlags

internals
David Pethes 7 years ago
parent 651da03c03
commit 6d0581a304
  1. 1
      src/ImGui.NET/ImGui.NET.Net46.csproj
  2. 1
      src/ImGui.NET/ImGui.NET.csproj
  3. 6
      src/ImGui.NET/ImGui.cs
  4. 4
      src/ImGui.NET/ImGuiNative.cs
  5. 51
      src/ImGui.NET/TreeNodeFlags.cs

@ -15,6 +15,7 @@
<ItemGroup>
<Compile Include="Align.cs" />
<Compile Include="ColorTarget.cs" />
<Compile Include="TreeNodeFlags.cs" />
<Compile Include="IntStructs.cs" />
<Compile Include="MouseCursorKind.cs" />
<Compile Include="NativeIO.cs" />

@ -13,6 +13,7 @@
<ItemGroup>
<Compile Include="Align.cs" />
<Compile Include="ColorTarget.cs" />
<Compile Include="TreeNodeFlags.cs" />
<Compile Include="IntStructs.cs" />
<Compile Include="MouseCursorKind.cs" />
<Compile Include="NativeIO.cs" />

@ -142,12 +142,12 @@ namespace ImGuiNET
//obsolete!
public static bool CollapsingHeader(string label, string id, bool displayFrame, bool defaultOpen)
{
int default_open_flags = 1 << 5;
{
TreeNodeFlags default_open_flags = TreeNodeFlags.DefaultOpen;
return ImGuiNative.igCollapsingHeader(label, (defaultOpen ? default_open_flags : 0));
}
public static bool CollapsingHeader(string label, int flags)
public static bool CollapsingHeader(string label, TreeNodeFlags flags)
{
return ImGuiNative.igCollapsingHeader(label, flags);
}

@ -473,10 +473,10 @@ namespace ImGuiNET
public static extern void igSetNextTreeNodeOpened(bool opened, SetCondition cond);
[DllImport(cimguiLib)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool igCollapsingHeader(string label, int flags); //ImGuiTreeNodeFlags
public static extern bool igCollapsingHeader(string label, TreeNodeFlags flags = 0);
[DllImport(cimguiLib)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool igCollapsingHeader(string label, ref bool p_open, int flags); //ImGuiTreeNodeFlags
public static extern bool igCollapsingHeader(string label, ref bool p_open, TreeNodeFlags flags = 0);
// Widgets: Selectable / Lists
[DllImport(cimguiLib)]

@ -0,0 +1,51 @@
using System;
namespace ImGuiNET
{
[Flags]
public enum TreeNodeFlags : int
{
/// <summary>
/// Draw as selected
/// </summary>
Selected = 1 << 0,
/// <summary>
/// Full colored frame (e.g. for CollapsingHeader)
/// </summary>
Framed = 1 << 1,
/// <summary>
/// Hit testing to allow subsequent widgets to overlap this one
/// </summary>
AllowOverlapMode = 1 << 2,
/// <summary>
/// Don't do a TreePush() when open (e.g. for CollapsingHeader) = no extra indent nor pushing on ID stack
/// </summary>
NoTreePushOnOpen = 1 << 3,
/// <summary>
/// Don't do a TreePush() when open (e.g. for CollapsingHeader) = no extra indent nor pushing on ID stack
/// </summary>
NoAutoOpenOnLog = 1 << 4,
/// <summary>
/// Default node to be open
/// </summary>
DefaultOpen = 1 << 5,
/// <summary>
/// Need double-click to open node
/// </summary>
OpenOnDoubleClick = 1 << 6,
/// <summary>
/// Only open when clicking on the arrow part. If ImGuiTreeNodeFlags_OpenOnDoubleClick is also set, single-click arrow or double-click all box to open.
/// </summary>
OpenOnArrow = 1 << 7,
/// <summary>
/// No collapsing, no arrow (use as a convenience for leaf nodes).
/// </summary>
Leaf = 1 << 8,
/// <summary>
/// Display a bullet instead of arrow
/// </summary>
Bullet = 1 << 9,
CollapsingHeader = Framed | NoAutoOpenOnLog
};
}
Loading…
Cancel
Save