After giving this some thought, I think the best approach would be to
add the "selectOnly" flag to PushButton. I like giving the Button
subclass responsibility for deciding how to handle its selection
state, rather than relegating it to the Group and requiring all button
types to respect it.
This way, a PushButton can be configured to behave either like a radio
button or like a checkbox when it is in a group (currently, it behaves
like a checkbox only).
On Aug 19, 2009, at 6:20 PM, Greg Brown wrote:
...then again, maybe I am wrong about this. Would it make more sense
to adopt the behavior that, if a toggle-style push button is part of
a group, it behaves like a radio button and can't be deselected, but
when not in a group can be toggled on and off? I'm starting to think
that this is a good idea.
On Aug 19, 2009, at 6:16 PM, Greg Brown wrote:
I believe there are use cases for allowing the user to deselect a
toggled button. I can't think of a concrete one right now, but it's
along the lines of "you can choose A, B, C, or none of the above".
Radio buttons don't support it, but that's why our toggle-style
push buttons do.
On Aug 19, 2009, at 6:09 PM, Scott Lanham wrote:
For any program I have ever written if the toggle push buttons are
grouped
then one button in the group must always be selected with the only
exception
being the initial state of the group where none may be selected.
On Thu, 20 Aug 2009 08:04:56 am Greg Brown wrote:
I'm currently thinking of "selectOnly", but there may be better
options.
By the way, comments on this are welcome. Is this a feature that is
worth adding to PushButton, or would it be better implemented via a
custom subclass? Is this something that we think developers are
likely
to want to do often? I'm leaning towards "yes", but I'd like to
know
what others think.
G