This topic contains 2 replies, has 1 voice, and was last updated by  John 9 years, 7 months ago. This post has been viewed 740 times

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #19461

    John
    Keymaster

      Hi Dutch, glad to see you in the forums again.

      You can already set a chosen color for the ‘ON’ state of a read only BOOL with the new ‘color’ attribute. See screen shot.

      However you’ll still get the gray text for the ‘off’ state.

      If you want a row to show up in red when a tag is ‘on’ and a second row to show up green when it is ‘off’ use the following:

      For first row set type BOOL and attributes: color=red;
      For the second row set type BOOL and attributes: color=green; scale={0,1,1,0};

      The first row will turn red when the tag is ‘on’
      The second row will turn green when the tag is ‘off’

      Both rows can refer of course to exactly the same tag.

      The tip is to use the ‘scale’ attribute to reverse the ‘on’ and ‘off’ states for the tag in the second row.

      Well, that’s not exactly what you ask for but it might help in the mean time. You can do this with the version already on the store.

      For a next release we plan to add a ‘tint_color’ attribute, to have color in buttons and bars. We might use this attribute to tell the ‘off’ state color of read only bools.

      Thanks,

      Joan
      SweetWilliamSL

      #19462

      John
      Keymaster

        Update: Version 2.0 now offers a much better way to handle this. The ‘color’ and ‘blink’ attributes now accept expressions. This means that color can be determined by external conditions or values. The system method ‘SM.color’ is provided to convert numeric or text values into color representations. Additionally the attributes ‘on_label’ and ‘off_label’ accept now string expressions, so integrators have now total flexibility to determine how text, color and blink state is shown for boolean value states. The Aphorism-ONE.csv example provided with v2.0 release shows how to do this and more.

        John.

        #19460

        John
        Keymaster

          ;on_color:=red;
          ;off_color=green;

          Now that would be handy.

          Looking forward to that in the next release.

        Viewing 3 posts - 1 through 3 (of 3 total)

        You must be logged in to reply to this topic.

        Copyright © SweetWilliam, S.L 2009-2013. All rights reserved.
        Science and Technology Park of the University of Girona, Emili Grahit, 91 (NarcĂ­s Monturiol building, Office P3-B03) 17003-Girona. Phone +34972183244