ui.Interface.loadStartMenu()

ui.Interface.LoadStartMenu() loads a start menu. This method gives an alternative to creating an application launcher menu:

CALL ui.Interface.LoadStartMenu (file_name)

where file_name is a STRING variable standing for the file name containing the start menu to be loaded definition and the path which is optional (the file should be located on an application server)

When you specify a file name, be careful with its case.

UNIX is case-sensitive, so it will treat files which names come in different cases as separate files.

Usage

While the application launcher menu functions create the menu within the 4GL source, ui.Interface.LoadStartMenu(), in its turn, loads a file storing the start menu options. Though such an approach offers less flexibility, it allows reducing the source code.

Here is an example of the ui.Interface.loadStartMenu() method calling:

#loads the start menu defined in my_startmenu_file

CALL ui.Interface.LoadStartMenu("my_startmenu_file")

You do not need to specify the file extension. It is automatically added at runtime when the file is processed.

At first, Lycia looks for the file with the specified name and the .sm2 extension. If the .sm2 file does not exist, Lycia looks for the .fm2 file with the same name. If the specified file does not exist, you get the corresponding runtime error.

If you specify the file extension, files with other extensions are not considered.

Third-party files containing the top menu definition are converted into the .sm2 format.

 

You can use variables of TEXT and BYTE data types as an argument for ui.Interface.LoadStartMenu():

DEFINE menuVar TEXT

...

CALL ui.Interface.loadStartMenu(menuVar)

Try the example program, ui.interface.loadstartmenu_01_large_dts, to learn how it works.

 

If you have a large, many-component menus, you may be interested in menu virtualizetion.

To make it work, you must specify the menu type – tree – before loading this menu:

CALL ui.Application.GetCurrent().setMenuType("Tree")

CALL ui.Interface.loadStartMenu(menuVar)

 

 

 

 

Contact Us

Privacy Policy

Copyright © 2024 Querix, (UK) Ltd.