Border properties

Is there a way to programmatically set the border properties, especially when using a titled border? I created my components with a gradient color scheme and a certain font, and now I need to change it. I would really make life easier if I could just loop through the components and set them all at once, not to mention the customer could then set them any way they want.

First of all, check out the docs on the toBorder expression. This will orient you as to the syntax of specifying borders.

Currently there is no great way to get to this functionality using Python scripting. We should add a “toBorder” function to the system.gui module, but until then, you can get to this same style of border creation like this:

[code]import sys

from javax.swing.border import Border
from com.inductiveautomation.ignition.common import TypeUtilities

myBorder = TypeUtilities.coerce(“paneltitled;MyTitle”, Border)

event.source.parent.getComponent(“Label”).border = myBorder[/code]

Well, I never would have thought of that. :slight_smile:

But this should do the trick. Thanks!

I’m having a cosmetic problem with the titled border. It’s no huge deal, but I’m trying to clean up my screens and they don’t look “right”.

If I select the titled border, and give the “Color” property something like dark blue, and give the “Background” the color white, the resulting color is kind of dingy until I set the shadow down to zero and then back up again. At that point, it looks correct in the designer.

But, it never looks right at run time. The shadow color paints correctly, but the title seems saturated with a grey color. It’s hard to explain, but it’s noticable and several people have mentioned it. Ideas?

This was a bug that has been fixed for 7.2.8.