source /home/ventana/source/elem_prop.tcl


#------------------------------------------------------
# SURFACE ANALOG INPUT
#------------------------------------------------------

# initialize and set variable for the window name
set sub_anain .analog_input_list




##############################################################
# "display" is the path of the entry window where we want
# to display our selection
##############################################################


proc analog_input_list { display } {

   #-------------------
   # Declare variable
   #-------------------
   global outsub
   global sub_anain


   if [winfo exists $sub_anain] { destroy $sub_anain }


   #-------------------------------------------------------
   # Create a new window that contains the analog list
   #-------------------------------------------------------
   global env
   set env(DISPLAY) :0
   toplevel $sub_anain

   set outsub $display

   set sub_anain11 $sub_anain.frame1
   set sub_anain12 $sub_anain.frame2
   set sub_anain13 $sub_anain.frame3

   frame $sub_anain11
   frame $sub_anain12
   frame $sub_anain13


   button $sub_anain11.in1 -relief flat -text "Analog Input #1" -command { sub_anain_selected $outsub  "Analog Input 1"}
   button $sub_anain11.in2 -relief flat -text "Analog Input #2" -command { sub_anain_selected $outsub  "Analog Input 2"}
   button $sub_anain11.in3 -relief flat -text "Analog Input #3" -command { sub_anain_selected $outsub  "Analog Input 3"}
   button $sub_anain11.in4 -relief flat -text "Analog Input #4" -command { sub_anain_selected $outsub  "Analog Input 4"}
   button $sub_anain11.in5 -relief flat -text "Analog Input #5" -command { sub_anain_selected $outsub  "Analog Input 5"}
   button $sub_anain11.in6 -relief flat -text "Analog Input #6" -command { sub_anain_selected $outsub  "Analog Input 6"}
   button $sub_anain11.in7 -relief flat -text "Analog Input #7" -command { sub_anain_selected $outsub  "Analog Input 7"}
   button $sub_anain11.in8 -relief flat -text "Analog Input #8" -command { sub_anain_selected $outsub  "Analog Input 8"}
   button $sub_anain11.in9 -relief flat -text "Analog Input #9" -command { sub_anain_selected $outsub  "Analog Input 9"}
   button $sub_anain11.in10 -relief flat -text "Analog Input #10" -command { sub_anain_selected $outsub  "Analog Input 10"}
   button $sub_anain11.in11 -relief flat -text "Analog Input #11" -command { sub_anain_selected $outsub  "Analog Input 11"}
   button $sub_anain11.in12 -relief flat -text "Analog Input #12" -command { sub_anain_selected $outsub  "Analog Input 12"}
   button $sub_anain11.in13 -relief flat -text "Analog Input #13" -command { sub_anain_selected $outsub  "Analog Input 13"}
   button $sub_anain11.in14 -relief flat -text "Analog Input #14" -command { sub_anain_selected $outsub  "Analog Input 14"}
   button $sub_anain11.in15 -relief flat -text "Analog Input #15" -command { sub_anain_selected $outsub  "Analog Input 15"}
   button $sub_anain11.in16 -relief flat -text "Analog Input #16" -command { sub_anain_selected $outsub  "Analog Input 16"}
   button $sub_anain12.in17 -relief flat -text "Analog Input #17" -command { sub_anain_selected $outsub  "Analog Input 17"}
   button $sub_anain12.in18 -relief flat -text "Analog Input #18" -command { sub_anain_selected $outsub  "Analog Input 18"}
   button $sub_anain12.in19 -relief flat -text "Analog Input #19" -command { sub_anain_selected $outsub  "Analog Input 19"}
   button $sub_anain12.in20 -relief flat -text "Analog Input #20" -command { sub_anain_selected $outsub  "Analog Input 20"}
   button $sub_anain12.in21 -relief flat -text "Analog Input #21" -command { sub_anain_selected $outsub  "Analog Input 21"}
   button $sub_anain12.in22 -relief flat -text "Analog Input #22" -command { sub_anain_selected $outsub  "Analog Input 22"}
   button $sub_anain12.in23 -relief flat -text "Analog Input #23" -command { sub_anain_selected $outsub  "Analog Input 23"}
   button $sub_anain12.in24 -relief flat -text "Analog Input #24" -command { sub_anain_selected $outsub  "Analog Input 24"}
   button $sub_anain12.in25 -relief flat -text "Analog Input #25" -command { sub_anain_selected $outsub  "Analog Input 25"}
   button $sub_anain12.in26 -relief flat -text "Analog Input #26" -command { sub_anain_selected $outsub  "Analog Input 26"}
   button $sub_anain12.in27 -relief flat -text "Analog Input #27" -command { sub_anain_selected $outsub  "Analog Input 27"}
   button $sub_anain12.in28 -relief flat -text "Analog Input #28" -command { sub_anain_selected $outsub  "Analog Input 28"}
   button $sub_anain12.in29 -relief flat -text "Analog Input #29" -command { sub_anain_selected $outsub  "Analog Input 29"}
   button $sub_anain12.in30 -relief flat -text "Analog Input #30" -command { sub_anain_selected $outsub  "Analog Input 30"}
   button $sub_anain12.in31 -relief flat -text "Analog Input #31" -command { sub_anain_selected $outsub  "Analog Input 31"}
   button $sub_anain12.in32 -relief flat -text "Analog Input #32" -command { sub_anain_selected $outsub  "Analog Input 32"}

   button $sub_anain13.in33 -relief flat -text "Analog Input #33" -command { sub_anain_selected $outsub  "Analog Input 33"}
   button $sub_anain13.in34 -relief flat -text "Analog Input #34" -command { sub_anain_selected $outsub  "Analog Input 34"}
   button $sub_anain13.in35 -relief flat -text "Analog Input #35" -command { sub_anain_selected $outsub  "Analog Input 35"}
   button $sub_anain13.in36 -relief flat -text "Analog Input #36" -command { sub_anain_selected $outsub  "Analog Input 36"}
   button $sub_anain13.in37 -relief flat -text "Analog Input #37" -command { sub_anain_selected $outsub  "Analog Input 37"}
   button $sub_anain13.in38 -relief flat -text "Analog Input #38" -command { sub_anain_selected $outsub  "Analog Input 38"}
   button $sub_anain13.in39 -relief flat -text "Analog Input #39" -command { sub_anain_selected $outsub  "Analog Input 39"}
   button $sub_anain13.in40 -relief flat -text "Analog Input #40" -command { sub_anain_selected $outsub  "Analog Input 40"}
   button $sub_anain13.in41 -relief flat -text "Analog Input #41" -command { sub_anain_selected $outsub  "Analog Input 41"}
   button $sub_anain13.in42 -relief flat -text "Analog Input #42" -command { sub_anain_selected $outsub  "Analog Input 42"}
   button $sub_anain13.in43 -relief flat -text "Analog Input #43" -command { sub_anain_selected $outsub  "Analog Input 43"}
   button $sub_anain13.in44 -relief flat -text "Analog Input #44" -command { sub_anain_selected $outsub  "Analog Input 44"}
   button $sub_anain13.in45 -relief flat -text "Analog Input #45" -command { sub_anain_selected $outsub  "Analog Input 45"}
   button $sub_anain13.in46 -relief flat -text "Analog Input #46" -command { sub_anain_selected $outsub  "Analog Input 46"}
   button $sub_anain13.in47 -relief flat -text "Analog Input #47" -command { sub_anain_selected $outsub  "Analog Input 47"}
   button $sub_anain13.in48 -relief flat -text "Analog Input #48" -command { sub_anain_selected $outsub  "Analog Input 48"}

   for {set i 1 } {$i <= 16 } {incr i} {
   	pack $sub_anain11.in$i -side top
   }

   for {set i 17 } {$i <= 32 } {incr i} {
   	pack $sub_anain12.in$i -side top
   }

   for {set i 33 } {$i <= 48 } {incr i} {
   	pack $sub_anain13.in$i -side top
   }

  button $sub_anain.b -text Close -command {destroy $sub_anain}
  pack $sub_anain.b -side bottom
  pack $sub_anain11 $sub_anain12 $sub_anain13 -side left







   proc sub_anain_selected { display text } {

      global sub_anain

      $display configure -state normal
      $display delete 0 100
      $display insert 0 $text
      $display configure -state disabled

      popup 0 0 [lindex $text 2]


      # Close the output list after
      destroy $sub_anain

   # end proc list_output
   }

#end of proc "analog_input_list"
}

