[Solved] Set the Calc Dialog to fit the Windows Screen
-
- Posts: 18
- Joined: Mon Jun 18, 2018 3:33 am
[Solved] Set the Calc Dialog to fit the Windows Screen
I think there is a solution out there but I can't seem to find it and I don't know how to do it either. I made a program with Calc macro. Basically, it is a dialog Form. I made it on one PC and set up all the width and height of the dialog to look good enough on that PC. Later on, when I tested it on other PC, the dialog is out of the Windows Screen and all texts haywire. So, how could I make my program to adjust the Windows Screen size and fit to it?
Last edited by MINTHETNAUNG on Wed Jul 11, 2018 11:29 am, edited 1 time in total.
Openoffice 4.1.5 on Windows 10
Re: Set the Calc Dialog to fit the Windows Screen
One way is to maximize a document window then read off the dimensions and set your dialog to the same.
Code: Select all
Sub Main
with ThisComponent.getCurrentController().getFrame().ContainerWindow
.isMaximized = True
ps = .getpossize
end with
f= loadDialog("Standard","Dialog1")
with ps
f.setpossize .x,.y,.width,.height,15
end with
f.execute
End Sub
Function LoadDialog(oLibraryName as String, oDialogName as String) 'just to load dialog
Dim oLib as Object
DialogLibraries.LoadLibrary(oLibraryName)
oLib = DialogLibraries.GetByName(oLibraryname)
LoadDialog() = CreateUnoDialog(oLib.GetByName(oDialogName))
End Function
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
-
- Posts: 18
- Joined: Mon Jun 18, 2018 3:33 am
Re: Set the Calc Dialog to fit the Windows Screen
Great. This works. But when I do that, the list boxes, combo boxes, text boxes and labels sizes positions are not getting bigger or smaller. How do I keep the ratio of those sizes if I were to maximize the Dialog size?
Openoffice 4.1.5 on Windows 10
Re: Set the Calc Dialog to fit the Windows Screen
I suppose it: You must/can recalculate and adjust the object sizes and positions programatically.How do I keep the ratio of those sizes if I were to maximize the Dialog size?
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
-
- Posts: 18
- Joined: Mon Jun 18, 2018 3:33 am
Re: Set the Calc Dialog to fit the Windows Screen
I see. I will work on it. Thank you!
Openoffice 4.1.5 on Windows 10