Announcement

Collapse
No announcement yet.

No way to disable / gray out buttons?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • No way to disable / gray out buttons?

    Hi,

    I am looking at the 4D Systems displays and one thing that I am really missing is an "official and proven" way to disable, i.e. gray out buttons that are currently not active.
    This is available in most other GUIs I am aware of. So is there any special reason why this has not been implemented by 4D Systems? At least I don't find anything in the docs or appnotes...

    I read about animating buttons etc., but nothing about setting a button to a disabled state.

    Thanks in advance,

    Anguel

  • #2
    Hi Anguel,

    In Workshop's Project tab, click on 'Allow buttons to be disabled':
    Click image for larger version

Name:	Annotation 2019-10-03 105814.png
Views:	100
Size:	31.0 KB
ID:	69790

    To disable/enable, you write:
    Code:
    genie.WriteObject(GENIE_OBJ_WINBUTTON, 1, -1); // disable
    
    genie.WriteObject(GENIE_OBJ_WINBUTTON, 1, 0); // enable
    From the ViSi-Genie Reference Manual at the bottom of section 4.2.1.1. Win Button, the manual says "If enabled as an option in the project tab, buttons can be disabled by writing 0xFFFF to them as their value. Buttons can be re-enabled by writing a ‘normal’, non 0xFFFF value to them."

    For further discussion on this, please follow this thread:
    https://forum.4dsystems.com.au/node/46129

    I hope this helps.

    Good luck and best regards,
    Sherwin
    Attached Files

    Comment


    • #3
      Thanks, I already looked at this, but if I understand correctly this hides the button but does not offer a way to replace it by a grayed out image of the button and make it non-touchable while in disabled state.

      Comment


      • #4
        Hi,

        The other way to achieve this is to create another button with the same dimensions but with the desired look of the grayed out button on top of the normal state button. You can then use write object to display the button either not grayed out or grayed out as you need. The grayed out button that you show can then be disabled using the procedure that Sherwin mentioned but in your case both buttons would have to be disabled.

        I hope this helps

        Best regards

        Paul

        Comment


        • #5
          Thanks, maybe an image with grayed out look behind the button will also do the trick?

          Comment


          • #6
            Originally posted by Anguel View Post
            Thanks, maybe an image with grayed out look behind the button will also do the trick?
            Anguel,
            I just wanted to say Thank You! I've been playing around with the disable functionality for several days now on a project and really NOT liking the effect of having it leave holes in my button layout. Your idea to have a greyed out image of the button as part of the background image was just the workaround that I needed to fix the issue.

            For any 4D Systems staff reading this (Paul?), it would be very handy to have the current disable functionality split into two different options, one that hides the button as the current function does and one that leaves it visible but "washed out" and unable to be clicked. I realize this would require extra states to the button objects for the washed out image, but it would be a very nice feature to have! Whether or not the extra images are needed/generated could be controlled by the "allow buttons to be disabled" option already present.

            -K

            Comment

            Working...
            X