ThinkGeo.com    |     Documentation    |     Premium Support

SetPosition not working when PrinterLayer is selected

In our TG 10 application we have a print preview implementation. Right-clicking any PrinterLayer brings up a context menu. There are a couple of items on this menu that re-position the PrinterLayer that was clicked on, ‘Center Horizontal’ and ‘Center Vertical’. This works fine in our TG 10 application, but not after we upgrade to TG 14.

The reason seems to be that right-clicking with the mouse selects the printer layer and it will not respond to SetPosition when it is selected. I don’t know if this is by design or a bug.

I have attached a sample project. Once the project is running you can select the map printer layer and move it to one side. Then click the ‘Set Map Position’ button while the map printer layer is still selected. Nothing will happen. Then click off the Map Printer Layer so it de-selects. Click the ‘Set Map Position’ button again and now it works.

Solution?

Thanks!

Steve

SetPositionDemo.zip (318.6 KB)

Hi Steve,

Thanks for the sample project as usual - that made everything straightforward.

You’re right, this is a regression from v10. In v14. The behavior has actually been there since the v12 codebase rewrite.

We’ve fixed it in latest beta 15.0.0-beta037, by only pushing the adornment box back onto the layer when the adornment itself was actually moved or resized by the user. External SetPosition calls are now preserved whether the layer is selected or not. Can you pull the latest and give it a shot?

Thanks,
Ben