Managing menus

GiD offers you the opportunity to customize the pull-down menus. You can add new menus or to change the existing ones. If you are creating a problem type, these functions should be called from the InitGIDProject or InitGIDPostProcess functions (see TCL/TK EXTENSION ).

Note: Menus and option menus are identified by their names.

Note: It is not necessary to restore the menus when leaving the problem type, GiD does this automatically.

The Tcl functions are:

Creates a new menu. New menus are inserted between the Calculate and Help menus.

"PRE" to create the menu only in GiD Preprocess.

"POST" to create the menu only in GiD Postprocess.

"PREPOST" to create the menu in both Pre- and Postprocess.

Deletes a menu.

"PRE" to delete the menu only in GiD Preprocess.

"POST" to delete the menu only in GiD Postprocess.

"PREPOST" to delete the menu in both Pre- and Postprocess.

Creates a new option for a given menu in a given position (positions start at 0, the word 'end' can be used for the last one).

The option name, is a menu sublevels sublevels list, like [list "List" "Points"]

If you wish to insert a separator line in the menu, put "---" as the option_name.

"PRE" to insert the option into GiD Preprocess menus.

"POST" to insert the option into GiD Postprocess menus.

"PREPOST" to insert the option into both Pre- and Postprocess menus.

Removes an option from a given menu.

"PRE" to insert the option into GiD Preprocess menus.

"POST" to insert the option into GiD Postprocess menus.

"PREPOST" to insert the option into both Pre- and Postprocess menus.

Edit an existent option from a given menu

some parameters can be '-default-' to keep the current value for the command, accelerator, etc

Updates changes made on menus. This function must be called when all calls to create, delete or modify menus are made.

EXAMPLE: creating and modifying menus

In this example we create a new menu called "New Menu" and we modify the GiD Help menu:

The code to make these changes would be:

GiDMenu::Create "New Menu" "PRE" -1 =

GiDMenu::InsertOption "New Menu" [list "Option 1"] 0 PRE "Command_1" "" "" replace =

GiDMenu::InsertOption "New Menu" [list "Option 2"] 1 PRE "Command_2" "" "" replace =

GiDMenu::InsertOption "New Menu" [list "---"] 2 PRE "" "" "" replace =

GiDMenu::InsertOption "New Menu" [list "Option 3"] 3 PRE "Command_3" "" "" replace =

GiDMenu::InsertOption "Help" [list "My Help"] 1 PRE "" "" "" insert _

GiDMenu::InsertOption "Help" [list "My Help" "My help 1"] 0 PRE "Command_help1" "" "" replace _

GiDMenu::InsertOption "Help" [list "My Help" "My help 2"] 1 PRE "Command_help2" "" "" replace _

GiDMenu::RemoveOption "Help" [list "Customization Help"] PRE _

GiDMenu::RemoveOption "Help" [list "What is new"] PRE _

GiDMenu::RemoveOption "Help" [list "FAQ"] PRE _

GiDMenu::UpdateMenus