コード例 #1
0
        public static unsafe bool BeginTabItemNullableOpen(string label, bool *p_open, ImGuiTabItemFlags flags)
        {
            byte *native_label;
            int   label_byteCount = 0;

            if (label != null)
            {
                label_byteCount = Encoding.UTF8.GetByteCount(label);
                if (label_byteCount > Util.StackAllocationSizeLimit)
                {
                    native_label = Util.Allocate(label_byteCount + 1);
                }
                else
                {
                    byte *native_label_stackBytes = stackalloc byte[label_byteCount + 1];
                    native_label = native_label_stackBytes;
                }
                int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount);
                native_label[native_label_offset] = 0;
            }
            else
            {
                native_label = null;
            }

            byte ret = ImGuiNative.igBeginTabItem(native_label, (byte *)p_open, flags);

            if (label_byteCount > Util.StackAllocationSizeLimit)
            {
                Util.Free(native_label);
            }

            return(ret != 0);
        }
コード例 #2
0
ファイル: ImGuiEx.cs プロジェクト: code2X/ImGui.NETEx
 protected void TabItemView(string label, ImGuiExNative.Callback action, ref bool p_open, ImGuiTabItemFlags flags)
 {
     if (ImGui.BeginTabItem(label, ref p_open, flags))
     {
         action();
         ImGui.EndTabItem();
     }
     ;
 }
コード例 #3
0
 public static bool BeginTabItem(string label, ref bool p_open, ImGuiTabItemFlags flags)
 {
     return(ImGui.BeginTabItem(label, ref p_open, flags));
 }