brutal/Brutal.ImGui/Generated/PInvoke/BeginPopupContextItem.gen.cs
Rian Drake b578433e37 first
2026-10-15 17:10:50 +13:00

56 lines
3.6 KiB
C#

// <auto-generated/>
// Generated by Brutal.ImGui.Generator; do not edit by hand.
#nullable enable
namespace Brutal.ImGuiApi
{
public partial class ImGui
{
public unsafe partial class PInvoke
{
/// <summary>
/// <para>
/// open+begin popup when clicked on last item. Use str_id==NULL to associate the popup to previous
/// item. If you want to use that on a non-interactive item such as Text() you need to pass in an
/// explicit ID here. read comments in .cpp!
/// </para>
/// <para>
/// C++:
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui.h#L874">imgui.h:874</see>
/// ,
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui.cpp#L12975">imgui.cpp:12975</see>
/// <br/><c>bool BeginPopupContextItem(const char* str_id = NULL, ImGuiPopupFlags popup_flags = 1)</c>
/// </para>
/// </summary>
/// <remarks>
/// <code>
/// Popups: open+begin combined functions helpers
/// - Helpers to do OpenPopup+BeginPopup where the Open action is triggered by e.g. hovering an item and right-clicking.
/// - They are convenient to easily create context menus, hence the name.
/// - IMPORTANT: Notice that BeginPopupContextXXX takes ImGuiPopupFlags just like OpenPopup() and unlike BeginPopup(). For full consistency, we may add ImGuiWindowFlags to the BeginPopupContextXXX functions in the future.
/// - IMPORTANT: Notice that we exceptionally default their flags to 1 (== ImGuiPopupFlags_MouseButtonRight) for backward compatibility with older API taking 'int mouse_button = 1' parameter, so if you add other flags remember to re-add the ImGuiPopupFlags_MouseButtonRight.
/// </code>
/// <code>
/// This is a helper to handle the simplest case of associating one named popup to one given widget.
/// - To create a popup associated to the last item, you generally want to pass a NULL value to str_id.
/// - To create a popup with a specific identifier, pass it in str_id.
/// - This is useful when using using BeginPopupContextItem() on an item which doesn't have an identifier, e.g. a Text() call.
/// - This is useful when multiple code locations may want to manipulate/open the same popup, given an explicit id.
/// - You may want to handle the whole on user side if you have specific needs (e.g. tweaking IsItemHovered() parameters).
/// This is essentially the same as:
/// id = str_id ? GetID(str_id) : GetItemID();
/// OpenPopupOnItemClick(str_id, ImGuiPopupFlags_MouseButtonRight);
/// return BeginPopup(id);
/// Which is essentially the same as:
/// id = str_id ? GetID(str_id) : GetItemID();
/// if (IsItemHovered() &amp;&amp; IsMouseReleased(ImGuiMouseButton_Right))
/// OpenPopup(id);
/// return BeginPopup(id);
/// The main difference being that this is tweaked to avoid computing the ID twice.
/// </code>
/// </remarks>
[LibraryImport("imgui")]
public static unsafe partial Bool8 BeginPopupContextItem(byte* str_id, ImGuiPopupFlags popup_flags);
}
}
}