You are viewing a plain text version of this content. The canonical link for it is here.
Posted to api@openoffice.apache.org by "W. Amenel VOGLOZIN" <vw...@yahoo.fr> on 2014/11/17 16:42:09 UTC

[EXT][UI] Static text hyperlink in a dialog

Hi,

I would like to add a static text (Label Field) to a dialog and the text would act as an HTTP hyperlink. It would be similar (including the hand pointer) to the "Get more extensions online" that can be found in the lower right corner of the Extension Manager and the text would trigger the opening of the specified link in a Web browser.


Unfortunately, I don't see in the developer guide and published service specifications anything that would allow me to do just that. Could someone point me into the right direction?

Thank you.

Re: [EXT][UI] Static text hyperlink in a dialog

Posted by Amenel VOGLOZIN <wa...@yahoo.fr>.
Thanks Bernard,

I've got it working! :-D


For whoever comes across this after a search, it is worth noting that the hand pointer and the target link appearing in the tooltip are both provided by UnoControlFixedHyperlinkModel. However, the desired color has to be defined. And at this moment right-aligned text (whether UnoControlFixedTextModel or UnoControlFixedHyperlinkModel) is clipped of 1 pixel (on Windows 8.1).


Best regards,
-Amenel.



________________________________
 De : Bernard Marcelly <ma...@club-internet.fr>
À : api@openoffice.apache.org 
Envoyé le : Lundi 17 novembre 2014 17h37
Objet : Re: [EXT][UI] Static text hyperlink in a dialog
 

Hi,

Since OpenOffice.org version 3.3 there is a control called FixedHyperlink.
However it is not available in the palette of controls in the IDE. So you have 
to insert it by program.
Suppose your dialog is in variable dlg.

Dim dlg As Object
Dim fhm As Object

dlg = CreateUnoDialog(.....)

fhm = dlg.Model.createInstance("com.sun.star.awt.UnoControlFixedHyperlinkModel")
With fhm
   .Name = "Hyperlink1"
   .PositionX = 10
   .PositionY = 10
   .Width = 50
   .Height = 15
   .Label = "Apache OpenOffice"
   .URL = "http://www.openoffice.org/"
End With
dlg.Model.insertByName(fhm.Name, fhm)

dlg.execute


Regards
   Bernard

Re: [EXT][UI] Static text hyperlink in a dialog

Posted by Bernard Marcelly <ma...@club-internet.fr>.
Hi,

Since OpenOffice.org version 3.3 there is a control called FixedHyperlink.
However it is not available in the palette of controls in the IDE. So you have 
to insert it by program.
Suppose your dialog is in variable dlg.

Dim dlg As Object
Dim fhm As Object

dlg = CreateUnoDialog(.....)

fhm = dlg.Model.createInstance("com.sun.star.awt.UnoControlFixedHyperlinkModel")
With fhm
   .Name = "Hyperlink1"
   .PositionX = 10
   .PositionY = 10
   .Width = 50
   .Height = 15
   .Label = "Apache OpenOffice"
   .URL = "http://www.openoffice.org/"
End With
dlg.Model.insertByName(fhm.Name, fhm)

dlg.execute


Regards
   Bernard


Message de W. Amenel VOGLOZIN  date 2014-11-17 16:42 :
> Hi,
>
> I would like to add a static text (Label Field) to a dialog and the text would act as an HTTP hyperlink. It would be similar (including the hand pointer) to the "Get more extensions online" that can be found in the lower right corner of the Extension Manager and the text would trigger the opening of the specified link in a Web browser.
>
>
> Unfortunately, I don't see in the developer guide and published service specifications anything that would allow me to do just that. Could someone point me into the right direction?
>
> Thank you.
>

---------------------------------------------------------------------
To unsubscribe, e-mail: api-unsubscribe@openoffice.apache.org
For additional commands, e-mail: api-help@openoffice.apache.org