Apache OpenOffice (AOO) Bugzilla – Issue 76890
WindowAttribute "Closable" does not work as expected
Last modified: 2013-02-07 21:54:21 UTC
The created window contains a closing button, but clicking on it does not have any effect. I will attach two source files from the awt examples in which such a window is created. The relevant sourcecode is within the method "showTopWindow( Rectangle _aRectangle)": // The Toolkit is the creator of all windows... Object oToolkit = m_xMCF.createInstanceWithContext("com.sun.star.awt.Toolkit", m_xContext); XToolkit xToolkit = (XToolkit) UnoRuntime.queryInterface(XToolkit.class, oToolkit); // set up a window description and create the window. A parent window is always necessary for this... com.sun.star.awt.WindowDescriptor aWindowDescriptor = new com.sun.star.awt.WindowDescriptor(); // a TopWindow is contains a title bar and is able to inlude menus... aWindowDescriptor.Type = WindowClass.TOP; // specify the position and height of the window on the parent window aWindowDescriptor.Bounds = _aRectangle; // set the window attributes... aWindowDescriptor.WindowAttributes = WindowAttribute.SHOW + WindowAttribute.MOVEABLE + WindowAttribute.SIZEABLE + WindowAttribute.CLOSEABLE; // create the window... XWindowPeer xWindowPeer = xToolkit.createWindow(aWindowDescriptor); XWindow xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class, xWindowPeer); // create a frame and initialize it with the created window... Object oFrame = m_xMCF.createInstanceWithContext("com.sun.star.frame.Frame", m_xContext); m_xFrame = (XFrame) UnoRuntime.queryInterface(XFrame.class, oFrame); Object oDesktop = m_xMCF.createInstanceWithContext("com.sun.star.frame.Desktop", m_xContext); XFramesSupplier xFramesSupplier = (XFramesSupplier) UnoRuntime.queryInterface(XFramesSupplier.class, oDesktop); m_xFrame.setCreator(xFramesSupplier); // get the XTopWindow interface.. xTopWindow = (XTopWindow) UnoRuntime.queryInterface(XTopWindow.class, xWindow);
Created attachment 44825 [details] Sourcecode with the relevant method
Created attachment 44826 [details] Parent class of the sourcecode
cd: Accepted.