Checkboxes - stop users from interacting?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Checkboxes - stop users from interacting?
Hi all,
I have some data i'd like to show in a data grid and summarise some of the ancillary data simply.
The data is ideally suited for checkboxes - i.e. just a binary display for each of the data points to be summarised.
As these are for display only, i don't want users to be able to tick/untick these.
if i set the checkbox's disabled to true, it takes on a truly disabled state which isn't ideal looks awful and is not the look i'm aiming for.
So the question is a) how can i change the disabled colours for said checkboxes, or if that's not possible b) how can i stop mouse actions from interacting with the checkbox without disabling it? (trapping mouseDown/Up doesn't seem to work...)
Or should i just not bother with checkboxes and make a composite of other elements?
Many thanks
Stam
I have some data i'd like to show in a data grid and summarise some of the ancillary data simply.
The data is ideally suited for checkboxes - i.e. just a binary display for each of the data points to be summarised.
As these are for display only, i don't want users to be able to tick/untick these.
if i set the checkbox's disabled to true, it takes on a truly disabled state which isn't ideal looks awful and is not the look i'm aiming for.
So the question is a) how can i change the disabled colours for said checkboxes, or if that's not possible b) how can i stop mouse actions from interacting with the checkbox without disabling it? (trapping mouseDown/Up doesn't seem to work...)
Or should i just not bother with checkboxes and make a composite of other elements?
Many thanks
Stam
Re: Checkboxes - stop users from interacting?
Hi Stam,
checkboxes like many other native controls are supplied by the iunderlying OS,
so not was to modify them.
I would just use two different SVG widgets which looks like an un-/checked checkbox.
e.g. SVGs named:
-> check
-> check empty
Best
Klaus
checkboxes like many other native controls are supplied by the iunderlying OS,
so not was to modify them.
I would just use two different SVG widgets which looks like an un-/checked checkbox.
e.g. SVGs named:
-> check
-> check empty
Best
Klaus
-
- VIP Livecode Opensource Backer
- Posts: 9648
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Checkboxes - stop users from interacting?
Stam. Do this in the button script:
The checkbox will not change its state if you click on it, but you can always set its hilite property by other means
Craig
Code: Select all
on mouseUp
set the hilite of me to not the hilite of me
end mouseUp
Craig
Re: Checkboxes - stop users from interacting?
Au contraire, mon ami!
Your script will CHECK an unchecked checkbox and UNCHECK a checked checkbox!
Said Pavel Chekov.
EDIT:
AHHH, sorry, yes, it works if "autohilite" is CHECKED (sic!) for the button.
I tested with "autohilte" set to false.
Re: Checkboxes - stop users from interacting?
I agree with Klaus' suggestion of SVG widgets. You want them to look like data UI items and not confuse them with native controls for the system.
In the abstract, they could even be red or green coloured squares that show the on or off states.
If they look like something that they are used to clicking, then they will get clicked! And when they don't work like that, the user thinks they are broken.
My two cents -- although we no longer have pennies in Canada
Kelly
In the abstract, they could even be red or green coloured squares that show the on or off states.
If they look like something that they are used to clicking, then they will get clicked! And when they don't work like that, the user thinks they are broken.
My two cents -- although we no longer have pennies in Canada
Kelly
Re: Checkboxes - stop users from interacting?
Thanks guys
I thought i may be missing something, that's certainly a functional workaround.
It's not an ideal interface but i'm using it for a prototype and will substitute down the line.
But in the process of trying to put something together quickly this had me stumped and i've spent much more time than i'd care to admit on this!
Thanks all
Stam
Craig's suggestion certainly works - thank you!dunbarx wrote: ↑Fri Apr 02, 2021 9:05 pmCode: Select all
on mouseUp set the hilite of me to not the hilite of me end mouseUp
I thought i may be missing something, that's certainly a functional workaround.
It's not an ideal interface but i'm using it for a prototype and will substitute down the line.
But in the process of trying to put something together quickly this had me stumped and i've spent much more time than i'd care to admit on this!
Thanks all
Stam
-
- VIP Livecode Opensource Backer
- Posts: 9648
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Checkboxes - stop users from interacting?
Klaus,
Many ways to do this. If you clear "autoHilite", nothing happens anyway. My post overthinks this thing.
Craig
Many ways to do this. If you clear "autoHilite", nothing happens anyway. My post overthinks this thing.
Craig
Re: Checkboxes - stop users from interacting?
Ah that was what i was actually looking for!
The previous suggestion kinda worked, but a) it flickers slightly and b) doesn't cater for double clicks, so end up being more code that isn't really needed, whereas disabling autoHilite renders the checkbox visually inert, which is what i was looking...
thanks once again guys
Stam
-
- VIP Livecode Opensource Backer
- Posts: 9648
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Checkboxes - stop users from interacting?
Klaus mentioned that gadgets like checkboxes are drawn and are managed by the underlying OS. And, at least on a Mac, a checkbox automatically changes its hilite when clicked. LC takes over right away, and resets the hilite to its previous state. But not quite invisibly.
Locking the screen just before the hilite reset in the above handler is no help; the OS does its job first anyway. I guess we are seeing the time lapse between that event and the LC reset. The hilite does not visually seem to quite finish, being a sort of barely visible phantom, but I bet that is just our eyes.
Craig
Locking the screen just before the hilite reset in the above handler is no help; the OS does its job first anyway. I guess we are seeing the time lapse between that event and the LC reset. The hilite does not visually seem to quite finish, being a sort of barely visible phantom, but I bet that is just our eyes.
Craig