Re: Enable/disable Group enables/disables all children

2018-04-27 Thread Bob Sneidar via use-livecode
> On Apr 27, 2018, at 10:04 , Mark Waddingham via use-livecode 
>  wrote:
> 
> You can't tell what the state of disabled was of a child before the owning 
> group's disabled property is set - that's the problem.
> 
> Imagine we change this without any regard for backwards compatibility to the 
> preferred (correct!) model. Then when you open your stack, setting the 
> 'disabled' of a group to 'false' will then *only* affect the disabled 
> property of the group - not the children. All the children will remain with 
> disabled 'true' (as it won't be setting the property any more on children).
> 
> This means that everyone would have to go through every card of every single 
> stack which has groups which are disabled, which contain children which 
> should be enabled/disabled with the group's enablement and change those child 
> controls disabled property to false (as they will be true at present).


Unless disabling a group prevented you from interacting with any of the 
children without actually disabling the children. One scenario you have to 
disable all the children, the other you have to re-enable them based upon a 
prior state saved in some fashion. As I said, darned if you do, darned if you 
don't. One leg is both the same. :-)

But it's okay, I can script around it. I'm more interested in a detailed single 
file function, but again I can work around that too. I will just filter the 
detailed files of the enclosing folder and hope that in the distant future 
someone doesn't try to use this function on a folder with 10,000+ files. Of 
course by then we will probably be storing data in microbes. 

Bob S




___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Enable/disable Group enables/disables all children

2018-04-27 Thread Mark Waddingham via use-livecode

On 2018-04-27 16:57, Bob Sneidar via use-livecode wrote:

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. :-)


You can't tell what the state of disabled was of a child before the 
owning group's disabled property is set - that's the problem.


Imagine we change this without any regard for backwards compatibility to 
the preferred (correct!) model. Then when you open your stack, setting 
the 'disabled' of a group to 'false' will then *only* affect the 
disabled property of the group - not the children. All the children will 
remain with disabled 'true' (as it won't be setting the property any 
more on children).


This means that everyone would have to go through every card of every 
single stack which has groups which are disabled, which contain children 
which should be enabled/disabled with the group's enablement and change 
those child controls disabled property to false (as they will be true at 
present).


I get the feeling that a lot of people have a lot of stacks where the 
group enablement behavior is fine (as they do want their child controls 
to enable/disable with the group), and so they won't have scripted 
anything, so they will find a lot of disabled controls!


Warmest Regards,

Mark.

P.S. The engine change (from memory) is relatively straight-forward I 
think - we already have visible as a pattern - so the main issue is 
migration forward - which could be a lot of work for large stacks which 
might have a mixture of scripted and 'by-engine' enablement/disablement.


--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


RE: Enable/disable Group enables/disables all children

2018-04-27 Thread Ralph DiMola via use-livecode
I ran into this on a card basis. I have a handler that loops thru all controls 
and disables(and dims) them so a user can't do anything until some function is 
complete and a complementary handler that enables them all. This became a 
problem if one of the controls on the card was disabled. To solve this I put a 
custom property on the card with all the long IDs of all the controls and their 
initial "enabled" state before disabling everything. When re-enabling all the 
controls I look at the array and decide which controls need to be enabled. The 
same thing could be done for groups.

Ralph DiMola
IT Director
Evergreen Information Services
rdim...@evergreeninfo.net



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Enable/disable Group enables/disables all children

2018-04-27 Thread Bob Sneidar via use-livecode
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. 

Bob S


> On Apr 26, 2018, at 23:15 , Mark Waddingham via use-livecode 
>  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,
> 
> Mark.


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Enable/disable Group enables/disables all children

2018-04-27 Thread Mark Waddingham via use-livecode

On 2018-04-27 08:15, Mark Waddingham via use-livecode wrote:

The 'disabled' property should be effectively computed as the logical
and of all the parent's property values


This should be 'logical or' - i.e. a control is disabled if any one of 
its parent controls is. It is 'logical and' for the enabled property 
(which is just the 'not' of disabled, of course).


Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Enable/disable Group enables/disables all children

2018-04-27 Thread Mark Waddingham via use-livecode

On 2018-04-26 19:06, Bob Sneidar via use-livecode 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,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Enable/disable Group enables/disables all children

2018-04-26 Thread Brian Milby via use-livecode
It was probably driven by the data structure more than anything. To upgrade
enabled from one bit to two everywhere would have been non-trivial
(including the now required parent check for the value).
On Thu, Apr 26, 2018 at 4:59 PM Bob Sneidar via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Or else not inherited.
>
> Bob S
>
>
> > On Apr 26, 2018, at 14:56 , Brian Milby via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> >
> > For that to work, “enabled” would need to be a triple state inherited
> > property.
>
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: Enable/disable Group enables/disables all children

2018-04-26 Thread Bob Sneidar via use-livecode
Or else not inherited. 

