The following macro creates a simple window with a title. OOo 2.4.1 shows the 
title normally, while OOo 3.1.1 seems to ignore it. Does anyone know what's 
wrong ?


Option Explicit

Sub Main
Dim oNewFrame As Object
Dim oNewWindow As Object
  oNewWindow = CreateWindow( GetToolkit, MakeRect(50,50,250,150) )
  oNewFrame = CreateNewFrame( oNewWindow, "New Frame" )
  Exit Sub
End Sub

Function GetToolkit()
  GetToolkit = GetProcessServiceManager. _
    createInstanceWithContext( _
End Function

Function CreateNewFrame( oLocWindow As Object, _
    sLocFrameName As String ) As Object
Dim oLocNewFrame As Object
  oLocNewFrame = 
  With oLocNewFrame
  End With
  CreateNewFrame = oLocNewFrame
End Function

Function CreateWindow( oLocToolkit As Object, _
  aLocRect As com.sun.star.awt.Rectangle ) As 
Dim oLocWinDesc
  oLocWinDesc = createUnoStruct("com.sun.star.awt.WindowDescriptor")
  With oLocWinDesc
    .Type = com.sun.star.awt.WindowClass.TOP
    .Bounds = aLocRect
  End With
  With com.sun.star.awt.WindowAttribute
    oLocWinDesc.WindowAttributes = _
  End With
  CreateWindow = oLocToolkit.createWindow(oLocWinDesc)
End Function

Function MakeRect( nX As Long, nY As Long, _
  nWidth As Long, nHeight As Long ) As com.sun.star.awt.Rectangle
Dim oLocRect
  oLocRect = createUnoStruct("com.sun.star.awt.Rectangle")
  With oLocRect
    .X = nX
    .Y = nY
    .Width = nWidth
    .Height = nHeight
  End With
  MakeRect() = oLocRect
End Function 

To unsubscribe, e-mail: dev-unsubscr...@openoffice.org
For additional commands, e-mail: dev-h...@openoffice.org

Reply via email to