Populate Pulldown Menus

When creating the screen, we added pulldown menu structure in the first section. Now we are going to put the right names and actions in place. As soon as a user selects an option from one of the pulldown menus, some action needs to happen, like display another screen, or start a calculation etc. In ProLinga, this is controlled by "Action Handlers". Currently, there are three types of "Action Handlers":

  1. Control (C-): Built-in functions as described in the reference manual can be called. Examples are actions to cancel a screen or to return to the ProLinga logon screen.
  2. Logic (L-): ProLinga logic can be called. Examples are logic to read data from the database or to display a value on the screen.
  3. Screen (S-): A screen can be displayed. Examples are a search screen or data entry screen.

In the tutorial application, we will create the pulldown menus File, Maintenance and Help. The pulldown menu entries and action handlers are outlined below. Most actions probably do not make much sense yet, but it will become clear once we create the logic and screens referenced here.

Table 1. Pulldown Menu File

NameAction HandlerDescription
HomeL-HomeThis will call logic called "Home" to clean up the main screen.
-------(leave blank)Separator line in the pulldown menu. Cosmetics only.
LogoutC-logoutThis will exit the application and return to the ProLinga logon screen.
ExitC-exitThis exit the application.

Table 2. Pulldown Menu Maintenance

NameAction HandlerDescription
DeviceL-DeviceThis will call logic called "Device" to provide a inquiry/update mechanism of available devices

Table 3. Pulldown Menu Help

NameAction HandlerDescription
AboutS-AboutThis will display a screen with some application information.

Open the screen "Main" in the painter in the ProLinga Developer. If you click on the pulldown menu, you will see a button called "Edit Menus...".

Figure 30. Edit Pulldown Menus Entry

Screenshot of where to edit pulldown menu entries.

Press the button "Edit Menus...". All pulldown menus and entries will be displayed on a separate screen.

Figure 31. Edit Pulldown Menus Before

Screenshot of where to edit pulldown menu before edit.

When clicking on a line, details will be displayed in the right portion of the window. You can set details here like "name" and "action handler" as well as link icons to the menu entry or an accelerator. With the navigation buttons at the bottom of the screen you can change the order and hiearchy. When using an underscore sign "_" in the label name, the following character will be set as mnemonic.

Edit the various menus, until your screen looks as follows:

Figure 32. Edit Pulldown Menus After

Screenshot of where to edit pulldown menu after edit.

Save your screen in the painter, exit the painter, save your screen in the ProLinga Screen Editor and run your application. At the run-time your application now looks as follows:

Figure 33. Pulldown Menu 1 At Run-Time

Screenshot of pulldown menu 1.

Figure 34. Pulldown Menu 2 At Run-Time

Screenshot of pulldown menu 2.

Figure 35. Pulldown Menu 3 At Run-Time

Screenshot of pulldown menu 3.

If you click on any of the menu items linked to logic, you will get an error telling you that the logic does not exist. That is correct, since we have not written them yet.

Figure 36. Run-Time Error - Logic Does Not Exist

Screenshot of an error message when logic does not exist.

The same applies to the screen. The Control "action handlers" logout (File/Logout) and exit (File/Quit) should work OK.

In the next chapter we will create the toolbar.