Bob S


> On Apr 26, 2018, at 14:56 , Brian Milby via use-livecode 
>  wrote:
> 
> For that to work, “enabled” would need to be a triple state inherited
> property.

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: Enable/disable Group enables/disables all children

2018-04-26 Thread Brian Milby via use-livecode
For that to work, “enabled” would need to be a triple state inherited
property.
On Thu, Apr 26, 2018 at 4:34 PM Mark Wieder via use-livecode <
use-livecode@lists.runrev.com> wrote:

> On 04/26/2018 12:18 PM, dunbarx via use-livecode wrote:
> > Does it make it more palatable to think about it the other way around?
> There
> > should be no real difference:
> >
> > You have a group where one button is already enabled, and one already
> > disabled.
> >
> > By disabling the group, should the enabled button stay enabled?
>
> Stop confusing me with logic! 
>
> A different example:
>
> If I hide a group with some hidden controls, I expect all the controls
> in the group to be hidden because the enclosing group is. And when I
> show the group again, I expect the hidden controls to remain hidden.
>
> --
>   Mark Wieder
>   ahsoftw...@gmail.com
>
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: Enable/disable Group enables/disables all children

2018-04-26 Thread Bob Sneidar via use-livecode
Exactly. This is not a point of reason as much as it is a decision someone made 
a long time ago about how to treat certain properties of objects within a group 
when the same property of the group was modified. Apparently there is a special 
case for enabled. Someone decided that enabling a group meant enabling 
everything IN the group, but that this principle should apply to almost nothing 
else about groups! 

Bob S


> On Apr 26, 2018, at 14:33 , Mark Wieder via use-livecode 
>  wrote:
> 
>> Does it make it more palatable to think about it the other way around? There
>> should be no real difference:
>> You have a group where one button is already enabled, and one already
>> disabled.
>> By disabling the group, should the enabled button stay enabled?
> 
> Stop confusing me with logic! 
> 
> A different example:
> 
> If I hide a group with some hidden controls, I expect all the controls in the 
> group to be hidden because the enclosing group is. And when I show the group 
> again, I expect the hidden controls to remain hidden.
> 
> -- 
> Mark Wieder
> ahsoftw...@gmail.com


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Enable/disable Group enables/disables all children

2018-04-26 Thread Mark Wieder via use-livecode

On 04/26/2018 12:18 PM, dunbarx via use-livecode wrote:

Does it make it more palatable to think about it the other way around? There
should be no real difference:

You have a group where one button is already enabled, and one already
disabled.

By disabling the group, should the enabled button stay enabled?


Stop confusing me with logic! 

A different example:

If I hide a group with some hidden controls, I expect all the controls 
in the group to be hidden because the enclosing group is. And when I 
show the group again, I expect the hidden controls to remain hidden.


--
 Mark Wieder
 ahsoftw...@gmail.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Enable/disable Group enables/disables all children

2018-04-26 Thread Bob Sneidar via use-livecode
Not while the group is disabled, but then afterwards, yes. 

Bob S


> On Apr 26, 2018, at 12:18 , dunbarx via use-livecode 
>  wrote:
> 
> Does it make it more palatable to think about it the other way around? There
> should be no real difference:
> 
> You have a group where one button is already enabled, and one already
> disabled.
> 
> By disabling the group, should the enabled button stay enabled?
> 
> Craig
> 
> 
> 
> --
> Sent from: 
> http://runtime-revolution.278305.n4.nabble.com/Revolution-User-f278306.html
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Enable/disable Group enables/disables all children

2018-04-26 Thread dunbarx via use-livecode
I think this is expected behavior.

If you have a group of three buttons:

1- disable one of them
2- disable the group
3 enable the group

You do get all three buttons enabled. But the thinking is likely along the
lines of: "That guy enabled the group, right? That means enable the group, 
which includes all its member controls, right?"

Or something like that.

I think this has merit, and I would just set a custom property to restore
the disabled controls.

Craig Newman





--
Sent from: 
http://runtime-revolution.278305.n4.nabble.com/Revolution-User-f278306.html

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Enable/disable Group enables/disables all children

2018-04-26 Thread Brian Milby via use-livecode
My guess... it is because disabled is not an inherited property. All of the
other examples have been properties that are inherited if not explicitly
set. As such a decision was made that setting the enabled property on a
group effects all objects in the group.
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Enable/disable Group enables/disables all children

2018-04-26 Thread dunbarx via use-livecode
Does it make it more palatable to think about it the other way around? There
should be no real difference:

You have a group where one button is already enabled, and one already
disabled.

By disabling the group, should the enabled button stay enabled?

Craig



--
Sent from: 
http://runtime-revolution.278305.n4.nabble.com/Revolution-User-f278306.html

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Enable/disable Group enables/disables all children

