Other Misc. Settings
UniHelp records its window width, height, and placement into the global properties UHelpWidth, UHelpHeight, UHelpTop, and UHelpLeft whenever it is resized, moved, deactivated, or closed, so you can save these values in your application's preferences file if you wish. Then the next time your application is launched, you can simply retrieve the saved values from your preferences file and assign them to these global variables so that UniHelp "remembers" it's window settings the next time it is displayed.
UHelpWidth = SavedPrefsWidth
UHelpHeight = SavedPrefsHeight
UHelpTop = SavedPrefsTop
UHelpLeft = SavedPrefsLeft
These 4 properties are initially set in the UniHelpEngine.Constructor method and then UniHelp automatically uses the most current values each time UniHelp is displayed within a single runtime session.
The UHClosed method in the UniHelpGlobals module gets called when the UniHelp window is closed by the user, so if you need to update anything in your app after the UniHelp window is closed, place that code in the UHClosed method.
If you opted to enable UniHelp's optional Print Button, then clicking UniHelp's Print Button will fire the UHPrint method in the UniHelpGlobals module. As of the October 2008, REALbasic's HTMLViewer control does not support native printing, but printing can be achieved by alternative methods on Windows (JavaScript) and Mac OS X (MBS Plugins). Within this UHPrint method, you can customize with your own printing code or use the default code supplied.
The UHError method in the UniHelpGlobals module gets called if any of UniHelp's events or methods encounter an error. The error message is passed to this method, providing you with the option to communicate this information to the user. This is different than UHViewerError (which only communicates HTMLViewer errors).
When launching the UniHelp window, the HTMLViewer.IsAvailable property is tested and the Boolean result is passed to the UHViewerStatus method's IsViewerAvailable parameter (located in the UniHelpGlobals module). If IsViewerAvailable=TRUE, then the required OS support libraries are installed for the HTMLViewer control to work properly. If IsViewerAvailable=FALSE, then the required OS support libraries are NOT installed, so the HTMLViewer control may not work. The required OS support libraries for REALbasic's HTMLViewer control are: Safari's WebKit on Mac OS X, Internet Explorer on Windows, and the GtkHTML library on Linux.
The reason this is not handled entirely from within UniHelp is that there is currently a feedback report verified by REAL Software that HTMLViewer.IsAvailable always returns FALSE on Microsoft Windows regardless if the control works or not. So with this in mind, this UHViewerStatus method is provided as a convenience, allowing you to handle the REALbasic bug in your own way, if desired. If you don't care to handle it any differently, then simply leave the existing code in that method AS IS. UniHelp depends on the returned boolean value.
The UHViewerError method in the UniHelpGlobals module fires if UniHelp's HTMLViewer encounters an error while attempting to load an HTML page. The error number and error message from the HTMLViewer.Error event get directly passed to this method, providing you with the option to communicate this information to the user.
The UniHelpGlobals module gives you access to all of UniHelp's language constants, so you can add GUI support for additional languages beyond the 9 that UniHelp already supports. If you browse the constants section of the UniHelpGlobals module, you will see all of the text strings that are used within the UniHelp window. This includes button names, dialog box messages, etc. Many of the constants already include the translation in 9 different languages: English, Spanish, French, Italian, Portuguese, Dutch, German, Swedish, and Japanese. For example, if you compile your application in French, UniHelp's GUI will also reflect French. Adding support for additional languages is as easy as adding new language values to each constant in the UniHelpGlobals module.