For experimental purposes, a label named "LabelName" is created manually in the dialog. I can pick up this label from the macro by using getControl.
Creating a second label in the macro CreateUnoService ("stardiv.Toolkit.UnoFixedTextControl") makes the correct object.
This empty (?) object can be modified for size/position.
However adding Text does not show up in the debugger.
Adding this label to the dialog results in error :
Type: com.sun.star.uno.RuntimeException
Message: createPeer: no model
Code: Select all
Option Base 1
Option Explicit
Sub Main
dim hDialog
GlobalScope.BasicLibraries.LoadLibrary("Tools") ' loading Tools library
ThisComponent.CurrentController.connect ' https://forum.openoffice.org/en/m/viewtopic.php?t=42882
hDialog = CreateUnoDialog(DialogLibraries.getByName("Standard").getByName("DialogTest"))
' type : stardiv.Toolkit.UnoDialogControl
dim hLabel
hLabel = hDialog.getControl ("LabelName") ' https://wiki.openoffice.org/wiki/Documentation/DevGuide/Basic/List_Box
' type = stardiv.Toolkit.UnoFixedTextControl
dim hLabel2
hLabel2 = CreateUnoService ("stardiv.Toolkit.UnoFixedTextControl")
hLabel2.setText ("LLLLLLabel2text")
hLabel2.PosSize.Width = 100
hLabel2.PosSize.Height = 25
hLabel2.PosSize.X = 27
hLabel2.PosSize.Y = 50
hDialog.addControl ("Label2Name", hLabel2)
hDialog.Execute()
End Sub