class Efl.Ui.Radio @beta ├ (P) state_value ├ (P) value_pointer ├ (P) selected_object ├ (M) group_add
|Open||None||T7510 evaluate stabilization potential of efl.ui classes and dependencies|
This here is a try to come up with a design for a group class. I go here with the assertion that any set of radio buttons wants to be added in a group.
A new class Efl.Ui.Radio_Group. This class inherits from efl.ui.box. You can only add new Efl.Ui.Radio class instances to it. This means the placing and logical connection of radio buttons are now the same. Which is quite sane IMO since radio button groups do come with the same ui placement.
This will result in efl.ui.radio.eo only having one property state_value.
And another class Efl.Ui.Radio_Group that has value, and selected object.
I like how this simplifies creating radio groups, since you now provide the Efl.Ui.Box automatically.
However, I fear we lose the flexibility to have radio buttons anywhere in the UI (we only provide the API, we should not judge if that makes sense or not).
How about we keep the current grouping mechanism as the "low level API" (fixing what's broken) and add your proposed Efl.Ui.Radio_Group as the "high level API". The Radio_Group class would take care of keeping each Radio's group pointers pointing to the right place, etc.
We could do it like this:
The logical group is not a graphical element but rather just the logical stuff, (ensuring one radio button is only enabled etc.)
The box then is just inheriting from Efl.Ui.Box, and additionally has an internal Logical_Group where all the content is added to.
Does that sound nice ?
I don't think we can fix the logical group in a sane manner in the radio group itself.
I like it. Simple case: you instantiate a radio box and add radio buttons. Complex case, you instantiate a radio logical_group and register radio buttons to it, remembering to also add the radio buttons to the ui wherever you want.
Current Elm implementation already has a Logical_Group equivalent in the Group structure. This approach only makes it explicit and therefore easier to understand.