Tutorial Chapter 12: Changing the User Interface Dynamically |
Methods in the Interface class allow you interact with the user interface, as shown in the examples.
You do not need to get an object reference to the Interface; call the methods in the Interface class using the class identifier, ui.Interface.
The User Interface on the Client is synchronized with the DOM tree of the runtime system when an interactive statement is active. If you want to show something on the screen while the program is running in a batch procedure, you must force synchronization with the front end.
CALL ui.Interface.refresh()
Use the appropriate extension:
CALL ui.Interface.loadStartMenu("mystartmenu") CALL ui.Interface.loadTopMenu("tmstandard") CALL ui.Interface.loadToolbar("tbstandard")
Do not specify a path or file extension in the file name. The runtime system automatically searches for a file with the correct extension in the current directory and in the path list defined in the DBPATH / FGLRESOURCEPATH environment variable.
See the Loading a start menu from an XML file, ui.Interface.loadTopMenu, or ui.Interface.loadToolBar documentation in the Genero Business Development Language User Guide for details on the format and contents of the files.
Use the appropriate extension:
Use the corresponding method to load the file:
CALL ui.Interface.loadStyles("mystyles") CALL ui.Interface.loadActionDefaults("mydefaults")
You can provide an absolute path with the corresponding extension, or a simple file name without the extension. If you give the simple file name, the runtime system searches for the file in the current directory. If the file does not exist, it searches in the directories defined in the DBPATH/ FGLRESOURCEPATH environment variable.
The action defaults are applied only once, to newly created elements. For example, if you first load a toolbar, then you load a global Action defaults file, the attribute of the toolbar items will not be updated with the last loaded Action defaults.
See Presentation styles and Action defaults files in the Genero Business Development Language User Guide for details on the format and contents of the file.
You can use methods in the Interface Class to identify the type and version of the Genero client currently being used by the program:
CALL ui.Interface.getFrontEndName() RETURNING typestring CALL ui.Interface.getFrontEndVersion() RETURNING versionstring
Each method returns a string. The type will be "Gdc" or "Console".
Some of the other methods in the ui.Interface class allow you to:
See the The Interface class documentation in the Genero Business Development Language User Guide for a complete list of the methods.