2 Replies Latest reply: Apr 25, 2013 12:07 PM by Friedrich Hofmann RSS

    Conditionalize the colour of textboxes

    Friedrich Hofmann

      Hi,

       

      in a table object in my current document I work with some white textboxes to generate white inbetween-space. Since these can be tricky to spot, I would like to make them "light up" in a different colour when I make some development changes to the document:

      I have introduced a variable v_DevMode and I would like to specify two alternate colours for the textboxes - but that is the problem: I can conditionalize one colour, so the textbox will not appear at all when that condition is not true, but I cannot specify a second colour unless as a colourmix, which I don't want. I want two alternate opaque colours.

      I know that in an SQL expression I can specify the colour for my text using the RGB function, but can I also use the same method to specify a background colour?

      Thanks a lot!

      Best regards,

       

      DataNibbler

        • Re: Conditionalize the colour of textboxes
          Gysbert Wassenaar

          Open the properties window for the text object. Click on the Color button. Check the option Calculated and enter an expression in the input box (or open the expression editor). You can enter an expression to calculate the color. Something like if(v_DevMode=1, color(1), rgb(200,50,50))

            • Re: Conditionalize the colour of textboxes
              Friedrich Hofmann

              Hi Gysbert,

               

              so I actually use the colour I have set in the dialog itself as the "then-option" in that IF-clause and I specify a different one using the RGB function as "else-option"?

              That seems to work - one thing is strange, though: I want the textbox to be red (218, 20, 66) when v_DevMode='Y' and when I set v_DevMode to 'N', it should be white - but currently, v_DevMode='Y' and the function parameter color(1) returns baby-blue ;-) I guess that function uses some internal palette - the help says it uses the palette of the diagram - but where can I check that? The properties dialog for the straight table object has no "colours" tab where I could check the order of the colours...

              Best regards,

               

              DataNibbler