tunapanel icon indicating copy to clipboard operation
tunapanel copied to clipboard

Widgets for enums

Open kmcallister opened this issue 7 years ago • 1 comments

Dropdowns? Radio buttons?

kmcallister avatar May 13 '17 03:05 kmcallister

Can you do differ depending on enum given?

enum CoffeType {
     HotChocolate,
     Espresso,
     Machiato,
}

Seems perfectly fit for radio group/dropdown, with simple annoation #[dropdown] enum CoffeType/ #[radiogroup] enum CoffeType

enum DDForm3018 {
    NaturalizedCitizen,
    UnnaturalizedCitizen { 
        has_voted_yes_on_proposition_187: bool,
        has_been_called_in_for_jury_dute: bool,
    },
}

This wouldn't. It probably be some complex radio button that enables certain panels or something.

Would it be possible for other people to register/create their own implementations? But, what is the scope of this library? Allow complex behavior? I.e. when one radio group selected enable some set of controls?

Ygg01 avatar May 14 '17 23:05 Ygg01