Unexpected issue with disabled graphics style

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

stam
Posts: 2634
Joined: Sun Jun 04, 2006 9:39 pm
Location: London, UK

Unexpected issue with disabled graphics style

Post by stam » Tue Aug 04, 2020 12:50 am

Hi all,
I've encountered an issue with a graphics object i can't seem to find a way to resolve...

I've used a roundedRect graphic to create a set of 'buttons' embedded in a group. All works perfectly, and i've added mouseover, pressed and selected states that were exactly what i was after.

However when i set these to 'disabled', i get a wholly weird text effect - the text in the 'name' of the graphic drops a shadow in black and looks both appallingly awful and completely out of keeping with a 'disabled' state.

The graphic below shows a zoomed image of an 'enabled' and 'disabled' graphic button:
Image

I can't see any way to modify the graphic styles for a disabled state - am i missing something?

(i guess i could code this to simulate a 'disabled' behaviour and state, but wanted to make sure i wasn't missing a native way to do this, as i'm, well, lazy :wink: )

PBH
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 129
Joined: Sun Feb 20, 2011 4:26 pm
Location: Vancouver Island, BC, Canada. ex.UK
Contact:

Re: Unexpected issue with disabled graphics style

Post by PBH » Tue Aug 04, 2020 4:06 am

I'm seeing this effect all the way back to LiveCode 5.5.5, so I'm guessing there is a reason for it, but I'm not too sure what that is!

In earlier versions of LC, the text is greyed out when the graphic is disabled, so I can only guess that the shadow effect was to keep the text readable at small sizes, however, in LC9.6.1 the text seems to turn black regardless of the foreGround colour setting.

I also compared the properties of the graphic in both it's normal and disabled state to see if you could just reset one of them, but no dice.

I'd be interested to see if anybody else has any ideas, but my only suggestion for now would be to have a separate text label for each button. That could get a bit laborious if you have lots of buttons though.

Paul

stam
Posts: 2634
Joined: Sun Jun 04, 2006 9:39 pm
Location: London, UK

Re: Unexpected issue with disabled graphics style

Post by stam » Tue Aug 04, 2020 4:57 am

PBH wrote:
Tue Aug 04, 2020 4:06 am
I'd be interested to see if anybody else has any ideas, but my only suggestion for now would be to have a separate text label for each button.
Nah, in spirit of my laziness i went another way. Basically i'm using graphics as kind of button class, so the work is do once, copy/paste everywhere without having to create and keep track of extra labels or other controls. And also because i'd like the text and the outline of the button to turn a light grey to indicate it's disabled and inhibit actions (like mouseovers, clicks etc).

In essence my method is based on 3 components:
  • A Custom property 'disabledFlag' for each item to enable/disable. This is used as a conditional in any relevant action (true = item disabled)
  • A Stack script that handles colouring and setting the disabledFlag property (takes the long ID and enable/disable status as parameters)
  • Where there are groups of controls that enable/disable together, a card script calls the stack script for each of these
This is what it looks like:

Image

Works well - but would have been nice not to have spent the time devising this...

Klaus
Posts: 13806
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Unexpected issue with disabled graphics style

Post by Klaus » Tue Aug 04, 2020 7:05 am

Hi guys,

confirmed in LC 9.6 on my Mac, I consider this a bug, please report it here and refer to this thread: https://quality.livecode.com
Thank you!


Best

Klaus

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9286
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Unexpected issue with disabled graphics style

Post by richmond62 » Tue Aug 04, 2020 8:33 am

Over 'here' on my MacOS 10.15.6 thing I get a slightly different effect:
-
Screenshot 2020-08-04 at 10.28.58.png
-
The outer line of the disabled regular polygon is grey, but I also get the "schizoid" text effect.

Surely . . .

1. That greyed outline is insufficient to signal to an end-user that that is disabled?

2. The text should be a paler version of the enabled version?

[Of course this is NOT helped by the fact that one can apparently not change the textColor of the text in a graphic.]

If one types this into the messageBox:

Code: Select all

set the textColor of grc "Octagon" to red
the borderColor of the graphic is set as well as the text . . .

Enhancement request: https://quality.livecode.com/show_bug.cgi?id=22862

Klaus
Posts: 13806
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Unexpected issue with disabled graphics style

Post by Klaus » Tue Aug 04, 2020 9:48 am

Someone tested this with LC 9.6.1 RC1 or RC2?
Is this still the case there?

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9286
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Unexpected issue with disabled graphics style

Post by richmond62 » Tue Aug 04, 2020 9:52 am

