Page 1 of 1

Can controls be de-activated, ie., grayed out?

Posted: Wed Jul 08, 2015 2:22 pm
by murphycoverdot2001
It's a pretty common UI tactic to gray controls that are inactive so they are visible but clearly not usable, but I can only see the option to hide controls like buttons or fields. Am I missing something?

Re: Can controls be de-activated, ie., grayed out?

Posted: Wed Jul 08, 2015 2:33 pm
by Klaus
HI murphy,

1. welcome to the forum! :D
2. You can always DIS- or ENABLE controls:
...
disable btn "my button"
enable bnt "my button"
## etc...
...
That is a shortcut for setting the ENABLED/DISABLED property:
...
set the enabled of btn "my button" to TRUE
set the disabled of btn "my button" to FALSE
## etc...
...
Here some great learning resources for this (and more!) kind of stuff:
http://www.hyperactivesw.com/revscriptc ... ences.html

Best

Klaus

Re: Can controls be de-activated, ie., grayed out?

Posted: Wed Jul 08, 2015 2:34 pm
by dave.kilroy
Hi murphycoverdot2001 and welcome to the forum - you can enable and disable controls, either in the inspector or by code using something like this:

Code: Select all

set the enabled of btn "btnTest" to false --disables
set the enabled of btn "btnTest" to true --enables
EDIT: that speedy Klaus beat me to it again! :)

Re: Can controls be de-activated, ie., grayed out?

Posted: Wed Jul 08, 2015 2:37 pm
by murphycoverdot2001
Never mind, I found the disabled property/disable command. All is good now. And now I see that Klaus was straightening me out, too. Thanks, Klaus.

FWIW, I tried googling livecode contorl inactive and came up with nothing relevant. It's always fun trying to guess the search terms that will get the goog to divulge her knowledge...

Re: Can controls be de-activated, ie., grayed out?

Posted: Wed Jul 08, 2015 3:30 pm
by FourthWorld
murphycoverdot2001 wrote:FWIW, I tried googling livecode contorl inactive and came up with nothing relevant. It's always fun trying to guess the search terms that will get the goog to divulge her knowledge...
Google is sometimes better than others. When I run that same search I get this forum link as the second hit, in which the first post there includes an example of disabling buttons:
http://forums.livecode.com/viewtopic.php?f=8&t=5825

The team is revising the docs to include tags, which will greatly enhance their searchability. In the meantime, we have these forums for any edge cases where the synonyms we're looking for don't show up readily in other search engines.

Re: Can controls be de-activated, ie., grayed out?

Posted: Wed Jul 08, 2015 4:01 pm
by dunbarx
I never use Google to find links or topics, preferring rather to search within the use-list or the forum directly. I suppose new users choose this path because it is second nature to do so with all questions on all subjects generally.

I just wonder if it is important to make sure that such queries are ALWAYS directed to one of the two venues? We want a well attended, centralized discussion, er, forum, (or two) because these are best suited to provide answers. The community will grow, and many lost souls will find solace; hardly anyone is left without resolution here, whereas in the world at large, who knows how many have simply met a dead end and gone away?

If tags can be weighted so that searches of any general kind would point to the forum (my favorite venue), I bet we would see a lot more newbie activity.

Craig Newman