windowmenubar
STANDARDMENUS
,
CUSTOMMENUS
,
MENUNAME

The windowmenubar statement creates a custom menu bar or context menu for the current window (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, 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 window (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.

The first parameter specifies the standard menus you want to include. We’ll look into the details of this later, but specifying BASIC, all you’ll get is Panorama’s menus.

windowmenubar "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.)

windowmenubar "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).

Including Standard Menus

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.

windowmenubar "file",""
windowmenubar "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:

windowmenubar "basic view",""
windowmenubar "basic view search sort",""
windowmenubar "basic database","" // does not include View menu

Excluding Standard Menus

The windowmenubar 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.

windowmenubar "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:

windowmenubar "basic -none",""

Here are the menus you’ll get if you use the statement above:

Panorama File Edit

Modifying Standard Menus

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.

Context Menus (Right-Click Pop-Up Menu)

In addition to customizing the menu bar, the windowmenubar statement can also modify the data sheet’s context (pop-up) menus (of course this only makes sense if the current window is the data sheet). 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.

windowmenubar "",
    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.

windowmenubar "",
    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 the any name can be used.

Removing a Menu Definition

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 window, restoring Panorama’s default menus.

windowmenubar "","","-DATA_MENUBAR"
windowmenubar "","","-DATA_CONTEXTMENU"
windowmenubar "","","-COLUMN_CONTEXTMENU"

See Also


History

VersionStatusNotes
10.0UpdatedCarried over from Panorama 6.0, but with new options for standard menus, for setting up context menus, and for removing menu definitions.