The filemenubar statement creates a custom menu bar or context menu for the current database (see Custom Menus).
Parameters
This statement has three parameters:standardmenus – specifies which standard menus should be included at the beginning and end of the menu bar. By default, the menu bar will always contain the Panorama, Action, and Window menus. This parameter allows you to easily add the File, Edit and View menus, and allows you to remove the Action and/or Window menus. See the text below for details.
custommenus – formula for defining fully custom menus in the menu bar.
menuname – name of the menu bar. The allowed values are DATA_MENUBAR
, DATA_CONTEXTMENU
and COLUMN_CONTEXTMENU
. See the text below for details.
Description
This statement creates a custom menu bar or context menu for the current database (see Custom Menus). You can create all menus entirely from scratch, or you can use a mix of standard menus (File, Edit, etc.) with your own custom menus. (Note that the custom menu bar or context menu will not be saved with the file. The default menus will reappear every time the file is opened, so you may want to put this code into the .Initialize procedure, to be executed each time the file is opened.)
The first parameter specifies the standard menus you want to include. We’ll look into the details of this later, but specifying BASIC
is all you’ll need to get Panorama’s minimum basic menus.
filemenubar "basic",""
Here are the menus you’ll get if you use the statement above:
Panorama File Edit Action Window Help
Once you’ve got the basics, you can start getting fancy. (Note: This example statement is split over multiple lines for clarity, but this is not necessary.)
filemenubar "basic",
menu("Invoice")+
menuitem("Create New Invoice")+
menuitem("Void")+
menuitem("Delete")
Now there is a custom Invoice menu between the Edit and Action menus.
Panorama File Edit Invoice Action Window Help
This example included only one custom menu, but you can add as many as you like (up to the width of the screen).
You can include standard menus at the beginning of the menu bar either individually or in groups. To include a menu individually, simply include its name.
filemenubar "file",""
filemenubar "file edit view",""
The available standard menus are: file, edit, view, records, search, and field.
Standard menus can also be included in groups. The available groups are:
You can use groups in combination with individual standard menus and with other groups:
filemenubar "basic view",""
filemenubar "basic view search",""
filemenubar "basic database","" // does not include View menu
The filemenubar statement normally generates four menus automatically: Panorama, Action, Window, and Help. If you don’t want one of these menus, put its name into the list of standard menus, prefixed with a minus sign.
filemenubar "basic -action",""
Here are the menus you’ll get if you use the statement above:
Panorama File Edit Window Help
Note: You cannot remove the Panorama menu, it will always be included.
If you want to remove all of these menu items (except Panorama), put -NONE
in the standard menu specification:
filemenubar "basic -none",""
Here are the menus you’ll get if you use the statement above:
Panorama File Edit
You may want to include one or more standard menus (File, Edit, Records, etc.) but modify them slightly – perhaps adding, changing or removing items. You can do this by creating a completely new custom menu, but you can also “tweak” most standard menus. An advantage of the latter approach is that if Panorama’s standard menu changes in a later release, your custom menus will automatically track that change without any effort on your part. To learn how to do this see Customizing the Menu in the standardfilemenu( function.
In addition to customizing the menu bar, the filemenubar statement can also modify the data sheet’s context (pop-up) menus. This is done by setting the optional menuname parameter to either DATA_CONTEXTMENU
or COLUMN_CONTEXTMENU
. When setting up context menus there are no standard menus, so the first parameter should be left empty (actually anything put in that parameter will be ignored).
This example sets up the context menu that appears when a data cell is right clicked.
filemenubar "",
menu("Context Menu")+
menuitem("Select Same")+
menuitem("Select Different")+
menuitem("Select Contains..."),
"DATA_CONTEXTMENU"
Note: This example names the menu Context Menu, but any name can be used.
This example sets up the context menu that appears when a data sheet column is right clicked.
filemenubar "",
menu("Context Menu")+
menuitem("Show Field Properties")+
menuitem("Add Field")+
menuitem("Insert Field")+
menuitem("Delete Field"),
"COLUMN_CONTEXTMENU"
Note: This example names the menu Context Menu, but any name can be used.
To remove a menu bar or context menu, set the menuname parameter to the name of the menu to be removed, preceded by a minus sign. When used to delete menus, the standardmenu and custommenu parameters are ignored. This example removes all custom menus from the current file, restoring Panorama’s default menus.
filemenubar "","","-DATA_MENUBAR"
filemenubar "","","-DATA_CONTEXTMENU"
filemenubar "","","-COLUMN_CONTEXTMENU"
See Also
History
Version | Status | Notes |
10.0 | Updated | Carried over from Panorama 6.0, but with new options for standard menus, for setting up context menus, and for removing menu definitions. |