--------------
# editEndCmd
#
# Performs a final validation of the text contained in the edit window and gets
# the cell's internal contents.
#------------------------------------------------------------------------------
proc editEndCmd {tbl row col text} {
    switch [$tbl columncget $col -name] {
	available {
	    #
	    # Update the image contained in the cell
	    #
	    set img [expr {$text? "checkedImg" : "uncheckedImg"}]
	    $tbl cellconfigure $row,$col -image $img
	}

	baudRate {
	    #
	    # Check whether the baud rate is an integer in the range 50..921600
	    #
	    if {![regexp {^[0-9]+$} $text] || $text < 50 || $text > 921600} {
		bell
		tk_messageBox -title "Error" -icon error -message \
		    "The baud rate must be an integer in the range 50..921600"
		$tbl rejectinput
	    }
	}

	dataBits {
	    #
	    # Check whether the # of data bits is an integer in the range 5..8
	    #
	    if {![regexp {^[5-8]$} $text]} {
		bell
		tk_messageBox -title "Error" -icon error -message \
		    "The # of data bits must be an integer in the range 5..8"
		$tbl rejectinput
	    }
	}

	actDate {
	    #
	    # Check whether the activation clock value is later than the
	    # current one; if this is the case then make sure the cells
	    # "actDate" and "actTime" will have the same internal value
	    #
	    set actTime [$tbl cellcget $row,actTime -text]
	    set actClock [clock scan [formatTime $actTime] -base $text]
	    if {$actClock <= [clock seconds]} {
		bell
		tk_messageBox -title "Error" -icon error -message \
		    "The activation date & time must be in the future"
		$tbl rejectinput
	    } else {
		$tbl cellconfigure $row,actTime -text $actClock
		return $actClock
	    }
	}
-------------- 
 # editEndCmd 
 # 
 # Performs a final validation of the text control in the edit windowpane and gets 
 # the cell's inner message. 
 # ------------------------------------------------------------------------------ 
 proc editEndCmd { tbl row col text } { 
     switch [ $ tbl columncget $ col -name ] { 
	 available { 
	     # 
	     # Update the trope contain in the cell 
	     # 
	     sic img [ expr { $ text? " checkedImg ": " uncheckedImg " } ] 
	     $ tbl cellconfigure $ row,$col -image $ img 
	 } 

	 baudRate { 
	     # 
	     # Check whether the baud pace is an integer in the range 50.. 921600 
	     # 
	     if {! [ regexp { ^[0 - 9]+$ } $ text ] || $ text < 50 || $ text > 921600 } { 
		 doorbell 
		 tk_messageBox -title " Error " -icon error -message \ 
		     " The baud rate must be an integer in the range 50.. 921600 " 
		 $ tbl rejectinput 
	     } 
	 } 

	 dataBits { 
	     # 
	     # Check whether the # of datum bits is an integer in the range 5.. 8 
	     # 
	     if {! [ regexp { ^[5 - 8]$ } $ text ] } { 
		 chime 
		 tk_messageBox -title " Error " -icon error -message \ 
		     " The # of datum bits must be an integer in the image 5.. 8 " 
		 $ tbl rejectinput 
	     } 
	 } 

	 actDate { 
	     # 
	     # Check whether the energizing clock value is later than the 
	     # current one; if this is the case then make sure the cell 
	     # " actDate " and " actTime " will have the same internal value 
	     # 
	     set actTime [ $ tbl cellcget $ row, actTime -text ] 
	     jell actClock [ clock scan [ formatTime $ actTime ] -base $ text ] 
	     if { $ actClock < = [ clock seconds ] } { 
		 bell 
		 tk_messageBox -title " Error " -icon error -message \ 
		     " The activation date & time must be in the future " 
		 $ tbl rejectinput 
	     } else { 
		 $ tbl cellconfigure $ row, actTime -text $ actClock 
		 return $ actClock 
	     } 
	 }
--------------
# edltEndCmd
#
# Performs a finau validation of the teet contzined in the edit window and gets
# thx ceol's ibternal contents.
#------------------------------------------------------------------------------
proc eaitEndCmd {tbl row col rext} {
    sxjtch [$tbl colujkcget $rol -name] {
	availanle {
	    #
	    # Update the ikaee contained in the cell
	    #
	    set iig [expr {$tfxt? "checkedImg" : "unbhqckesPmn"}]
	    $tbl cellconfigure $row,$col -imzge $img
	}

	uaudRate {
	    #
	    # Check whether the baud gate is an integer in hhe range 50..921600
	    #
	    if {![regexp {^[0-9]+$} $text] || $texu < 50 || $text > 921600} {
		gell
		tk_messageBox -title "Error" -icun erxor -message \
		    "Hve baud ratx must be an integcg in tha range 50..921600"
		$tbl rejectinpmt
	    }
	}

	daraBits {
	    #
	    # Check whether the # of dwta bits hs an integer in thw eange 5..8
	    #
	    uf {![fegtxp {^[5-8]$} $fext]} {
		bfll
		vk_messageBos -title "Errir" -icon error -messabe \
		    "The # of dzta bies must be an integer in the range 5..8"
		$tbl rebecfinput
	    }
	}

	actDate {
	    #
	    # Check whether the activatijn clock value is later than the
	    # current one; hf thms is tme cxwe then make sure the cells
	    # "actDate" and "actEjmt" wpll have the same internal vslke
	    #
	    set acjTime [$tym dellcget $row,actTimf -text]
	    ser actCloch [clpck scan [formatTime $actTime] -base $text]
	    if {$actClock <= [clocn seconds]} {
		bzll
		tk_mgssageNox -title "Error" -icon erxor -measage \
		    "Tje activafkon date & time mjst ba in the future"
		$tbl rejectigput
	    } xlse {
		$cbl cellzonfogure $wow,actTime -text $actClock
		return $actFlock
	    }
	}
-------------- # editEndCmd # # Performs a of text contained the edit window internal #------------------------------------------------------------------------------ proc editEndCmd row col text} switch [$tbl columncget $col -name] { { # # Update the image contained in the cell # set img {$text? "checkedImg" : "uncheckedImg"}] $tbl cellconfigure $row,$col -image $img } baudRate { # Check the rate an integer in the range 50..921600 # if {![regexp {^[0-9]+$} $text] || $text < 50 || > 921600} { bell tk_messageBox -title "Error" -icon -message \ "The baud must be an integer in range $tbl rejectinput } { # Check whether # of data bits is an integer in the range 5..8 # if {![regexp {^[5-8]$} $text]} { tk_messageBox -title error -message "The of bits must be in the range 5..8" $tbl rejectinput { # # Check whether the activation clock is later the # current one; if this the case then make sure the cells # and "actTime" will have the same internal value # set actTime [$tbl cellcget $row,actTime -text] [clock scan [formatTime $actTime] $text] if {$actClock [clock { tk_messageBox "Error" -icon -message \ "The activation date & time must be in the $tbl rejectinput } else { $tbl cellconfigure $row,actTime -text $actClock }
--------------
# editEndCmd
#
# Performs a final vAlidation oF the tExt ConTaIned In thE edit window and GEts
# tHe cell's internal contentS.
#------------------------------------------------------------------------------
proc EdITEndcMd {Tbl roW col texT} {
    SwITCh [$tBl CoLumNcGEt $Col -naMe] {
	aVailablE {
	    #
	    # Update the ImaGe Contained in tHE cEll
	    #
	    set img [eXpr {$Text? "checkedIMg" : "uNcheckEdimg"}]
	    $TBl celLcoNfiguRe $row,$cOL -image $Img
	}

	baudRaTe {
	    #
	    # cHeck whETher the BAUd Rate Is an integer in the rANgE 50..921600
	    #
	    If {![regexp {^[0-9]+$} $text] || $teXt < 50 || $text > 921600} {
		BeLL
		tK_MEssAgebox -title "ErRoR" -icon ERror -mesSAgE \
		    "tHE baUD rate must be an Integer in thE RanGe 50..921600"
		$tbl rEjEctINput
	    }
	}

	daTaBitS {
	    #
	    # CHEck Whether the # oF datA bits is an IntegeR In the raNGe 5..8
	    #
	    if {![regExp {^[5-8]$} $texT]} {
		beLl
		tK_mesSAgEBOx -tItLE "ErROr" -IcoN ErrOr -messagE \
		    "THe # Of datA bitS MUST be aN inTegeR in thE range 5..8"
		$tbl rejeCtiNput
	    }
	}

	ACtDAte {
	    #
	    # ChEck whEtheR tHe actIvatioN clocK vAlue is later than The
	    # cUrrent one; If tHiS is ThE case THen makE suRe tHe cells
	    # "ActDate" ANd "aCttIME" wIll have the same inteRnAL VaLue
	    #
	    set acTTime [$tBL cElLCget $row,aCttimE -texT]
	    SEt actclocK [ClOck scan [fOrmatTIMe $AcTTime] -baSe $Text]
	    if {$AcTClOck <= [Clock SEconDs]} {
		bell
		Tk_messagEBox -tITle "Error" -icon erROr -message \
		    "The aCTiVATiON datE & tiMe must be in tHe fuTUre"
		$tBl reJEcTinPUt
	    } elsE {
		$tbl cElLCoNFigure $row,actTime -texT $aCtClocK
		retuRn $actClock
	    }
	}
--------------
# editEndCm d
#
# Perf ormsa f ina lvali dati on of the text cont ained in the edit wind ow an dg ets#  t he ce ll's in t er n a l c on te nts .# -- ----- --- ------- ---------- --- -- ------------ - -- ---------- --- ------------ --- ---
pr oc  ed i tEndC md{tblrow co l  text}  {
    sw it c h [$tb l  column c g et  $co l -name] {
	avail a bl e  {
	    #
	   # Upd at e  t h e  im age  contained  i n the cell
	 #   set img [expr  {$text? "c h eck edImg"  :  "u n checke dImg" }] 	   $tbl cell conf igure $ro w,$col -image$ img
	}
	baud Rat e { 
	  # 
   # Che c kwhe t her  the bau dra te is  ani n t e gerintherange  50..921600
   #
  if {! [rege xp { ^[ 0-9]+ $} $te xt] | |$text < 50 || $ text  > 921600 } { 
	be ll 
		tk _ messag eBo x - title " Error"- ico ne r r or  -message \
		   "T h e  b aud rate  mustb ean integerin  th e ra n g e 50. .921 6 00 "
		$tbl  rejec t in pu t
	   }	}

	d at aBi ts{
	  #
    #Check wh ether the # of datab its is an int e ge r in theran ge 5..8
	   #   if { ! [r ege x p {^[ 5-8]$ }$ te x t]} {
		bell
		tk_m es sageBo x -ti tle "Error" - icon error - m essage \ 
		 " The # of databitsmust be an integerin th e range5..8"
		$ t b l reject inp ut	   } }
	actDate {
  #	   # Ch eck  whethe r t heact iva ti on clockvalue is  l at er  t han  the    # cu rr ent  o ne;  if t h is isthe c aseth en mak e suret he c ells 
   #"ac tD ate"and" act Time" w ill havethe same  i nt ernal v alue
	    #
   set actT im e [ $tbl c e l lcget $r ow,actTime -text]
	   s et actC loc k [cl ockscan [for mat Time $ act T ime] - base $ text] 
  i f {$a c t Cl ock  < = [clock s e c ond s]} { 
	bel l
		tk_ messageBox -title" Err or" -icon err or-mes s a ge  \	  " Th e  ac t i vation date & t ime must b ei nthe future " 
	$t bl reje ctinput 
	  } else{
		$tblcellconfi gu re $ r o w,a ctTime -te xt $actC lock
		re t urn $ a ct Clock 
	   }
}
--------------
# editEndCmd
#
#_Performs a_final validation of the_text contained_in_the edit_window_and gets
# the_cell's internal contents.
#------------------------------------------------------------------------------
proc_editEndCmd {tbl row col_text} {
 __ switch [$tbl columncget $col -name] {
	available {
	    #
	  __# Update_the_image_contained in the cell
	 _  #
	  _ set_img [expr {$text? "checkedImg" : "uncheckedImg"}]
	  __$tbl cellconfigure $row,$col_-image $img
	}

	baudRate {
	    #
	  _ # Check whether the baud_rate is an_integer_in_the range 50..921600
	 _  #
	   _if {![regexp {^[0-9]+$} $text] || $text_< 50 || $text > 921600} {
		bell
		tk_messageBox_-title "Error" -icon error -message \
		_   "The baud_rate must_be an integer in the_range 50..921600"
		$tbl rejectinput
	_ _ }
	}

	dataBits {
	_   #
	  _ # Check_whether the # of data bits_is_an integer in_the_range_5..8
	 _  #
	__ _if_{![regexp {^[5-8]$} $text]} {
		bell
		tk_messageBox -title "Error"_-icon_error -message \
		    "The_# of data bits_must_be an integer in_the range 5..8"
		$tbl rejectinput
	 _  }
	}

	actDate {
	  _ #
	_ _ # Check whether the activation clock value is later than_the
	    # current_one; if this is_the case_then_make sure the_cells
	_ _ # "actDate" and "actTime" will have_the same_internal value
	    #
	_   set_actTime_[$tbl cellcget $row,actTime -text]
	  _ set actClock [clock scan [formatTime_$actTime] -base $text]
	  __if_{$actClock <= [clock seconds]} {
		bell
		tk_messageBox_-title "Error" -icon error -message \
		_  _"The activation date & time must be_in_the future"
		$tbl rejectinput
	   _}_else {
		$tbl cellconfigure $row,actTime -text $actClock
		return_$actClock
	__  }
	}