Hi, Is there some function available to determine where on the screen a module is located?
Our application opens panels in multiple modules which the operator can freely move around in a 4K-screen. We would like to have a function that can save "panel compilations" so the operator can easily return his favorite screen composition. For the saving we need the XY-coordinates so we can open the modules and panels to the same places.
Get module xy-coordinates?
Search
Re: Get module xy-coordinates?
It looks like there is no function available to get the current position of the modules.
When opening a new module you can define where it shall be opened. If the value "-2" is used for the x/y position the last position saved in PVSS00ui.ini is used.
For details please have a look at the documentation:
https://www.winccoa.com/documentation/W ... uleOn.html
Best Regards
Leopold Knipp
Senior Support Specialist
When opening a new module you can define where it shall be opened. If the value "-2" is used for the x/y position the last position saved in PVSS00ui.ini is used.
For details please have a look at the documentation:
https://www.winccoa.com/documentation/W ... uleOn.html
Best Regards
Leopold Knipp
Senior Support Specialist
-
- Posts: 373
- Joined: Tue Jan 15, 2019 3:12 pm
Re: Get module xy-coordinates?
From a panel you can get the window frame position by the panel property 'windowFrameGeometry'. This property can be used to save the window position and restore it.
To get the loaded panel name in a module the function 'rootPanel' can be used.
In case the module is 'frameless' even the function 'panelPosition' can be used.
To get the loaded panel name in a module the function 'rootPanel' can be used.
In case the module is 'frameless' even the function 'panelPosition' can be used.
-
- Posts: 42
- Joined: Mon Dec 04, 2017 2:28 pm
Re: Get module xy-coordinates?
Hi
Thanks for your efforts. I realize now how I could make this work, but I believe it would be too complicated to make into a production application.
I would have to insert a getValue("","windowFrameGeometry",x,y,w,h); code in every panel and trigger that using dpConnect from some "SaveCompilation" datapoint that is set when save button is triggered in another module. Then I would have to save the coordinates somewhere and code the save button to read these coordinates.
How awesome it would be to have a getModuleValue function instead.
Thanks for your efforts. I realize now how I could make this work, but I believe it would be too complicated to make into a production application.
I would have to insert a getValue("","windowFrameGeometry",x,y,w,h); code in every panel and trigger that using dpConnect from some "SaveCompilation" datapoint that is set when save button is triggered in another module. Then I would have to save the coordinates somewhere and code the save button to read these coordinates.
How awesome it would be to have a getModuleValue function instead.
-
- Posts: 373
- Joined: Tue Jan 15, 2019 3:12 pm
Re: Get module xy-coordinates?
It could all be done from a save button, there is no need to implement something in every panel.
You could use 'getVisionNames' to get all open module names. Together with the 'rootPanel' function from my previous answer and the syntax to access shapes in other panels and modules (to access the panel leave the shape name part empty) you can get the position from all modules without adding code in every panel.
You could use 'getVisionNames' to get all open module names. Together with the 'rootPanel' function from my previous answer and the syntax to access shapes in other panels and modules (to access the panel leave the shape name part empty) you can get the position from all modules without adding code in every panel.
-
- Posts: 42
- Joined: Mon Dec 04, 2017 2:28 pm
Re: Get module xy-coordinates?
Thanks gschijndel!
Got the XY-coordinates from the other modules using: getValue(moduleName+"."+nodeName+":","windowFrameGeometry",x,y,w,h);
Got the XY-coordinates from the other modules using: getValue(moduleName+"."+nodeName+":","windowFrameGeometry",x,y,w,h);