Date: prev next · Thread: first prev next last
2019 Archives by date, by thread · List index


Hi, 

I'm wondering if someone can give me a hand. I'm developing an
extension which makes use of the sidebar functionality. I want to use
a GUI tool to develop the UI and since I didn't find anything
suggesting that the glade ui tools can be used with extensions, I've
been following the path of using '.xdg' dialogs which can be generated
inside LibreOffice (calc/base). I've been able to successfully use
these to generate standalone dialogs but I'd like to populate a sidebar
panel using the '.xdg' method. Anyone know if it's possible? 

My approach: I end up with an instance of XUnoControlDialog but haven't
been able to find a way to take the GUI elements and place them in a
different window. I thought that XControl.createPeer(toolkit,
windowPeer) (see below code) would be sufficient to link the primary
control from the dialog to the location that I want it to be output. Is
there something I'm missing or am I being hopelessly optimistic that
this will work?

I have struggled through the many UNO interfaces and haven't been able
to find any overlap that would allow me to take the populated view from
the (hidden) dialog and stick it in the sidebar panel. 

Perhaps this isn't the best approach and I'm willing to hear any other
suggestions you guys have!

Thanks,

Rob



My attempt to take the controls from the XUnoControlDialog and attach
them to a different window in the Sidebar:

XUnoControlDialog dialog = MwnciDialog.getDialog(dialogXdgRelativeUrl,
componentContext, uiHandler);

XToolkit toolkit = this.m_parentWindowPeer.getToolkit();

WindowDescriptor windowDescriptor = new WindowDescriptor();
windowDescriptor.Type = WindowClass.CONTAINER;
windowDescriptor.WindowServiceName = "";
windowDescriptor.Parent = m_parentWindowPeer;
windowDescriptor.ParentIndex = -1;
windowDescriptor.Bounds = new Rectangle(0, 0, 200, 200);
windowDescriptor.WindowAttributes =
        WindowAttribute.SIZEABLE | WindowAttribute.MOVEABLE
                | WindowAttribute.NODECORATION;

this.m_windowPeer = toolkit.createWindow(windowDescriptor);
this.m_window = UnoRuntime.queryInterface(XWindow.class,
this.m_windowPeer);

dialog.createPeer(toolkit, this.m_windowPeer);

m_parentWindow.setVisible(true);
m_parentWindow.setEnable(true);

this.m_window.setVisible(true);
this.m_window.setEnable(true);

this.m_window.setPosSize(0, 0, 200, 200, (short)(PosSize.Y |
PosSize.WIDTH)) ;
dialog.setPosSize(0, 0, 200, 200, (short)(PosSize.Y | PosSize.WIDTH)) ;




Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.