Hello Guys
I have a Dialog that I loaded with loadDialog and modified with a BASIC macro (it’s a color palette with 120 controls that I put into with a loop, see below).
I would like to be able to save this modified dialog so that I don’t have to recalculate it every time I use it. But I don’t find the symmetrical of loadDialog. Can I achieve with StoreDocument? But I don’t see which parameters to use.
Any hint ?
Thank you in advance
J.M. CORNIL
< < < < < < My Macro, that constructs the dialog and open it > > > > > >
Sub Macro2
BasicLibraries.LoadLibrary("XrayTool") ' Pour charger xray qui permet l'instrospection
BasicLibraries.LoadLibrary("Tools") ' Pour charger xray qui permet l'instrospection
Dim dialog As Object
dialog = LoadDialog("Standard","www_Dialog_test")
xray dialog
Dim colorTable As Object
Dim colorNames As Object
Dim color As String
colorTable = createUnoService("com.sun.star.drawing.ColorTable")
' obtenir un tableau des couleurs de la palette
colorNames = colorTable.ElementNames
Const ORG_X = 30, ORG_Y = 10, DELTA_X = 2, DELTA_Y = 4, NBR_COL=12
Dim posX, posY, numCol, numLgn As Integer
Dim mdl As Object
posX = ORG_X
posY = ORG_Y
numCol = 0
numLgn =0
for each color in colorNames ' Boucle sur les couleurs
'mdl = dialog.Model.createInstance("com.sun.star.awt.UnoControlButtonModel")
mdl = dialog.Model.createInstance("com.sun.star.awt.UnoControlFixedTextModel")
'xray mdl
mdl.Width = 10
mdl.Height = 12
mdl.PositionX = posX
mdl.PositionY = posY
mdl.Name = color
mdl.backGroundColor = colorTable.getByName(color)
'mdl.TabIndex = 5 + 3*i +j
'mdl.label = cstr(i) & cstr(j)
'insérer le modèle du contrôle dans le modèle du dialogue
mdl.HelpText = color
dialog.Model.insertByName(mdl.Name, mdl)
posX = posX + mdl.Width + DELTA_X
numCol = numCol+1
if numCol = NBR_COL then
numCol = 0
posX = ORG_X
posY = posY + mdl.Height + DELTA_Y
End If
' print color
next color
dialog.execute
End Sub
The www_Dialog_test.xdl file is attached in zip format
www_Dialog_test.xdl.zip (620 Bytes)