Enable/disable Group enables/disables all children
bobsneidar at iotecdigital.com
Fri Apr 27 10:57:22 EDT 2018
Darned if you do, darned if you don't. I get it. Still, looking at your example, it begs the question, what was the state of the enabled property for the individual objects before the parent group was disabled? The current situation is exactly what your objection describes. :-)
I worked around it by resending selectionChanged to the datagrid that these controls reflect, which sets the controls enabled property according to certain conditions.
> On Apr 26, 2018, at 23:15 , Mark Waddingham via use-livecode <use-livecode at lists.runrev.com> wrote:
>> Hi all.
>> I have a group that contains a number of objects, buttons, menus,
>> fuelds and groups. I just noticed that if I disable a group (so that
>> none of the objects in the group can be interacted with) I get the
>> desired effect. However when re-enabling the group, it *ALSO*
>> re-enables ALL the objects in that group, no matter what their status
>> was prior to disabling the group.
>> Is that the expected behavior? If not I will file a bug report. If so,
>> I will have to find another way to disable all the objects in a group,
>> or else trap for the action, and save the enabled property for every
>> containing object so I can reset them.
> It has been like that forever - there is an anomaly for it: https://quality.livecode.com/show_bug.cgi?id=14881
> The 'disabled' property should be effectively computed as the logical and of all the parent's property values (kind of like inherited properties, but with a different operation merging parent and child values), a bit like visible is - why it was never done that way originally is a question to which I do not have an answer!
> The problem with 'just' fixing it is that it is not possible to determine with the current behavior what the 'disabled' setting of any control is meant to be. If it is changed, then all controls in disabled groups which exist now will remain disabled - everyone would have to go through all their stacks and set the enablement of children appropriately.
> Warmest Regards,
More information about the Use-livecode