[SOLVED] Why does saving the project reset component positions but not client tags?

Good morning,

Why does saving a project reset component positions on the screen (I am moving components around using system.gui.transform) BUT the default client tags aren’t read into the saved project? Is this a bug?

Solution: Not a bug but a feature :slight_smile:

Do you have a script that is resetting the component positions when a window is opened, closed, etc? That could be why they reset on save. You would need a similar block of code that sets client tags to default values on client startup or some other event. When you save the client tags in designer, it thinks you want those values to be saved in those tags. There are no “default client tag” values.

Misunderstood OP.

Not true. What is present in the designer is saved with the project's other resources to be the defaults. But client tags that already exist were deliberately exempted from replacement during a Vision client restart, to allow state to persist. (Old decision that would be troublesome to change, I think.) Window resources have always been reloaded, so any component transforms are discarded along with the old window.

2 Likes

Ah, I see where there was confusion. For some reason, I was thinking the OP was talking about what happens to the opened windows and client tags in the designer when he saves a project. I didn’t realize he was talking about what happens to an open client.

Ahhh yes, this is the root of my problems today.

I created a scroll bar menu using 5 rectangles and 5 templates. The 5 templates move along the screen to the next rectangle in the sequence based on it’s current location. I then have the client save the “offset” from the original position in a client tag. As soon as I go to save the project the 5 templates are back in their original starting position and the “offset” is telling me they are somewhere else.

I resolved this by setting the client “offset” to the default value when an internal frame is opened.

Shortened version: I’m using component positions in the state of my clients.

May I suggest you flip the state around: use client tags to drive the positions. Send position changes to the client tags and let the window notice that and drive system.gui.transform. That would keep the locations through an update.

1 Like