Open web page from dialog
Oliver Brinzing
Oliver.Brinzing at gmx.de
Sun Jun 12 18:48:39 UTC 2016
Hi Jan,
I found some examples:
http://www.programcreek.com/java-api-examples/index.php?api=com.sun.star.awt.XControl
Maybe this can help....
Regards
Oliver
Am 12.06.2016 um 19:36 schrieb Jan Rheinländer <jrheinlaender at gmx.de>:
>
> Hi Fernand,
>
> thank you for the tip with UnoControlFixedHyperlinkModel. Now this is what I have:
>
> Reference<XDialog> xDialog; // Created from XDialogProvider somewhere earlier in the code
>
> First question: How do I get a MultiServiceFactory from XDialog to create the control? If I use the MultiComponentFactory the properties like "PositionX" etc. are not present
>
> Now assuming I get this MultiServiceFactory from somewhere:
>
> Reference< XPropertySet > xPSHyperlink(xMultiServiceFactory->createInstanceWithContext("com.sun.star.awt.UnoControlFixedHyperlinkModel", xCC), UNO_QUERY_THROW);
> xPSHyperlink->setPropertyValue("PositionX", makeAny(50));
> xPSHyperlink->setPropertyValue("PositionY", makeAny(30));
> xPSHyperlink->setPropertyValue("Width", makeAny(50));
> xPSHyperlink->setPropertyValue("Height", makeAny(14));
> xPSHyperlink->setPropertyValue("Label", makeAny(OU("Help")));
> xPSHyperlink->setPropertyValue("URL", makeAny(OU("http://ooo-imath.sourceforge.net/wiki/index.php/Main_Page")));
>
> Second question: How do I get a XControl from the UnoControlFixedHyperlinkModel to add to the ControlContainer?
>
> Reference< XControlContainer > xControlContainer(xDialog, UNO_QUERY_THROW);
> xControlContainer->addControl(OU("button_help"), xHyperlinkControl);
>
> I have looked all over the UNO API but am not getting anywhere.
>
> Thanks,
> Jan
>
>> oDialogModel.createInstance(
>> "com.sun.star.awt.UnoControlFixedHyperlinkModel")
>
>>> On Jun 11, 2016, at 3:24 PM, "Jan Rheinländer" <jrheinlaender at gmx.de> wrote:
>>> Hi,
>>>
>>> is it possible to open a website in the user's preferred browser from a
>>> dialog (or from a Basic macro, or through the UNO API)?
>>>
>>> I see that the "Help" - "About" dialog does this, but it is defined in
>>> the source in Glade format, different to the Basic dialogs.
>>>
>>> Thanks for any ideas!
>>>
>>> Jan
>>>
>>>
>>> LibreOffice mailing list
>>> LibreOffice at lists.freedesktop.org
>>> https://lists.freedesktop.org/mailman/listinfo/libreoffice
>>
> _______________________________________________
> LibreOffice mailing list
> LibreOffice at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/libreoffice
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice/attachments/20160612/541d1c71/attachment.html>
More information about the LibreOffice
mailing list