Change textbox background color by actions and XMLscript

Moderator: dadolphs

Post Reply
Eriko
Posts: 125
Joined: 19.06.2016, 15:43
Location: Hoofddorp, NL

Change textbox background color by actions and XMLscript

Post by Eriko » 16.06.2018, 22:10

Hi

On my track plan I've put a text field where a message is shown when a running train isn't moving for a while.
With actions and dynamic text works this pretty well.

I like to change the background color of the text field with it as well.
I'm exploring to use XML scrips for this as well. The text is changing with the "format=" operator.
However I can't figure out how to change the background color or transparency with a XML script.
Putting transparency="true/false" or backred/green/blue="0...255" in it doesn't work.

At the moment I'm stuck. Someone idea's?

Greetings, Erik

ups60
Posts: 1058
Joined: 30.07.2013, 17:36
Location: 50321 Brühl

Re: Change textbox background color by actions and XMLscript

Post by ups60 » 16.06.2018, 22:35

Hi Erik,

try this:
<model cmd="modify">
<tx id="x" backred="255" backgreen="0" backblue="0"/>
</model>

Look at this : http://forum.rocrail.net/viewtopic.php?f=45&t=13724, but its in German

greets Uwe

Eriko
Posts: 125
Joined: 19.06.2016, 15:43
Location: Hoofddorp, NL

Re: Change textbox background color by actions and XMLscript

Post by Eriko » 17.06.2018, 07:23

Hi

Thank you.
This seems to work.

Greetings, Erik

jpultar
Posts: 994
Joined: 23.04.2017, 14:33

Re: Change textbox background color by actions and XMLscript

Post by jpultar » 17.06.2018, 07:46

Hi Erik,

your script looks interesting also fo me - is it possible to share your script?

Eriko
Posts: 125
Joined: 19.06.2016, 15:43
Location: Hoofddorp, NL

Re: Change textbox background color by actions and XMLscript

Post by Eriko » 17.06.2018, 19:48

Hi
No problem

I've put it into two scripts.
One to set the messages and one to reset the messages on the text boxes on multiple levels.

On my track plan the timeout event get triggered when a loco takes more than 60 seconds to hit the next "enter"or "in" sensor.
This will activate the action to place the delay message and activates the reset with a delay of 59,9 seconds.

Perhaps the dynamic texting line cloud be combined with the change of transparency. But I didn't had time to test that.

Have fun with it.
Greetings, Erik
You do not have the required permissions to view the files attached to this post.

jpultar
Posts: 994
Joined: 23.04.2017, 14:33

Re: Change textbox background color by actions and XMLscript

Post by jpultar » 18.06.2018, 05:14

Thank you :-)

Post Reply

Return to “Basic topics”