2018-04-26 Thread Paul Dupuis via use-livecode
On 4/26/2018 2:45 PM, Richard Gaskin via use-livecode wrote:
> So if we proposed a change to do what you and I feel is more logical,
> the current behavior was put into place long enough ago that we'd now
> have to think about compatibility issues. :(

Bummer :-(

I must admit I have never knowingly run across this since in every case
I can think of when I disable a group and then enable it, all controls
in the group were enabled before hand and should again be enabled after
the group is enabled.

However, I can imagine all sort of instances where you would definitely
want the controls to retain their prior enabled states when
enabling/disabling a containing group.


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Enable/disable Group enables/disables all children

2018-04-26 Thread Bob Sneidar via use-livecode
I suppose a better example would be setting the backgroundColor of a group to 
blue. Should ALL the objects backgroundColor also be set to blue? If not, then 
why the disabled property? 

Bob S


> On Apr 26, 2018, at 11:50 , Bob Sneidar via use-livecode 
>  wrote:
> 
> You may be correct. This might be the expected behavior. But I am not 
> convinced by the logic. It would be like saying that by dying my hair orange, 
> I obviously wanted all the hair on my body to also be orange, or that I 
> obviously wanted all my children's hair to be orange. Or that by locking me 
> up in a jail cell you wanted all my children to go to jail, or vis versa. 
> 
> Disabling a group would be a great way to globally disable a set of controls, 
> without going through the trouble of disabling each control, or else what 
> other purpose does disabling a group have? The group will not respond to 
> mouse actions. This must mean then, that if for example you set any property 
> of a group, that all the contained objects would inherit that property. This 
> could have some serious consequences, especially if it pertained to custom 
> properties as well. Thankfully it does not! 
> 
> Bob S


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Enable/disable Group enables/disables all children

2018-04-26 Thread Bob Sneidar via use-livecode
You may be correct. This might be the expected behavior. But I am not convinced 
by the logic. It would be like saying that by dying my hair orange, I obviously 
wanted all the hair on my body to also be orange, or that I obviously wanted 
all my children's hair to be orange. Or that by locking me up in a jail cell 
you wanted all my children to go to jail, or vis versa. 

Disabling a group would be a great way to globally disable a set of controls, 
without going through the trouble of disabling each control, or else what other 
purpose does disabling a group have? The group will not respond to mouse 
actions. This must mean then, that if for example you set any property of a 
group, that all the contained objects would inherit that property. This could 
have some serious consequences, especially if it pertained to custom properties 
as well. Thankfully it does not! 

Bob S


> On Apr 26, 2018, at 11:04 , dunbarx via use-livecode 
>  wrote:
> 
> i would say this is expected behavior.
> 
> If you disable a control in a group, and then enable the group, LC assumes
> you want to, er, enable the group, and that means all members of that group.
> 
> So as you mentioned, make a gadget that stores the states of all the
> members, and resets when the group is enabled.
> 
> Craig Newman


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Enable/disable Group enables/disables all children

2018-04-26 Thread Richard Gaskin via use-livecode

Paul Dupuis wrote:
> On 4/26/2018 1:06 PM, Bob Sneidar via use-livecode 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.
>>
>
> I don't know if that is the "expected" behavior by LiveCode, but it is
> NOT the behavior I would expect. I would expect when enabling a group
> that every object in the group was still in whatever disabled/enabled
> state it was in BEFORE the group was disabled.

I had thought the way you describe it is how it worked.  But I just 
checked in v9 and v6.7 and it works as Bob describes.


So if we proposed a change to do what you and I feel is more logical, 
the current behavior was put into place long enough ago that we'd now 
have to think about compatibility issues. :(


--
 Richard Gaskin
 Fourth World Systems
 Software Design and Development for the Desktop, Mobile, and the Web
 
 ambassa...@fourthworld.comhttp://www.FourthWorld.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Enable/disable Group enables/disables all children

2018-04-26 Thread dunbarx via use-livecode
i would say this is expected behavior.

If you disable a control in a group, and then enable the group, LC assumes
you want to, er, enable the group, and that means all members of that group.

So as you mentioned, make a gadget that stores the states of all the
members, and resets when the group is enabled.

Craig Newman



--
Sent from: 
http://runtime-revolution.278305.n4.nabble.com/Revolution-User-f278306.html

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Enable/disable Group enables/disables all children

2018-04-26 Thread Paul Dupuis via use-livecode
On 4/26/2018 1:06 PM, Bob Sneidar via use-livecode 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. 
>

I don't know if that is the "expected" behavior by LiveCode, but it is
NOT the behavior I would expect. I would expect when enabling a group
that every object in the group was still in whatever disabled/enabled
state it was in BEFORE the group was disabled.

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Enable/disable Group enables/disables all children

2018-04-26 Thread Bob Sneidar via use-livecode
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. 

Bob S


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode