// Combo Box

        public static int ComboBox(string sideLabel, int currentSelectedItem, List <string> objectList, ComboFlags comboFlags = ComboFlags.HeightRegular)
        {
            ImGui.Combo(sideLabel, ref currentSelectedItem, objectList.ToArray());
            return(currentSelectedItem);
        }
        public static string ComboBox(string sideLabel, string currentSelectedItem, List <string> objectList, out bool didChange, ComboFlags comboFlags = ComboFlags.HeightRegular)
        {
            if (ImGui.BeginCombo(sideLabel, currentSelectedItem, comboFlags))
            {
                var refObject = currentSelectedItem;
                for (var n = 0; n < objectList.Count; n++)
                {
                    var isSelected = refObject == objectList[n];
                    if (ImGui.Selectable(objectList[n], isSelected))
                    {
                        didChange = true;
                        ImGui.EndCombo();
                        return(objectList[n]);
                    }

                    if (isSelected)
                    {
                        ImGui.SetItemDefaultFocus();
                    }
                }

                ImGui.EndCombo();
            }

            didChange = false;
            return(currentSelectedItem);
        }
Exemple #3
0
 public static bool BeginCombo(string label, string previewValue, ComboFlags flags)
 => ImGuiNative.igBeginCombo(label, previewValue, flags);
 public static string ComboBox(string sideLabel, string currentSelectedItem, List <string> objectList, ComboFlags comboFlags = ComboFlags.HeightRegular)
 {
     if (ImGui.BeginCombo(sideLabel, currentSelectedItem, comboFlags))
     {
         string str = currentSelectedItem;
         for (int index = 0; index < objectList.Count; ++index)
         {
             bool isSelected = str == objectList[index];
             if (ImGui.Selectable(objectList[index], isSelected))
             {
                 return(objectList[index]);
             }
             if (isSelected)
             {
                 ImGui.SetItemDefaultFocus();
             }
         }
         ImGui.EndCombo();
     }
     return(currentSelectedItem);
 }
Exemple #5
0
        public static string ComboBox(string sideLabel, string previewString, string currentSelectedItem, List <string> objectList, ComboFlags comboFlags = ComboFlags.HeightRegular)
        {
            if (ImGui.BeginCombo(sideLabel, currentSelectedItem == null? previewString : currentSelectedItem, comboFlags))
            {
                var refObject = currentSelectedItem;
                for (var n = 0; n < objectList.Count; n++)
                {
                    var isSelected = refObject == objectList[n];
                    if (ImGui.Selectable(objectList[n], isSelected))
                    {
                        ImGui.EndCombo();
                        return(objectList[n]);
                    }

                    if (isSelected)
                    {
                        ImGui.SetItemDefaultFocus();
                    }
                }

                ImGui.EndCombo();
            }

            return(currentSelectedItem);
        }
Exemple #6
0
 public static bool BeginCombo(string label, string previewValue, ComboFlags flags)
 => ImGuiNative.igBeginCombo(utf8String(label), utf8String(previewValue), flags);
Exemple #7
0
        public bool BeginCombo(string label, string preview_value, ComboFlags flags)
        {
            bool ret = EffekseerNativePINVOKE.GUIManager_BeginCombo(swigCPtr, label, preview_value, (int)flags);

            return(ret);
        }