Just the same with 9.6.1 RC 1: downloading RC 2 as I type.
-
Screenshot 2020-08-04 at 11.54.12.png
-
There is nothing in the release documentation about any changes in this area.

Humpf: just wasted 2 minutes opening that in RC 2, and that effect where a graphic with
the borderColor set to something seems totally counter to what one should expect of a
disabled control.

As the LiveCode team are focussing solely on getting the stuff onto handhelds
I wonder why we should be so naive to think that they would bother at all
about such 'minor' cosmetic blips like this.

After all, what's wrong with pushing one's product forwards endlessly without
bothering to fix a long trail of bugs and so on behind you?

Klaus
Posts: 13806
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Unexpected issue with disabled graphics style

Post by Klaus » Tue Aug 04, 2020 10:48 am

Hi Richmond,

no need for you to be so naive, I (and other users hopefully) will carry on postings bugs.
If we don't then there is definitively no chance of getting anything fixed, small or not!

If someone has reported this bug, please post the link to the bug#, thank you.
If not, I will do it later this evening.


Best

Klaus

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9286
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Unexpected issue with disabled graphics style

Post by richmond62 » Tue Aug 04, 2020 10:57 am


Klaus
Posts: 13806
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Unexpected issue with disabled graphics style

Post by Klaus » Tue Aug 04, 2020 11:22 am

Thank you, my naive friend, but that is an enhancement request in the end and not a bug report about the topic of this thread!
Looks like Monte already suggested this last year: https://quality.livecode.com/show_bug.cgi?id=22435

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9286
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Unexpected issue with disabled graphics style

Post by richmond62 » Tue Aug 04, 2020 1:49 pm

Well, when I was in the army cadets I was a first class shot with a 0.303, but everytime
I used a 0.22 I missed. 8)

stam
Posts: 2634
Joined: Sun Jun 04, 2006 9:39 pm
Location: London, UK

Re: Unexpected issue with disabled graphics style

Post by stam » Tue Aug 04, 2020 2:40 pm

I've submitted a bug report as didn't feel other reports quite captured the issue.

https://quality.livecode.com/show_bug.cgi?id=22863

please do add a comment - a 'me too' comment would do - to increase it's visibility for the LiveCode devs.

stam
Posts: 2634
Joined: Sun Jun 04, 2006 9:39 pm
Location: London, UK

Re: Unexpected issue with disabled graphics style

Post by stam » Sun Oct 01, 2023 3:25 pm

This is still an issue 3 years later even though my bug report was marked as CONFIRMED....

I'm encountering this again as a problem when using graphics instead of buttons to provide flexibility in layout design and with script widgets (as soon as a button is non-standard size and setting the style to 'standard' or rectangle, it draws accented bottom/right borders which is supremely annoying and archaic design pattern from 30 years ago).

A graphic would be an easier choice in that respect as you can basically change it to roundRect (with a modifiable roundRadius, which you can't do with a button), rectangle or transparent with minimal effort... but setting it to disabled has the annoyingly erroneous behaviour described above.

A further inconsistency I've noted is that the following generates an error:

Code: Select all

If graphic <graphic> is disabled then...
whereas the following works:

Code: Select all

if the disabled of graphic <graphic> then...
this is completely inconsistent with syntax otherwise, eg buttons, and should in my view be corrected...

Bug report as previously is here: https://quality.livecode.com/show_bug.cgi?id=22863
Feel free to add a comment/cc to hopefully increase visibility...

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9802
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Unexpected issue with disabled graphics style

Post by FourthWorld » Sun Oct 01, 2023 3:38 pm

What prevented you from using roundRect buttons?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9286
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Unexpected issue with disabled graphics style

Post by richmond62 » Sun Oct 01, 2023 3:53 pm

This is still an issue 3 years later
I am NOT surprised at all.

I sometimes think that those bug reports are mainly sops to keep users happy, rather than anything the developers bother to look at . . .

Personally, as most of these things are "not as they should be" I tend to use images as buttons and mess around with colorOverlay to get the effects I require:
-
btn1.jpg
-
btn2.jpg
-

Code: Select all

on mouseEnter
   lock screen
   set the coloroverlay["color"] of me to yellow
   set the coloroverlay["opacity"] of me to "75"
   unlock screen
-- irrelevant code removed
end mouseEnter

on mouseLeave
   set the outerGlow of me to empty
   set the colorOverlay of me to empty
-- irrelevant code removed
set the ink of me to srcCopy
end mouseLeave

Post Reply

Return to “Getting Started with LiveCode - Experienced Developers”