' Full screen dialogue
' Author: @rami https://forumooo.ru/index.php/topic,8122.15/msg,54900.html
Sub DlgDisplay
Dim oWindow, winSize, oDlg, oDlgModel, newSize, w%, h%, bt
oWindow = CreateUnoService("com.sun.star.awt.Toolkit")
winSize = oWindow.ActiveTopWindow.Size
oDlgModel = CreateUnoService("com.sun.star.awt.UnoControlDialogModel")
oDlgModel.setPropertyValue("Title", "Dialog - Large Window")
oDlg = CreateUnoService("com.sun.star.awt.UnoControlDialog")
oDlg.setModel(oDlgModel)
oDlg.createPeer(oWindow, null)
newSize = oDlg.convertSizeToLogic(winSize, 17) '17 or 18
w = newSize.Width
h = newSize.Height
oDlgModel.setPropertyValue("Width", w-1)
oDlgModel.setPropertyValue("Height", h-1)
bt = oDlgModel.createInstance("com.sun.star.awt.UnoControlButtonModel")
bt.setPropertyValues(Array("Height","PositionX","PositionY","PushButtonType","Label","Width"),Array(15, w-50, h-20, 1, "Step", 40))
oDlgModel.insertByName("StepButton",bt)
oDlg.execute()
End Sub