After I'd worked out how to connect the dots ;) I've solved some of my problems:

Window size and position can be controlled by creating a new frame and requesting the new OO window is drawn inside this frame. Since we control the outer frame I can move it around and size it as I wish. There is a sample in the SDK which does something similar (in /OfficeDev/DesktopEnvironment/). However, I 'm not getting an import progress bar shown consistently. Sometimes its drawn, sometimes not.

Hiding the menu turned out to be fairly straight forward (see code). Using a similar pattern I can also hide the various tool bars etc but I can't hide the status bar. For statusbar, I pass: private:resource/statusbar/statusbar and the function returns true (indicating success). However, the statusbar is still visible! Using the Invoke method as shown below also results in the statusbar remaining visible. I've tried calling the hide statusbar call from various points in my code, including just before a start a presentation, and can't make it disappear! Does anyone have any ideas / suggestions?

In the mean time I manually rename the statusbar.xml file just before loading (and restore just after), which results in an entirely empty status bar area. This is better but still results in lost screen real estate.

A lot of these techniques have been cobbled together from various places - I thank the original authors for sharing this information.

Regards,

Andy


// Successfully hide the menubar. This code needs error detection and handling! XPropertySet props = ( XPropertySet ) UnoRuntime.queryInterface( XPropertySet.class, xComponent );
Object obj = props.getPropertyValue( "LayoutManager" );
XLayoutManager layout_manager = ( XLayoutManager ) UnoRuntime.queryInterface( XLayoutManager.class, obj ); boolean success = layout_manager.hideElement( "private:resource/menubar/menubar" ); // Change to private:resource/statusbar/statusbar for statusbar
System.out.println("Hidden menu = " + success );

// Attempt (and fail) to hide statusbar using invokation:
PropertyValue[] myProperties = new PropertyValue[1];
PropertyValue xProperty = new PropertyValue();
xProperty.Name = "StatusBarVisible";
xProperty.Value = new Boolean( false );
myProperties[0] = xProperty;

com.sun.star.util.URL aURL = new com.sun.star.util.URL();
aURL.Complete = ".uno:StatusBarVisible";

int flags = 0;
XDispatchProvider provider = ( XDispatchProvider ) UnoRuntime.queryInterface( XDispatchProvider.class, mxFrame ); com.sun.star.frame.XDispatch xDispatcher = provider.queryDispatch( aURL, "", flags);
if (xDispatcher!=null)
{
   xDispatcher.dispatch( aURL, myProperties);
}
else
{
   System.out.println("Failed!!!" );
}



Andy Cordwell wrote:

I'd like to write a application that opens a PowerPoint presentation and plays it to the end, all without user intervention (which I think I've done - see earlier posts).

After a quick demo of this, our end-user asked that the slideshow simply starts playing, without showing the Impress window as the file loads and converts (which is a relatively lengthy process). He also asked that the size and position of the window that shows the slideshow is also controllable.

This implies I need to find a way to 'hide' the Impress window as it opens and converts the PowerPoint, then control the window size and position as it starts playing the slideshow. I am aware I can run the slideshow in the current window by setting the Slideshow Options ~ Window setting. However, this still leaves the menubar showing (status bars and toolsbars etc I can turn off).

Being an OpenOffice.org developer newbie, I've got a few queries at this point:
Can the menu bar / main window be hidden?
Are there any settings (start up settings?) which control the window size?
Is there an OO API available to do any of this?

I've tried passing the -hidden, -headless and -invisible command line options, but these do not have any visible impact on the window (with the exception of one which disables input).

I'll also need to determine when the slideshow has finished playing so that I can perform internal clean up and exit Impress. I noticed a post earlier that said there was no callbacks to notify when a presentation had ended. Any thoughts as to how I could accomplish this?

I'm prototyping in Java, but will write the final application in C++. Running OpenOffice 2.0.2. under Fedora Core 4.

Regards,

Andy

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to