< Previous Page | Next Page > |
Desktop Kit by Dropbox ⚠️ Warning. This package is now deprecated. Please use the new Desktop Kit by Dropbox Design package. Over 100 macOS UI components ranging from buttons and push notifications to full working applications. This kit is a gives you the building block to design incredible desktop experiences.
When working with documents, two services are used most frequently:
The com.sun.star.frame.Desktop service is created automatically when Apache OpenOffice is started. This service can be addressed in Apache OpenOffice Basic using the global name StarDesktop.
The most important interface of the StarDesktop is com.sun.star.frame.XComponentLoader. This basically covers the loadComponentFromURL method, which is responsible for creating, importing, and opening documents.
StarOffice 5 : The name of the StarDesktop object dates back to StarOffice 5, in which all document windows were embedded in one common application called StarDesktop. In the present version of Apache OpenOffice, a visible StarDesktop is no longer used. The name StarDesktop was, however, retained for the frame object of Apache OpenOffice because it clearly indicates that this is a basic object for the entire application. The StarDesktop object replaces the Application object of StarOffice 5 which previously applied as a root object. Beatunes 4 6 3 – organize your music collection. However, unlike the old Application object, StarDesktop is primarily responsible for opening new documents. The functions resident in the old Application object for controlling the on-screen depiction of Apache OpenOffice (for example, FullScreen, FunctionBarVisible, Height, Width, Top, Visible) are no longer used. |
VBA : Whereas the active document in Word is accessed through Application.ActiveDocument and in Excel through Application.ActiveWorkbook, in Apache OpenOffice, the StarDesktop is responsible for this task. The active document object is accessed in Apache OpenOffice through the StarDesktop.CurrentComponent property, or through ThisComponent. |
The global name ThisComponent generally returns the same object as StarDesktop.CurrentComponent, with one significant advantage. If you are running from within the Basic IDE, debugging or exploring, then StarDesktop returns the Basic IDE itself. This is probably not what you want. ThisComponent returns the last previously active document.
When working with Apache OpenOffice documents, it is useful to deal with some of the basic issues of document administration in Apache OpenOffice. This includes the way in which file names are structured for Apache OpenOffice documents, as well as the format in which files are saved.
Since Apache OpenOffice is a platform-independent application, it uses URL notation (which is independent of any operating system), as defined in the Internet Standard RFC 1738 for file names. Standard file names using this system begin with the prefix file:/// followed by the local path. If the file name contains sub-directories, then these are separated by a single forward slash, not with a backslash usually used under Windows. The following path references the test.odt file in the doc directory on the C: drive.
To convert local file names into an URL, Apache OpenOffice provides the ConvertToUrl function. To convert a URL into a local file name, Apache OpenOffice provides the ConvertFromUrl function:
The example converts a local file name into a URL and displays it in a message box. It then converts a URL into a local file name and also displays this.
The Internet Standard RFC 1738, upon which this is based, permits use of the 0-9, a-z, and A-Z characters. All other characters are inserted as escape coding in the URLs. To do this, they are converted into their hexadecimal value in the UTF-8 set of characters and are preceded by a percent sign. A space in a local file name therefore, for example, becomes a %20 in the URL.
Apache OpenOffice documents are based on the XML file format. XML-based files can be opened and edited with other programs.
Since XML is based on standard text files, the resultant files are usually very large. Apache OpenOffice therefore compresses the files and saves them as a ZIP file. By means of a storeAsURL method option, the user can save the original XML files directly. See storeAsURL Method Options, below.
Documents are opened, imported and created using the method
The first parameter of loadComponentFromURL specifies the URL of the associated file.
As the second parameter, loadComponentFromURL expects a name for the frame object of the window that Apache OpenOffice creates internally for its administration. The predefined _blank name is usually specified here, and this ensures that Apache OpenOffice creates a new window.
Using these parameters, the user can open a Apache OpenOffice document, since place holders (dummy values) can be assigned to the last two parameters:
The preceding call opens the test.odt file and displays this in a new window.
Any number of documents can be opened in this way in Apache OpenOffice Basic and then edited using the returned document objects.
StarOffice 5 : StarDesktop.loadComponentFromURL supersedes the Documents.Add and Documents.Open methods from the old Apache OpenOffice API. |
The named _blank value for the Frame parameter ensures that Apache OpenOffice creates a new window for every call from loadComponentFromURL. In some situations, it is useful to replace the content of an existing window. In this case, the frame object of the window should contain an explicit name. Note that this name must not begin with an underscore. Furthermore, the SearchFlags parameter must be set so that the corresponding framework is created, if it does not already exist. The corresponding constant for SearchFlags is:
The following example shows how the content of an opened window can be replaced with the help of the frame parameter and SearchFlags:
The example first opens the test.odt file in a new window with the frame name of MyFrame. Once the message box has been confirmed, it replaces the content of the window with the test2.odt file.
The fourth parameter of the loadComponentFromURL function is a PropertyValue data field. which provides Apache OpenOffice with various options for opening and creating documents. The data field must provide a PropertyValue structure for each option in which the name of the option is saved as a string as well as the associated value.
loadComponentFromURL supports the following options:
The following example shows how a text file separated by a comma in Apache OpenOffice Calc can be opened using the FilterName Substance painter 2019 3 3 0. option.
The FileProperties array has two elements, one for each option used. The Filtername property defines whether Apache OpenOffice uses a Apache OpenOffice Calc text filter to open files. The FilterOptions property contains the description of the syntax of the csv file.
Apache OpenOffice automatically creates a new document if the document specified in the URL is a template.
Alternatively, if only an empty document without any adaptation is needed, a private:factory URL can be specified:
The call creates an empty Apache OpenOffice writer document.
The loadComponentFromURL function introduced in the previous section returns a document object. This supports the com.sun.star.document.OfficeDocument service, which in turn provides two central interfaces:
Apache OpenOffice documents are saved directly through the document object. The store method of the com.sun.star.frame.XStorable interface is available for this purpose:
This call functions provided that the document has already been assigned a memory space. This is not the case for new documents. In this instance, the storeAsURL method is used. This method is also defined in com.sun.star.frame.XStorable and can be used to define the location of the document:
In addition to the preceding methods, com.sun.star.frame.XStorable also provides some help methods which are useful when saving documents. These are:
The code for saving a document can be extended by these options so that the document is only saved if the object has actually been modified and the file name is only queried if it is actually needed:
The example first checks whether the relevant document has been modified since it was last saved. It only continues with the saving process if this is the case. If the document has already been assigned a URL and is not a read-only document, it is saved under the existing URL. If it does not have a URL or was opened in its read-only status, it is saved under a new URL.
As with the loadComponentFromURL method, some options can also be specified in the form of a PropertyValue data field using the storeAsURL method. These determine the procedure Apache OpenOffice uses when saving a document. storeAsURL provides the following options:
The following example shows how the Overwrite option can be used in conjunction with storeAsURL:
The example then saves Doc under the specified file name if a file already exists under the name.
Similar to saving, documents are printed out directly by means of the document object. The Print method of the com.sun.star.view.Xprintable interface is provided for this purpose. In its simplest form, the print call is:
As in the case of the loadComponentFromURL method, the Dummy parameter is a PropertyValue data field through which Apache OpenOffice can specify several options for printing.
The print method expects a PropertyValue data field as a parameter, which reflects the settings of the print dialog of Apache OpenOffice:
The following example shows how several pages of a document can be printed out using the Pages option:
The com.sun.star.view.XPrintable interface provides the Printer property, which selects the printer. This property receives a PropertyValue data field with the following settings:
The following example shows how a printer can be changed and the paper size set with the help of the Printer property.
Habitify 6 0 6. The example defines an object named PaperSize with the com.sun.star.awt.Size type. This is needed to specify the paper size. Furthermore, it creates a data field for two PropertyValue entries named PrinterProperties. This data field is then initialized with the values to be set and assigned the Printer property. From the standpoint of UNO, the printer is not a real property but an imitated one.
Content on this page is licensed under the Public Documentation License (PDL). |
Most programs should use standard window frames. Immersive applications can have a full screen mode that hides the window frame. Consider using glass strategically for a simpler, lighter, more cohesive look.
With a window frame, users can manipulate a window and view the title and icon to identify its contents.
A typical window frame.
Note: Guidelines related to window management and branding are presented in separate articles.
The glass window frames are a striking new aspect of the Microsoft Windows aesthetic, aiming to be both attractive and lightweight. These translucent frames give windows an open, less intrusive appearance, helping users focus on content and functionality rather than the interface surrounding it.
Glass window frames.
You can use glass strategically in small regions within a window that touch the window frame. Symbols of cerberus. Such regions appear to be part of the window frame, even though technically they are part of the window's client area.
In this example, glass is used in the client area to make it look like part of the frame.
Sometimes the best window frame is no frame at all. This is often the case for the primary window of immersive full screen applications that aren't used in conjunction with other programs, such as media players, games, and kiosk applications.
Content viewers often benefit from having the option to show content full screen. Examples include Windows Internet Explorer , Windows Live Photo Gallery, Windows Movie Maker HD, Microsoft PowerPoint , and Microsoft Word.
In this example, Windows Media Player can display its content full screen.
Most Windows applications should use the standard window frames. However, for immersive, full screen, stand-alone applications like games and kiosk applications, it may be appropriate to use custom frames for any windows that aren't shown full screen. The motivation to use custom frames should be to give the overall experience a unique feel, not just for branding.
Custom frames are appropriate for immersive, full screen, stand-alone applications such as games.
Use standard window frames.
Consider hiding the window frame of the primary window.
Consider using custom frames for secondary window. Rudolphs revenge game.
If a custom frame is appropriate, choose a design that is lightweight and doesn't draw too much attention to itself.
Incorrect:
In this example, the custom frame draws too much attention to itself.
Don't add controls to a window frame. Put the controls within the window instead.
Incorrect:
Correct:
In the correct example, the control is within the client area instead of the window frame.
For programs that have an optional full screen mode, to enable full screen mode:
Have a modal full screen command in the menu bar or toolbar. When the user clicks the command, show the command in its selected state.
This example shows the full screen command along with its standard shortcut key.
Use F11 for the full screen shortcut key.
If there is a toolbar and full screen mode is commonly used, also have a graphic toolbar button with a Full screen tooltip.
Examples of full screen toolbar buttons.
To revert back from full screen mode:
Standard window frames use glass automatically in Windows, but you can also use glass in regions that touch the window frame.
Craps field bet odds. Correct:
In this example, glass is used to give the Alt+Tab window a lightweight appearance. Glass works for this window because it consists of graphics and a single, strong text label.
Incorrect:
https://coolhfiles298.weebly.com/house-of-cards-slot-machine.html. In this incorrect example, the use of glass is distracting. A plain window background would be a better choice.