How to change back color of mechanical tree xml properties in an ACT Extension

Options

I've been looking to see if it's possible to access the backcolor property of cells in the mechanical tree when developing an act extension.

For example a cell will turn yellow automatically when it needs attention or red when it is invalid or gray when it is read only. The grid editor shows this method being used, but its not clear where cells are located in the properties. for example: cell.BackColor = self.GridEditor.EditableColor

Does anyone know how to access the back color on properties defined in the xml?

The motivation is that I'd like to control the visual response for a property shown to the user. So basically turn it yellow etc. through code rather than relying on the valid/invalid state etc.

Tagged:

Answers

  • Mike.Thompson
    Mike.Thompson Member, Employee Posts: 316
    First Answer First Anniversary First Comment 5 Likes
    Options

    I can't tell if you are talking about the mechanical Tree (which has nodes) or the details window (which has cells) or both. You mention the tree, but based on context I think you are talking about the details view, and specifically about the details view of a custom ACT object?

  • Nick R
    Nick R Member Posts: 12
    First Answer 5 Likes First Comment
    Options

    Hey Mike!

    I should have added a picture, thank you for the response! Essentially, I am referring to the back color of cells in the details tab. In most cases workbench can handle these automatically, but I am wondering if it's possible to change their color programmatically. I am finding that it would be helpful to alert users to some things and would like to be able to emphasize them in a color besides gray.

  • Mike.Thompson
    Mike.Thompson Member, Employee Posts: 316
    First Answer First Anniversary First Comment 5 Likes
    Options

    when you define a property in the xml file of an ACT app you can add a callback for isvalid. This will link to a python method (like all callbacks) and should return a true/false value. If the value is false the property and object will be invalid and the prop will show as red.