[MEMO] Как добавить интернет-ссылку в диалог (Basic)

Автор Рыбка Рио, 29 мая 2010, 22:48

0 Пользователи и 1 гость просматривают эту тему.

Рыбка Рио

Sub Dialog()
oDlg = CreateUnoDialog(DialogLibraries.Standard.Dialog1)
A = CreateCtrWithProp("FixedHyperlink", MkRk(30,30,100,20), Array(), Array())
A.Text="кц.рф"
A.URL="http://кц.рф"
oDlg.addControl("A1",A)
oDlg.Execute()
End Sub

Function CreateCtrWithProp( CtrType, aPosSize,  aPropNames, aPropValues )
Dim oCtr As Object, oCtrModel As Object
oCtr = createUnoService("com.sun.star.awt.UnoControl" & CtrType )
oCtrModel = createUnoService("com.sun.star.awt.UnoControl" & CtrType & "Model" )
oCtrModel.setPropertyValues( aPropNames, aPropValues )
With oCtr
    .setModel(oCtrModel)
    .setPosSize( aPosSize.X, aPosSize.Y, aPosSize.Width, aPosSize.Height, _
    com.sun.star.awt.PosSize.POSSIZE )
End With
CreateCtrWithProp() = oCtr
End Function

Function MkRk( nX As Long, nY As Long, nWidth As Long, nHeight As Long ) As com.sun.star.awt.Rectangle
Dim Rk As Object
Rk = createUnoStruct("com.sun.star.awt.Rectangle")
With Rk
.X = nX
.Y = nY
.Width = nWidth
.Height = nHeight
End With
MkRk() = Rk
End Function
ubuntu 12.04 + LibO3.6.0