In Macros, how to specify position of Dialog when it is loaded?

When loading a Dialog from a Macro, using oDlg.setVisible(true) or oDlg.Execute(), is it possible to specify the position where it will open? Either absolute with respect to Desktop or relative with respect to the LibreOffice window.

(I think, in OpenOffice, there is a method setPositionSize. This gives “BASIC runtime error, ‘423’” in LO. Is there an equivalent available in LO?)

Sample Calc file with macro and dialog.

(Edit: activated screenshots -AK)

Please upload you sample file/macro code here.

As requested, sample Calc file (with macro code and dialog — the code is quite long for a complicated process…) and screenshots of how dialog appears by default and what is required, have been uploaded by editing the original question. Thanks for the quick response.

I just X-rayed the oDlg object in your code. It has not any method named setPositionSize() but it has setPosSize() method. It not throw error message, but it work a littlebit strangelly…

I suggest you to install and use the Xraytool. Then you will able to list all of the existing properties and methods of the programming objects…

I just X-rayed the oDlg object in your code. It has not any method named setPositionSize() but it has setPosSize() method. It not throw error message, but it work a littlebit strangelly…

I suggest you to install and use the Xraytool. Then you will able to list all of the existing properties and methods of the programming objects…

I hope these inforations will help you:

Link 1

Link 2

note: the 5. parameter of the method is a flag. The second link shows, what the bits of the flag mean.

oDlg.setPosSize(0, 0, 400, 400, 15)

15 means (binary 1111) that you want to modify the all of the four parameters: x, y, width, height.

3 means (binary 0011) that you want to modify the position only.

Thanks a lot!
I will try the method setPosSize and also definitely try out the Xraytool…
I hope the method works.

Yes, the setPosSize method worked!

I also thought I will add a few lines on the XrayTool, since I think there is no other comment on the tool in ask-LO. It was downloaded from OpenOffice.org Macros - Browse /X-Ray at SourceForge.net (version 5.2 – though released in 2006 works well with LO 7).

Unzipped to get the file XrayTool52_en.sxw. Opening this .sxw file in Writer (with Macro enabled) shows the instructions and also embedded buttons to install the tool.

Adding a line in macro:

Xray oDlg

showed the Xray tool with screenshot as mentioned by @Ziz64

Thanks again!

You can download the latest version of the XrayTool from Bernard Marcelly’s web site (He is the author.)

XrayTool

@kpk.in
Another option is to select the dialog in the design (click on the border) which will display the properties on the left where you can nominate position x and y. Can not attach a screendump in a comment and can not answer as the post was closed.