This should be very simple but I'm struggling with it. Converting from another HMI product where this is automatic on any object that have a clickable action associated with it. Basically I want any object, be that a square or a grouped object to show a border when I mouse over it.
with a rectangle, I tried with scripting on SetProperty to {$.strokePaint} on MouseEntered event but then I got stuck. Not sure how to format the color value. I'm not even sure I'm on the right path.
This is something that would normally be done from mouse entered and exited event handlers, but expression language won't work there; you will have to use Jython to script it. Normally, I would create a template for something like this, so I could use it everywhere and only have to upgrade it or make changes to it in one place.
Edit:
Here is a simple example:
rectangle.zip (2.9 KB)
When in preview mode or in a session, the border will change to orange when the mouse enters the rectangle, and it will change back to black when the mouse exits.
#mouseEntered:
event.source.strokePaint = system.gui.color('orange')
#mouseExited:
event.source.strokePaint = system.gui.color('black')
1 Like
I've also created an exchange resource that will make the border visible or invisible when the mouse hovers over it. I've usually embedded it inside other templates.
Thanks both, I'm taking the easier route (for me) this time and use the justin's solution and I'll take a look at the template later when I get more time. A lot to learn in this new environment.