Posted to tcl by ClayOgre at Sat Nov 10 15:36:03 GMT 2007view raw

  1. #the code below is for the actual creation of the widget itself for the
  2. #input of the clock number. It is in the main window. The toplevel for the
  3. #debug stuff isn't gonna be in the main program. It is just so I can see what
  4. #is happening.
  5.  
  6.  
  7. ################################################################################
  8. # the length constraint feature for the clock number entry widget was
  9. # "borrowed" from the ActiveState entry3.tcl demo
  10. # I don't really understand how it works yet.
  11. # it is also used on the part number entry and quantity entry.
  12. ################################################################################
  13.  
  14. frame .clockfrm -relief groove -borderwidth 2
  15.  
  16. label .clockNumLabel -text "CLOCK #" -font mainFont
  17.  
  18. entry .clockNumInput -textvariable dataBlock(clock_submit) \
  19. -validate key -invcmd bell -vcmd {expr {[string length %P]<6}} \
  20. -width 5 -font inputFont -justify right
  21.  
  22. grid .clockNumLabel -in .clockfrm -row 1 -column 1 -sticky e -padx 11 -pady 3
  23. grid .clockNumInput -in .clockfrm -row 1 -column 2 -sticky e -padx 3 -pady 3
  24.  
  25. #################################################################################
  26. # This sets up what will be the global list of fields that will be saved
  27. # out when the user presses the 'SUBMIT' button. Initializes 22 elements to ""
  28. #################################################################################
  29.  
  30. array set dataBlock {
  31. date_submit ""
  32. time_submit ""
  33. clock_submit ""
  34. part_number ""
  35. part_name ""
  36. part_serial_number ""
  37. setup ""
  38. quantity ""
  39. comments ""
  40. lk_dea_gl_flag ""
  41. v12_prog ""
  42. v8_prog ""
  43. v8_head ""
  44. cmm_clock ""
  45. cmm_start_date ""
  46. cmm_start_time ""
  47. cmm_end_date ""
  48. cmm_end_time ""
  49. cmm_time_on_table ""
  50. new_prog ""
  51. cmm_comments ""
  52. other ""
  53.  
  54. }
  55.  
  56. #this is in one window that is intended to show the values of all the
  57. #variables input by the user. There is a block of code like the one below for #each of the above array elements.
  58.  
  59. label .debug.dbg2 -text "CLOCK #" -relief groove -bg white
  60. entry .debug.dgb2a -textvariable dataBlock(clock_submit) -relief groove -width 5
  61. grid .debug.dbg2 -row 3 -column 1 -sticky e -padx 2 -pady 3
  62. grid .debug.dgb2a -row 3 -column 2 -sticky w -padx 2 -pady 3
  63.  
  64.  
  65.