Adding toolbars, topmenus, and action defaults

The Form class provides methods that apply topmenus, toolbars, and action defaults to a form, to assist you in standardizing forms.

The topmenus, toolbars, or action defaults are defined in external XML resource files having the following extensions:

Call the methods using the reference to the form object and specify the resource file name. Do not specify a path or file extension in the file name. If the file is not in the current directory and the path is not specified, Genero will search the directories indicated by the DBPATH / FGLRESOURCEPATH environment variable.

Example 4

01 MAIN
02 DEFINE mywin ui.Window,
03         f1    ui.Form 
04 OPEN WINDOW w1 WITH FORM "testform"
05 LET mywin = ui.Window.forName("w1")
06 CALL mywin.setText("test")
07  LET f1 = mywin.getForm()
08  CALL f1.loadTopMenu("mytopmenu")
09 MENU   
10   ON ACTION quit 
11     EXIT MENU
12 END MENU
13 
14 END MAIN
This figure is a screenshot that shows a form with a topmenu.

Figure 1. Display of a topmenu on Windows™ platform