Method popupMenu.AddEnum
Overload
Adds enum members as checkbox-items (if it's a [Flags]
enum) or radio-items.
public EnumUI<TEnum> AddEnum<TEnum>(TEnum init = default, (TEnum value, string text)[] items = null) where TEnum : unmanaged, Enum
Parameters
init (TEnum)
Initial value. |
items ((TEnum value, string text)[])
Enum members and their text/tooltip. Optional. Text can be: |
Returns
EnumUI<TEnum>
Object for getting result later. See EnumUI<TEnum>.Result. |
Type Parameters
TEnum |
Examples
var m = new popupMenu();
var e1 = m.AddEnum<KMod>(KMod.Ctrl|KMod.Alt); //a [Flags] enum
m.Separator();
var e2 = m.AddEnum<DayOfWeek>(DateTime.Today.DayOfWeek); //a non-[Flags] enum
m.Show();
print.it(e1.Result);
print.it(e2.Result);