Code: Alles auswählen
REM ***** BASIC *****
Sub Main
oAwtToolkit = CreateUnoService( "com.sun.star.awt.Toolkit" )
oTopWindow = CreateTopWindow( oAwtToolkit, 100, 200, 500, 400 )
oTopWindow.setBackground( RGB( 240, 240, 255 ) )
oFrame = CreateUnoService( "com.sun.star.frame.Frame" )
oFrame.initialize( oTopWindow )
oFrame.setCreator( StarDesktop )
oFrame.setTitle("TEST")
'ThisComponent.CurrentController.Frame.title = "TEST"
End Sub
Function CreateTopWindow( oAwtToolkit, x, y, w, h )
oWindowDesc = CreateUnoStruct( "com.sun.star.awt.WindowDescriptor" )
With oWindowDesc
.Type = com.sun.star.awt.WindowClass.TOP
.WindowServiceName = ""
.Bounds = MakeRectangle( x, y, w, h )
.WindowAttributes = 0
.WindowAttributes = .WindowAttributes + com.sun.star.awt.WindowAttribute.SHOW
.WindowAttributes = .WindowAttributes + com.sun.star.awt.WindowAttribute.BORDER
.WindowAttributes = .WindowAttributes + com.sun.star.awt.WindowAttribute.SIZEABLE
.WindowAttributes = .WindowAttributes + com.sun.star.awt.WindowAttribute.MOVEABLE
.WindowAttributes = .WindowAttributes + com.sun.star.awt.WindowAttribute.CLOSEABLE
End With
oXWindowPeer = oAwtToolkit.createWindow( oWindowDesc )
CreateTopWindow = oXWindowPeer
end Function
Function MakeRectangle( ByVal nX As Long, ByVal nY As Long,_
ByVal nWidth As Long, ByVal nHeight As Long ) As com.sun.star.awt.Rectangle
oRectangle = createUnoStruct( "com.sun.star.awt.Rectangle" )
With oRectangle
.X = nX
.Y = nY
.Width = nWidth
.Height = nHeight
End With
MakeRectangle() = oRectangle
End Function
Weiß jemand Rat?