source /home/ventana/source/but_small_popup.tcl
source /home/ventana/source/slidebar_popup.tcl
source /home/ventana/source/tms_popup.tcl


################################
# Create the "Surface" submenu         #
################################

proc create_surface_submenu { } {

global surface
set surface .ventana.bar.maintenance.menu.element.surface

.ventana.bar.maintenance.menu.element add cascade -label Surface \
	-menu $surface
	
menu  $surface




# Create the "Button" popup menu
$surface add command -label "TMS Display" \
	-command tms_popup

# Create the "Button" popup menu
$surface add command -label "Button" \
	-command but_small_popup

# Create the "Slide Bar" popup menu
$surface add command -label "Slide Bar" \
	-command slidebar_popup


#------------------------------------------------------------------------------------


###########################################################
# Another submenu of "Surface called "Digital In"                                #
# Create the "Digital In" Submenu that contain 96 element                     #
###########################################################


$surface add cascade -label "Digital In" \
	-menu $surface.digin

menu  $surface.digin


# Add the elements of submenu "Digital In"
$surface.digin add cascade -label "1-16" \
	 -menu $surface.digin.part1
	
menu $surface.digin.part1

# Adding the first 16 elements
$surface.digin.part1 add command -label "1 [get_element_name 1 1 1]" -command { popup 1 1 1 }
$surface.digin.part1 add command -label "2 [get_element_name 1 1 2]"  -command { popup 1 1 2 }
$surface.digin.part1 add command -label "3 [get_element_name 1 1 3]"  -command { popup 1 1 3 }
$surface.digin.part1 add command -label "4 [get_element_name 1 1 4]"  -command { popup 1 1 4 }
$surface.digin.part1 add command -label "5 [get_element_name 1 1 5]"  -command { popup 1 1 5 }
$surface.digin.part1 add command -label "6 [get_element_name 1 1 6]"  -command { popup 1 1 6 }
$surface.digin.part1 add command -label "7 [get_element_name 1 1 7]"  -command { popup 1 1 7 }
$surface.digin.part1 add command -label "8 [get_element_name 1 1 8]"  -command { popup 1 1 8 }
$surface.digin.part1 add command -label "9 [get_element_name 1 1 9]"  -command { popup 1 1 9 }
$surface.digin.part1 add command -label "10 [get_element_name 1 1 10]" -command { popup 1 1 10 }
$surface.digin.part1 add command -label "11 [get_element_name 1 1 11]"  -command { popup 1 1 11 }
$surface.digin.part1 add command -label "12 [get_element_name 1 1 12]"  -command { popup 1 1 12 }
$surface.digin.part1 add command -label "13 [get_element_name 1 1 13]"  -command { popup 1 1 13 }
$surface.digin.part1 add command -label "14 [get_element_name 1 1 14]"  -command { popup 1 1 14 }
$surface.digin.part1 add command -label "15 [get_element_name 1 1 15]"  -command { popup 1 1 15 }
$surface.digin.part1 add command -label "16 [get_element_name 1 1 16]" -command { popup 1 1 16 }







$surface.digin add cascade -label "17-32" \
	-menu $surface.digin.part2
	
menu $surface.digin.part2
	
# Adding the elements 17-32
$surface.digin.part2 add command -label "17 [get_element_name 1 1 17]" -command { popup 1 1 17 }
$surface.digin.part2 add command -label "18 [get_element_name 1 1 18]"  -command { popup 1 1 18 }
$surface.digin.part2 add command -label "19 [get_element_name 1 1 19]"  -command { popup 1 1 19 }
$surface.digin.part2 add command -label "20 [get_element_name 1 1 20]"  -command { popup 1 1 20 }
$surface.digin.part2 add command -label "21 [get_element_name 1 1 21]"  -command { popup 1 1 21 }
$surface.digin.part2 add command -label "22 [get_element_name 1 1 22]"  -command { popup 1 1 22 }
$surface.digin.part2 add command -label "23 [get_element_name 1 1 23]"  -command { popup 1 1 23 }
$surface.digin.part2 add command -label "24 [get_element_name 1 1 24]"  -command { popup 1 1 24 }
$surface.digin.part2 add command -label "25 [get_element_name 1 1 25]"   -command { popup 1 1 25 }
$surface.digin.part2 add command -label "26 [get_element_name 1 1 26]"  -command { popup 1 1 26 }
$surface.digin.part2 add command -label "27 [get_element_name 1 1 27]"  -command { popup 1 1 27 }
$surface.digin.part2 add command -label "28 [get_element_name 1 1 28]"  -command { popup 1 1 28 }
$surface.digin.part2 add command -label "29 [get_element_name 1 1 29]"  -command { popup 1 1 29 }
$surface.digin.part2 add command -label "30 [get_element_name 1 1 30]"  -command { popup 1 1 30 }
$surface.digin.part2 add command -label "31 [get_element_name 1 1 31]"  -command { popup 1 1 31 }
$surface.digin.part2 add command -label "32 [get_element_name 1 1 32]"  -command { popup 1 1 32 }





$surface.digin add cascade -label "33-48" \
	-menu $surface.digin.part3
	
menu  $surface.digin.part3

# Adding the elements 33 - 48
$surface.digin.part3 add command -label "33 [get_element_name 1 1 33]"  -command { popup 1 1 33 }
$surface.digin.part3 add command -label "34 [get_element_name 1 1 34]" -command { popup 1 1 34 }
$surface.digin.part3 add command -label "35 [get_element_name 1 1 35]"  -command { popup 1 1 35 }
$surface.digin.part3 add command -label "36 [get_element_name 1 1 36]"  -command { popup 1 1 36 }
$surface.digin.part3 add command -label "37 [get_element_name 1 1 37]"  -command { popup 1 1 37 }
$surface.digin.part3 add command -label "38 [get_element_name 1 1 38]"  -command { popup 1 1 38 }
$surface.digin.part3 add command -label "39 [get_element_name 1 1 39]"  -command { popup 1 1 39 }
$surface.digin.part3 add command -label "40 [get_element_name 1 1 40]"  -command { popup 1 1 40 }
$surface.digin.part3 add command -label "41 [get_element_name 1 1 41]"  -command { popup 1 1 41 }
$surface.digin.part3 add command -label "42 [get_element_name 1 1 42]"  -command { popup 1 1 42 }
$surface.digin.part3 add command -label "43 [get_element_name 1 1 43]"  -command { popup 1 1 43 }
$surface.digin.part3 add command -label "44 [get_element_name 1 1 44]"  -command { popup 1 1 44 }
$surface.digin.part3 add command -label "45 [get_element_name 1 1 45]"  -command { popup 1 1 45 }
$surface.digin.part3 add command -label "46 [get_element_name 1 1 46]"  -command { popup 1 1 46 }
$surface.digin.part3 add command -label "47 [get_element_name 1 1 47]"  -command { popup 1 1 47 }
$surface.digin.part3 add command -label "48 [get_element_name 1 1 48]"  -command { popup 1 1 48 }










$surface.digin add cascade -label "49-64" \
	-menu $surface.digin.part4
	
menu $surface.digin.part4

# Adding the elements 49-64
$surface.digin.part4 add command -label "49 [get_element_name 1 1 49]"   -command { popup 1 1 49 }
$surface.digin.part4 add command -label "50 [get_element_name 1 1 50]" -command { popup 1 1 50 }
$surface.digin.part4 add command -label "51 [get_element_name 1 1 51]"  -command { popup 1 1 51 }
$surface.digin.part4 add command -label "52 [get_element_name 1 1 52]"  -command { popup 1 1 52 }
$surface.digin.part4 add command -label "53 [get_element_name 1 1 53]"  -command { popup 1 1 53 }
$surface.digin.part4 add command -label "54 [get_element_name 1 1 54]"  -command { popup 1 1 54 }
$surface.digin.part4 add command -label "55 [get_element_name 1 1 55]"  -command { popup 1 1 55 }
$surface.digin.part4 add command -label "56 [get_element_name 1 1 56]"   -command { popup 1 1 56 }
$surface.digin.part4 add command -label "57 [get_element_name 1 1 57]"   -command { popup 1 1 57 }
$surface.digin.part4 add command -label "58 [get_element_name 1 1 58]"   -command { popup 1 1 58 }
$surface.digin.part4 add command -label "59 [get_element_name 1 1 59]"   -command { popup 1 1 59 }
$surface.digin.part4 add command -label "60 [get_element_name 1 1 60]"   -command { popup 1 1 60 }
$surface.digin.part4 add command -label "61 [get_element_name 1 1 61]"  -command { popup 1 1 61 }
$surface.digin.part4 add command -label "62 [get_element_name 1 1 62]"  -command { popup 1 1 62 }
$surface.digin.part4 add command -label "63 [get_element_name 1 1 63]"  -command { popup 1 1 63 }
$surface.digin.part4 add command -label "64 [get_element_name 1 1 64]" -command { popup 1 1 64 }



$surface.digin add cascade -label "65-80"  \
	-menu $surface.digin.part5
	
menu $surface.digin.part5

# Adding the elements 65-80
$surface.digin.part5 add command -label "65 [get_element_name 1 1 65]"  -command { popup 1 1 65 }
$surface.digin.part5 add command -label "66 [get_element_name 1 1 66]" -command { popup 1 1 66 }
$surface.digin.part5 add command -label "67 [get_element_name 1 1 67]" -command { popup 1 1 67 }
$surface.digin.part5 add command -label "68 [get_element_name 1 1 68]"  -command { popup 1 1 68 }
$surface.digin.part5 add command -label "69 [get_element_name 1 1 69]"  -command { popup 1 1 69 }
$surface.digin.part5 add command -label "70 [get_element_name 1 1 70]"  -command { popup 1 1 70 }
$surface.digin.part5 add command -label "71 [get_element_name 1 1 71]"  -command { popup 1 1 71 }
$surface.digin.part5 add command -label "72 [get_element_name 1 1 72]"  -command { popup 1 1 72 }
$surface.digin.part5 add command -label "73 [get_element_name 1 1 73]"   -command { popup 1 1 73 }
$surface.digin.part5 add command -label "74 [get_element_name 1 1 74]"  -command { popup 1 1 74 }
$surface.digin.part5 add command -label "75 [get_element_name 1 1 75]"  -command { popup 1 1 75 }
$surface.digin.part5 add command -label "76 [get_element_name 1 1 76]"  -command { popup 1 1 76 }
$surface.digin.part5 add command -label "77 [get_element_name 1 1 77]"  -command { popup 1 1 77 }
$surface.digin.part5 add command -label "78 [get_element_name 1 1 78]"   -command { popup 1 1 78 }
$surface.digin.part5 add command -label "79 [get_element_name 1 1 79]"    -command { popup 1 1 79 }
$surface.digin.part5 add command -label "80 [get_element_name 1 1 80]"  -command { popup 1 1 80 }






$surface.digin add cascade -label "81-96" \
	-menu $surface.digin.part6
	
menu  $surface.digin.part6

# Adding the elements 81-96
$surface.digin.part6 add command -label "81 [get_element_name 1 1 81]"  -command { popup 1 1 81 }
$surface.digin.part6 add command -label "82 [get_element_name 1 1 82]"  -command { popup 1 1 82 }
$surface.digin.part6 add command -label "83 [get_element_name 1 1 83]"  -command { popup 1 1 83 }
$surface.digin.part6 add command -label "84 [get_element_name 1 1 84]"  -command { popup 1 1 84 }
$surface.digin.part6 add command -label "85 [get_element_name 1 1 85]"  -command { popup 1 1 85 }
$surface.digin.part6 add command -label "86 [get_element_name 1 1 86]" -command { popup 1 1 86 }
$surface.digin.part6 add command -label "87 [get_element_name 1 1 87]"  -command { popup 1 1 87 }
$surface.digin.part6 add command -label "88 [get_element_name 1 1 88]"  -command { popup 1 1 88 }
$surface.digin.part6 add command -label "89 [get_element_name 1 1 89]"  -command { popup 1 1 89 }
$surface.digin.part6 add command -label "90 [get_element_name 1 1 90]"  -command { popup 1 1 90 }
$surface.digin.part6 add command -label "91 [get_element_name 1 1 91]"  -command { popup 1 1 91 }
$surface.digin.part6 add command -label "92 [get_element_name 1 1 92]"  -command { popup 1 1 92 }
$surface.digin.part6 add command -label "93 [get_element_name 1 1 93]"  -command { popup 1 1 93 }
$surface.digin.part6 add command -label "94 [get_element_name 1 1 94]" -command { popup 1 1 94 }
$surface.digin.part6 add command -label "95 [get_element_name 1 1 95]" -command { popup 1 1 95 }
$surface.digin.part6 add command -label "96 [get_element_name 1 1 96]"  -command { popup 1 1 96 }




#------------------------------------------------------------------------------------


###########################################################
# Another submenu of "Surface called "Analog In"                               #
# Create the "Analog In" submenu that contain 16 element                    #
###########################################################




$surface add cascade -label "Analog In" \
	-menu $surface.anain

menu  $surface.anain


# Analog Input 1- 16
$surface.anain add cascade -label "1-16" \
	-menu $surface.anain.part1

menu $surface.anain.part1

# Add the elements of first part of submenu "Analog In"
$surface.anain.part1 add command -label "1 [get_element_name 1 0 1]"  -command { popup 1 0 1 }
$surface.anain.part1 add command -label "2 [get_element_name 1 0 2]"  -command { popup 1 0 2 }
$surface.anain.part1 add command -label "3 [get_element_name 1 0 3]"  -command { popup 1 0 3 }
$surface.anain.part1 add command -label "4 [get_element_name 1 0 4]"  -command { popup 1 0 4 }
$surface.anain.part1 add command -label "5 [get_element_name 1 0 5]"   -command { popup 1 0 5 }
$surface.anain.part1 add command -label "6 [get_element_name 1 0 6]"   -command { popup 1 0 6 }
$surface.anain.part1 add command -label "7 [get_element_name 1 0 7]"   -command { popup 1 0 7 }
$surface.anain.part1 add command -label "8 [get_element_name 1 0 8]"   -command { popup 1 0 8 }
$surface.anain.part1 add command -label "9 [get_element_name 1 0 9]"   -command { popup 1 0 9 }
$surface.anain.part1 add command -label "10 [get_element_name 1 0 10]"   -command { popup 1 0 10 }
$surface.anain.part1 add command -label "11 [get_element_name 1 0 11]"  -command { popup 1 0 11 }
$surface.anain.part1 add command -label "12 [get_element_name 1 0 12]"  -command { popup 1 0 12 }
$surface.anain.part1 add command -label "13 [get_element_name 1 0 13]"  -command { popup 1 0 13 }
$surface.anain.part1 add command -label "14 [get_element_name 1 0 14]"  -command { popup 1 0 14 }
$surface.anain.part1 add command -label "15 [get_element_name 1 0 15]"   -command { popup 1 0 15 }
$surface.anain.part1 add command -label "16 [get_element_name 1 0 16]"   -command { popup 1 0 16}




# Analog Input 17- 32
$surface.anain add cascade -label "17-32" \
	-menu $surface.anain.part2

menu $surface.anain.part2

# Add the elements of first part of submenu "Analog In"
$surface.anain.part2 add command -label "17 [get_element_name 1 0 17]"  -command { popup 1 0 17 }
$surface.anain.part2 add command -label "18 [get_element_name 1 0 18]"  -command { popup 1 0 18 }
$surface.anain.part2 add command -label "19 [get_element_name 1 0 19]"  -command { popup 1 0 19 }
$surface.anain.part2 add command -label "20 [get_element_name 1 0 20]"  -command { popup 1 0 20 }
$surface.anain.part2 add command -label "21 [get_element_name 1 0 21]"   -command { popup 1 0 21 }
$surface.anain.part2 add command -label "22 [get_element_name 1 0 22]"   -command { popup 1 0 22 }
$surface.anain.part2 add command -label "23 [get_element_name 1 0 23]"   -command { popup 1 0 23 }
$surface.anain.part2 add command -label "24 [get_element_name 1 0 24]"   -command { popup 1 0 24 }
$surface.anain.part2 add command -label "25 [get_element_name 1 0 25]"   -command { popup 1 0 25 }
$surface.anain.part2 add command -label "26 [get_element_name 1 0 26]"   -command { popup 1 0 26 }
$surface.anain.part2 add command -label "27 [get_element_name 1 0 27]"  -command { popup 1 0 27 }
$surface.anain.part2 add command -label "28 [get_element_name 1 0 28]"  -command { popup 1 0 28 }
$surface.anain.part2 add command -label "29 [get_element_name 1 0 29]"  -command { popup 1 0 29 }
$surface.anain.part2 add command -label "30 [get_element_name 1 0 30]"  -command { popup 1 0 30 }
$surface.anain.part2 add command -label "31 [get_element_name 1 0 31]"   -command { popup 1 0 31 }
$surface.anain.part2 add command -label "32 [get_element_name 1 0 32]"   -command { popup 1 0 32}



# Analog Input 33- 48
$surface.anain add cascade -label "33-48" \
	-menu $surface.anain.part3

menu $surface.anain.part3

# Add the elements of first part of submenu "Analog In"
$surface.anain.part3 add command -label "33 [get_element_name 1 0 33]"  -command { popup 1 0 33 }
$surface.anain.part3 add command -label "34 [get_element_name 1 0 34]"  -command { popup 1 0 34 }
$surface.anain.part3 add command -label "35 [get_element_name 1 0 35]"  -command { popup 1 0 35 }
$surface.anain.part3 add command -label "36 [get_element_name 1 0 36]"  -command { popup 1 0 36 }
$surface.anain.part3 add command -label "37 [get_element_name 1 0 37]"   -command { popup 1 0 37 }
$surface.anain.part3 add command -label "38 [get_element_name 1 0 38]"   -command { popup 1 0 38 }
$surface.anain.part3 add command -label "39 [get_element_name 1 0 39]"   -command { popup 1 0 39 }
$surface.anain.part3 add command -label "40 [get_element_name 1 0 40]"   -command { popup 1 0 40 }
$surface.anain.part3 add command -label "41 [get_element_name 1 0 41]"   -command { popup 1 0 41 }
$surface.anain.part3 add command -label "42 [get_element_name 1 0 42]"   -command { popup 1 0 42 }
$surface.anain.part3 add command -label "43 [get_element_name 1 0 43]"  -command { popup 1 0 43 }
$surface.anain.part3 add command -label "44 [get_element_name 1 0 44]"  -command { popup 1 0 44 }
$surface.anain.part3 add command -label "45 [get_element_name 1 0 45]"  -command { popup 1 0 45 }
$surface.anain.part3 add command -label "46 [get_element_name 1 0 46]"  -command { popup 1 0 46 }
$surface.anain.part3 add command -label "47 [get_element_name 1 0 47]"   -command { popup 1 0 47 }
$surface.anain.part3 add command -label "48 [get_element_name 1 0 48]"   -command { popup 1 0 48}


# Analog Input 49- 64
$surface.anain add cascade -label "49-64" \
	-menu $surface.anain.part4

menu $surface.anain.part4

# Add the elements of first part of submenu "Analog In"
$surface.anain.part4 add command -label "49 [get_element_name 1 0 49]"  -command { popup 1 0 49 }
$surface.anain.part4 add command -label "50 [get_element_name 1 0 50]"  -command { popup 1 0 50 }
$surface.anain.part4 add command -label "51 [get_element_name 1 0 51]"  -command { popup 1 0 51 }
$surface.anain.part4 add command -label "52 [get_element_name 1 0 52]"  -command { popup 1 0 52 }
$surface.anain.part4 add command -label "53 [get_element_name 1 0 53]"   -command { popup 1 0 53 }
$surface.anain.part4 add command -label "54 [get_element_name 1 0 54]"   -command { popup 1 0 54 }
$surface.anain.part4 add command -label "55 [get_element_name 1 0 55]"   -command { popup 1 0 55 }
$surface.anain.part4 add command -label "56 [get_element_name 1 0 56]"   -command { popup 1 0 56 }
$surface.anain.part4 add command -label "57 [get_element_name 1 0 57]"   -command { popup 1 0 57 }
$surface.anain.part4 add command -label "58 [get_element_name 1 0 58]"   -command { popup 1 0 58 }
$surface.anain.part4 add command -label "59 [get_element_name 1 0 59]"  -command { popup 1 0 59 }
$surface.anain.part4 add command -label "60 [get_element_name 1 0 60]"  -command { popup 1 0 60 }
$surface.anain.part4 add command -label "61 [get_element_name 1 0 61]"  -command { popup 1 0 61 }
$surface.anain.part4 add command -label "62 [get_element_name 1 0 62]"  -command { popup 1 0 62 }
$surface.anain.part4 add command -label "63 [get_element_name 1 0 63]"   -command { popup 1 0 63 }
$surface.anain.part4 add command -label "64 [get_element_name 1 0 64]"   -command { popup 1 0 64}





#------------------------------------------------------------------------------------


#############################################################
# Another submenu of "Surface called "Analog Out"                             	#
# Create the "Analog Out" submenu that contain 4 element                  	#
# The first two element come from the first analog card, and the last two	#
# comes from the second analog card				#
# Each element selection will call "out_popup" which will display the 	#
# analog output properties, eg: gain, offset, etc. 			#
# The function is implemented in file called "out_elem_prop.tcl"		#
#############################################################

# Analog Input 1- 16
$surface add cascade -label "Analog Out" \
	-menu $surface.anaout

menu $surface.anaout

# Add the elements of first part of submenu "Analog In"
$surface.anaout add command -label "1 [get_element_name 1 3 1]"  -command { out_popup 1 3 1 }
$surface.anaout add command -label "2 [get_element_name 1 3 2]"  -command { out_popup 1 3 2 }
$surface.anaout add command -label "3 [get_element_name 1 3 3]"  -command { out_popup 1 3 3 }
$surface.anaout add command -label "4 [get_element_name 1 3 4]"  -command { out_popup 1 3 4 }



# end of create_surface_submenu proc
}


