
# This code creates the user interface for the mesh editor.
#
# Copyright (c) 1997 Pacific Marketing and Consulting, Inc,
#       and ICEM Systems, GmbH.  All rights reserved.
# Author:  Wayne A. Christopher, wayne@icemcfd.com
#
# All the menu-specific stuff, logos, etc go in this file.  This makes it
# easier to create flavored versions of med with different structures.

set create_object_commands ""

foreach type [lsort $object_type_list] {
    if {$type != "domain"} {
	set lname [string tolower $object_type_title($type)]
	command_define "Create $lname" \
	    $object_type_title($type) auto_generic_$type \
	    "set current_mtype $type; edit_new" \
	    "" no_help always
	lappend create_object_commands "Create $lname"
    }
}

command_define "Save project" "Save" save_icon \
    "auto_save_all" {
	Save the project.
    } no_help always

# Toolbars -----------

command_make_toolbar "File commands" 1 {
    "New project"
    "Open project"
    "Save project"
    "Print screen"
}

command_make_toolbar "Edit commands" 1 {
    "Undo"
    "Redo"
}

command_make_toolbar "Viewing options" 1 {
    "Home position"
    "Zoom in"
    "Scale to fit"
}

command_make_toolbar "Object creation" 1 $create_object_commands

# Key bindings ---------

command_set_hotkeys {
    F1 "Help"
}

command_set_hotkeys_tdv {
    h "Home position"
    z "Zoom in"
    s "Scale to fit"
    Shift-x "Orient negative X"
    Shift-y "Orient positive Y"
    Shift-z "Orient negative Z"
    Shift-r "Reverse orientation"
    Shift-i "Isometric view"
    Shift-question "Print shortcuts"
    F5 "Set wireframe offset"
    F6 "Set wireframe offset to 0"
    F7 "Increment wireframe offset"
    F8 "Decrement wireframe offset"
}

# Pulldown menus ---------

command_make_menu "File" "" left {
    { "New project" }
    { "Open project" }
    { "Save project" }
    { "Merge project" }
    { "Print screen" }
    { "Command prompt" }
    { "Quit" }
}

command_make_menu "Edit" "" left {
    { "Undo" }
    { "Redo" }
    { "Annotations" }
    { "Summary" }
}

command_make_menu "View" "" left {
    { "Generate mesh" }
    separator
    { "Location" }
    { "Distance" }
    { "Angle" }
    { "Bounding box" }
    separator
    { "Add marker" }
    { "Clear markers" }
    separator
    { "Track mouse" }
    { "Depthcue" }
    { "Set background" }
    { "Edit toolbars" }
    { "Tcl console" }
    { "Display" "" cascade {
	{ "Coord axes" }
	{ "Origin marker" }
	{ "Display rulers" }
	{ "Display current date" }
	{ "Display construction lines" }
	{ "Display construction points" }
	{ "Display object names" }
	{ "Display mesh" }
    } }
}

command_make_menu "Orient" "" left {
    { "Home position" }
    { "Zoom in" }
    { "Scale to fit" }
    { "Orient positive X" }
    { "Orient negative X" }
    { "Orient positive Y" }
    { "Orient negative Y" }
    { "Orient positive Z" }
    { "Orient negative Z" }
    { "Isometric view" }
    { "Reverse orientation" }
    { "Nearest axis" }
}

command_make_menu "Model" "" left {
    { "Edit params" }
    { "Generate mesh" }
    { "CAD import" "" cascade {
	{ "Load tetin file for CAD" }
	{ "Load IGES file for CAD" }
	{ "CAD Options" }
	separator
	{ "Selected CAD -> objects" }
	{ "CAD families -> objects" }
	{ "CAD regions -> objects" }
	separator
	{ "Blank CAD surfaces" }
	{ "Unblank CAD surfaces" }
	{ "Delete all CAD data" }
	{ "Change CAD family" }
	{ "CAD family visibility" }
	separator
	{ "Show used CAD" }
	{ "Show unused CAD" }
	{ "Solid shading for CAD" }
	{ "Fast movement for CAD" }
    } }
    { "Check model" }
    { "Snap to grid" }
    { "Edit priorities" }
}

command_make_menu "Tree" "" left {
    { "Find in tree" }
    { "Sort" "" cascade {
	{ "Sort tree alphabetically" }
	{ "Sort tree by meshing priority" }
	{ "Sort tree by creation order" }
    } }
    { "Organize objects" "" cascade {
	{ "Organize tree flat" }
	{ "Organize tree by types" }
	{ "Organize tree by types / subtypes" }
	{ "Organize tree by types / subtypes / shapes" }
    } }
    { "Close all tree nodes" }
    { "Open all tree nodes" }
}

command_make_menu "Windows" "" "left set_path toplevel(windows_menu)" {}

command_make_menu "Help" "" left {
    { "Help" }
    separator
    { "About Autohexa" }
}


