Opened 4 months ago

Last modified 10 days ago

#2724 reviewing feature request

EnumValueView should consider the FlagsAttribute

Reported by: pfleck Owned by: mkommend
Priority: medium Milestone: HeuristicLab 3.3.15
Component: Data.Views Version: 3.3.14
Keywords: Cc:

Description

The current EnumValueView offers a combobox to select the enum values.

If the enum has the FlagAttribute, a list of checkboxes should be displayed instead, to allow arbitrary combinations of the enum values.

Change History (2)

comment:1 Changed 4 months ago by pfleck

  • Status changed from new to accepted

r14597

  • Added a ListView for Flag-attributed enums in the EnumValueView.
  • Simplified EnumValue cloning (already done in base-constructor).
  • Added a SetFlag helper for enums.

comment:2 Changed 10 days ago by pfleck

  • Owner changed from pfleck to mkommend
  • Status changed from accepted to reviewing

Because EnumValues with Flags are not used yet in the trunk I used the following test script:

  public override void Main() {
    vars.MyEnum = new EnumValue<MyEnum>();
    vars.MyEnumFlags = new EnumValue<MyEnumFlags>();
    vars.MyEnumFlagsFoo = new EnumValue<MyEnumFlagsFoo>();
  }
  enum MyEnum {
    First, Second, Third
  }
  [Flags] enum MyEnumFlags {
    First, Second, Third, Forth, Sixth, Seventh
  }
  [Flags] enum MyEnumFlagsFoo {
    None = 0, First = 1 << 0, Second = 1 << 1, Third = 1 << 2,  Forth = 1 << 3, Sixth = 1 << 4, Seventh = 1 << 5
  }
Note: See TracTickets for help on using tickets.