Issue passing variable value IF-statement

Forums Desktop Info Issue passing variable value IF-statement

Tagged: ,

Viewing 3 reply threads
  • Author
    Posts
    • #4754
      icomp
      Participant

      Hi,

      We’re currently allowing around 5 or so backgrounds by default in our organization, we use bginfo and vbscript to handle the switching of backgrounds but we feel that bginfo is lacking in a lot of places and are trying out DesktopInfo as an alternative or replacement.

      I’m trying to pass a bgr-value from one variable to another and then assign that variable to the color options on text-boxes, however the color is not being applied for some reason.

      When switching the registry value, the variable Theme is changed correctly. And based on the COMMENT=%Color%, the variable Color is also passing the correct value.

      However, when using the variable Color later on, the color isn’t changed and stays default.

      What am I doing wrong? 🙁

      Also, is there any way to change the font-color to Black instead of having it turn invisible?

      Kind regards, David

    • #4755
      Glenn
      Keymaster

      This is kind of complicated.

      Item colors are set once during config load and never again. You can use variables but that doesn’t change the fact that the color is set only once.

      KEY WORDS exist as an aid to setting item configuration during config load and so are evaluated once during config load and never again. Again, you can use variables.

      However, the actual items are not evaluated until after the config is loaded.

      And so any item that uses a variable for a color is set to the initial value of that variable. When it comes to looking up the registry and making decisions about colors, it’s too late.

      This puts us in a bind cos we’d like to do a little evaluating before we settle on the colors.

      This is where you use BEGIN-ONLOAD / END-ONLOAD block. Anything in between these two key words is evaluated during config load, including items, and never again. This allows you to do some evaluating and set some variables before other items are loaded and configurated.

      Here is the type of thing you’ll need to do:

      • This reply was modified 1 week, 5 days ago by Glenn.
      • This reply was modified 1 week, 5 days ago by Glenn.
    • #4761
      icomp
      Participant

      Thanks a lot for the quick reply Glenn, your snippets of code worked flawlessly!

      A side-question about font-quality. Whenever we apply antialiasing, clreatype or cleartype natural to get a more rounded modern feel to the fonts and the background is of a brighter color, the fonts add some sort of transparency layer that makes the text almost unreadable.

      • #4764
        Glenn
        Keymaster

        yeah I see that. My theory is that Windows creates a partial transparency area around the font to “smooth” things out (anti-aliased). Combine that with the transparent form which uses color 0 as the transparent color and you end up with the black bits. You’ll notice if you set transparency=0 and formcolor=f0f0f0 you don’t see those artifacts.

        You might say, well don’t use color 0 and I would respond with whatever color is used to denote the transparent pixels is what will show in this situation. This is the unavoidable side effect of transparent forms.

        This is the same artifacts you see when displaying an image with partial transparency on a transparent form.

        • This reply was modified 1 week, 5 days ago by Glenn.
    • #4784
      Glenn
      Keymaster

      That statement, “This is kind of complicated”, started me thinking it shouldn’t be this complicated and it comes down to the item colours being static. So v3.3 will make item colours dynamic, meaning the “color” and “text-color” item options can now use variables and expressions so that you can change the item colours on the fly using the IF item and variables.

Viewing 3 reply threads
  • You must be logged in to reply to this topic.
Glenn's Page