[Solved] Set the Calc Dialog to fit the Windows Screen

Creating a macro - Writing a Script - Using the API

[Solved] Set the Calc Dialog to fit the Windows Screen

Postby MINTHETNAUNG » Mon Jul 09, 2018 8:51 am

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
MINTHETNAUNG
 
Posts: 18
Joined: Mon Jun 18, 2018 3:33 am

Re: Set the Calc Dialog to fit the Windows Screen

Postby JeJe » Mon Jul 09, 2018 11:11 am

One way is to maximize a document window then read off the dimensions and set your dialog to the same.

Code: Select all   Expand viewCollapse view

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



Openoffice 4.1.2
Windows 8
JeJe
 
Posts: 299
Joined: Wed Mar 09, 2016 2:40 pm

Re: Set the Calc Dialog to fit the Windows Screen

Postby MINTHETNAUNG » Wed Jul 11, 2018 3:55 am

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
MINTHETNAUNG
 
Posts: 18
Joined: Mon Jun 18, 2018 3:33 am

Re: Set the Calc Dialog to fit the Windows Screen

Postby Zizi64 » Wed Jul 11, 2018 6:53 am

How do I keep the ratio of those sizes if I were to maximize the Dialog size?

I suppose it: You must/can recalculate and adjust the object sizes and positions programatically.
Tibor Kovacs, Hungary; LO4.4.7, LO6.1.1 on Win7x64Prof.
PortableApps, winPenPack: LO3.3.0-LO6.1.2 and AOO4.1.5
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.
User avatar
Zizi64
Volunteer
 
Posts: 7462
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Set the Calc Dialog to fit the Windows Screen

Postby MINTHETNAUNG » Wed Jul 11, 2018 11:28 am

I see. I will work on it. Thank you!
Openoffice 4.1.5 on Windows 10
MINTHETNAUNG
 
Posts: 18
Joined: Mon Jun 18, 2018 3:33 am


Return to Macros and UNO API

Who is online

Users browsing this forum: No registered users and 1 guest