#------------------------------------------------------
# SURFACE ANALOG INPUT
#------------------------------------------------------

##############################################################
# "dispay" is the path of the entry window where we want
# to display our selection
##############################################################

set surf_anain .surface_analog_input_list

proc surf_analog_input_list { display } {

   #-------------------
   # Declare variable
   #-------------------
   global outsrf
   global surf_anain


   if [winfo exists $surf_anain] {
   	destroy $surf_anain
   }


   #-------------------------------------------------------
   # Create a new window that contains the analog list
   #-------------------------------------------------------
   toplevel $surf_anain
   set outsrf $display


   button $surf_anain.in1 -relief flat -text "Analog Input #1" -command { surf_anain_selected $outsrf  "Analog Input 1"}
   button $surf_anain.in2 -relief flat -text "Analog Input #2" -command { surf_anain_selected $outsrf  "Analog Input 2"}
   button $surf_anain.in3 -relief flat -text "Analog Input #3" -command { surf_anain_selected $outsrf  "Analog Input 3"}
   button $surf_anain.in4 -relief flat -text "Analog Input #4" -command { surf_anain_selected $outsrf  "Analog Input 4"}
   button $surf_anain.in5 -relief flat -text "Analog Input #5" -command { surf_anain_selected $outsrf  "Analog Input 5"}
   button $surf_anain.in6 -relief flat -text "Analog Input #6" -command { surf_anain_selected $outsrf  "Analog Input 6"}
   button $surf_anain.in7 -relief flat -text "Analog Input #7" -command { surf_anain_selected $outsrf  "Analog Input 7"}
   button $surf_anain.in8 -relief flat -text "Analog Input #8" -command { surf_anain_selected $outsrf  "Analog Input 8"}
   button $surf_anain.in9 -relief flat -text "Analog Input #9" -command { surf_anain_selected $outsrf  "Analog Input 9"}
   button $surf_anain.in10 -relief flat -text "Analog Input #10" -command { surf_anain_selected $outsrf  "Analog Input 10"}
   button $surf_anain.in11 -relief flat -text "Analog Input #11" -command { surf_anain_selected $outsrf  "Analog Input 11"}
   button $surf_anain.in12 -relief flat -text "Analog Input #12" -command { surf_anain_selected $outsrf  "Analog Input 12"}
   button $surf_anain.in13 -relief flat -text "Analog Input #13" -command { surf_anain_selected $outsrf  "Analog Input 13"}
   button $surf_anain.in14 -relief flat -text "Analog Input #14" -command { surf_anain_selected $outsrf  "Analog Input 14"}
   button $surf_anain.in15 -relief flat -text "Analog Input #15" -command { surf_anain_selected $outsrf  "Analog Input 15"}
   button $surf_anain.in16 -relief flat -text "Analog Input #16" -command { surf_anain_selected $outsrf  "Analog Input 16"}

   for {set i 1 } {$i <= 16 } {incr i} {

   	pack $surf_anain.in$i -side top


   }

  button $surf_anain.close -text Close -command {destroy $surf_anain}
  pack $surf_anain.close






   proc surf_anain_selected { display text } {

      global surf_anain

      $display configure -state normal
      $display delete 0 100
      $display insert 0 $text
      $display configure -state disabled

      popup 1 0 [lindex $text 2]

      # Close the output list after
      destroy $surf_anain

   # end proc list_output
   }

#end of proc "analog_input_list"
}




