A way to 'dim' a group of controls ?

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
Traxgeek
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 281
Joined: Wed Jan 09, 2013 10:11 am

A way to 'dim' a group of controls ?

Post by Traxgeek » Fri Sep 13, 2013 10:09 am

Hi,

On my card, I have a group of controls that pop-up when a user needs to, say, enter the date (like, a calendar date picker thingy).
So, in this case, clicking on a small 'calendar' button on my card sets the visible of the calendar group to true and, lo and behold, my calendar date picker is displayed...
but... all the other controls on the 'background' card also remain active... which means that a misplaced click/touch on the existing 'background' card messes up my 'logic' in that something else can then occur before the user closes the calendar date picker thingy...

I can put the card's background controls into one, or more, group(s) and disable them upon displaying the calendar date picker group. Then I can re-enable any disabled group(s) upon exiting the calendar date picker group. Simple and effective BUT the user doesn't necessarily know that he/she MUST close the calendar date picker group before the other controls will become active/enabled again...

So... I'd like to be able to 'dim' the controls (or groups of controls) that are not currently accessible / if they are the background.

Is there a simple way to do this ? I've looked up 'dim' and 'enable' etc. but to no avail. Or maybe I have to cook it myself... :-(

Just thought I'd ask in case there was a simple method I've missed.

Thanks a million.
I'm 'getting there'... just far too slowly !
Mac (Siera) and PC (Win7)
LiveCode 8.1.2 / 7.1.1

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: A way to 'dim' a group of controls ?

Post by Klaus » Fri Sep 13, 2013 11:14 am

Hi Trax,

I ususally set the blendlevel of my "disabled" groups, so they look kind of "dimmed" :-)
Maybe that will work for you?


Best

Klaus

Traxgeek
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 281
Joined: Wed Jan 09, 2013 10:11 am

Re: A way to 'dim' a group of controls ?

Post by Traxgeek » Fri Sep 13, 2013 1:11 pm

Thanks Klaus, I'm off to play with the blendlevel.

Much appreciated.

Have a great weekend.
I'm 'getting there'... just far too slowly !
Mac (Siera) and PC (Win7)
LiveCode 8.1.2 / 7.1.1

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7393
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: A way to 'dim' a group of controls ?

Post by jacque » Fri Sep 13, 2013 6:57 pm

I usually set the enabled of the group to false. The engine visually dims the controls automatically and an accidental click won't activate anything. Is there a reason the "enable" property didn't work?
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Traxgeek
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 281
Joined: Wed Jan 09, 2013 10:11 am

Re: A way to 'dim' a group of controls ?

Post by Traxgeek » Fri Sep 13, 2013 9:52 pm

Hi jaque,

I'm running LC 5.5.4 on a mac running Mountain Lion.

Whilst enabling / disabling a group of controls works (with respect to the controls within said group(s) becoming enabled / disabled) I do not 'see' any dimming taking place - the controls all retain their look / feel regardless of whether they're enabled / disabled, hence my stumped-ness !! Maybe this isn't the case once deployed or in in a sim but, within. my version of LC, nothing appears to change to let a user know that the control has been disabled (or not).

