From 7f1bc8c6f239e2e702bdab6d5d8a855b1124217f Mon Sep 17 00:00:00 2001 From: Eric Mellino Date: Fri, 19 Aug 2016 09:40:05 -0700 Subject: [PATCH] Added an overload for MenuItem taking only a label and an enabled state --- src/ImGui.NET/ImGui.cs | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/ImGui.NET/ImGui.cs b/src/ImGui.NET/ImGui.cs index 6abf06e..a2a4845 100644 --- a/src/ImGui.NET/ImGui.cs +++ b/src/ImGui.NET/ImGui.cs @@ -520,13 +520,26 @@ namespace ImGuiNET ImGuiNative.igSeparator(); } - public static bool MenuItem(string label) => MenuItem(label, string.Empty); + public static bool MenuItem(string label) + { + return MenuItem(label, string.Empty, false, true); + } public static bool MenuItem(string label, string shortcut) { return MenuItem(label, shortcut, false, true); } + public static bool MenuItem(string label, bool enabled) + { + return MenuItem(label, string.Empty, false, enabled); + } + + public static bool MenuItem(string label, string shortcut, bool selected, bool enabled) + { + return ImGuiNative.igMenuItem(label, shortcut, selected, enabled); + } + public static unsafe bool InputText(string label, IntPtr textBuffer, uint bufferSize, InputTextFlags flags, TextEditCallback textEditCallback) { return InputText(label, textBuffer, bufferSize, flags, textEditCallback, IntPtr.Zero); @@ -537,11 +550,6 @@ namespace ImGuiNET return ImGuiNative.igInputText(label, textBuffer, bufferSize, flags, textEditCallback, userData.ToPointer()); } - public static bool MenuItem(string label, string shortcut, bool selected, bool enabled) - { - return ImGuiNative.igMenuItem(label, shortcut, selected, enabled); - } - public static void EndWindow() { ImGuiNative.igEnd();