As an aside, wrt the suggestion from Klaus, if I reduce the blendlevel from 100 (even to simply 95) one can see the controls behind any groups being dimmed - so that's not too much use to me either (at the moment)... maybe I need to simply re-think my methodology but at the moment I'm stumped... (maybe I could loop through the controls with a group and adjust their blendlevel, thereby leaving the retaining group's background intact / opaque... but this seems a long winded way to accomplish my goal...

This must be a common occurrence so... I'll keep playing...

Thanks for the response and have a great weekend.
I'm 'getting there'... just far too slowly !
Mac (Siera) and PC (Win7)
LiveCode 8.1.2 / 7.1.1

Traxgeek
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 281
Joined: Wed Jan 09, 2013 10:11 am

Re: A way to 'dim' a group of controls ?

Post by Traxgeek » Fri Sep 13, 2013 9:55 pm

Hi jaque,

I'm running LC 5.5.4 on a mac running Mountain Lion.

Whilst enabling / disabling a group of controls works (with respect to the controls within said group(s) becoming enabled / disabled) I do not 'see' any dimming taking place - the controls all retain their look / feel regardless of whether they're enabled / disabled, hence my stumped-ness !! Maybe this isn't the case once deployed or in in a sim but, within. my version of LC, nothing appears to change to let a user know that the control has been disabled (or not).

As an aside, wrt the suggestion from Klaus, if I reduce the blendlevel from 100 (even to simply 95) one can see the controls behind any groups being dimmed - so that's not too much use to me either (at the moment)... maybe I need to simply re-think my methodology but at the moment I'm stumped... (maybe I could loop through the controls with a group and adjust their blendlevel, thereby leaving the retaining group's background intact / opaque... but this seems a long winded way to accomplish my goal...

This must be a common occurrence so...

hmm... maybe I could overlay my groups / cards with an opaque control(s) (graphic(s), label(s) whatever...) and simply set the blendlevel of said control(s) to 100%/transparent for normal/enabled use and some other lower value for dimmed/disabled use...

I'll keep playing...

Thanks for the response and have a great weekend.
I'm 'getting there'... just far too slowly !
Mac (Siera) and PC (Win7)
LiveCode 8.1.2 / 7.1.1

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7393
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: A way to 'dim' a group of controls ?

Post by jacque » Fri Sep 13, 2013 10:20 pm

If the controls have any visual customization like a backcolor, then the engine won't always dim them visually, it respects your settings (sorry, I can't remember exactly which properties affect that.) Try it with a new button right off the tool palette and see if it works.

If customization is what's causing the problem, your idea of overlaying an opaque graphic should work. Experiment with inks and blendlevels on it. I would just hide it until you want dimming, and then show it. That way you don't have to script the visual changes or worry about it interfering with user interactions.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Traxgeek
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 281
Joined: Wed Jan 09, 2013 10:11 am

Re: A way to 'dim' a group of controls ?

Post by Traxgeek » Fri Sep 13, 2013 10:33 pm

Thanks Jacque,

Just sorted a 'work around' / method to achieve the desired result - I think it's the same as you've just suggested (and probably what Klaus was directing me at !) - thanks both.

What I have come up with :

create one (or more) label(s) that are above (layer-wise) and 'cover'/mask the controls that need to be 'dimmed'
set the opaque property of said label(s) to true (which means all the controls behind the selected label's layer are now hidden/inaccessible)
set the blendlevel of said label(s) to 25% - or whatever best suits (which means all the controls behind the selected label's layer are now visible again, but dimmed/greyed but still inaccessible)
set the visibility of said label(s) to false (which means all the controls behind the selected label's layer are now fully visible and accessible again) : one can toggle visible = true/false for setup etc...

then, at run-time, simply make said label(s) visible/not visible as required.
For some feedback, one can add an 'on mouseup, beep...' script for said label(s) (or whatever else one thinks would be useful feedback for the intended user)

... et voila !

seems to work and is pretty simple to create / control.

Please, feel free to comment / criticise (I may well (probably have) have omitted something pretty basic in my haste...

Have a great weekend.
Last edited by Traxgeek on Sat Sep 14, 2013 2:23 am, edited 1 time in total.
I'm 'getting there'... just far too slowly !
Mac (Siera) and PC (Win7)
LiveCode 8.1.2 / 7.1.1

Traxgeek
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 281
Joined: Wed Jan 09, 2013 10:11 am

Re: A way to 'dim' a group of controls ?

Post by Traxgeek » Sat Sep 14, 2013 2:22 am

Oooops !

I lie - like cheap rug !! :oops:

I'm still looking into why but... all works correctly now simply with use of 'set the enabled of... to true[false]'

I have no idea as to why that's working the case now, although I did get a little frustrated, switch everything off whilst I got a coffee and upon restarting... all occurs 'as expected'...

Sorry to waste you time. :oops:
I'm 'getting there'... just far too slowly !
Mac (Siera) and PC (Win7)
LiveCode 8.1.2 / 7.1.1

Post Reply