This file is indexed.

/usr/share/elmerfront/tcl/ecif_tk_procsPanelCheck.tcl is in elmer-common 6.1.0.svn.5396.dfsg2-4ubuntu4.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

   1
   2
   3
   4
   5
   6
   7
   8
   9
  10
  11
  12
  13
  14
  15
  16
  17
  18
  19
  20
  21
  22
  23
  24
  25
  26
  27
  28
  29
  30
  31
  32
  33
  34
  35
  36
  37
  38
  39
  40
  41
  42
  43
  44
  45
  46
  47
  48
  49
  50
  51
  52
  53
  54
  55
  56
  57
  58
  59
  60
  61
  62
  63
  64
  65
  66
  67
  68
  69
  70
  71
  72
  73
  74
  75
  76
  77
  78
  79
  80
  81
  82
  83
  84
  85
  86
  87
  88
  89
  90
  91
  92
  93
  94
  95
  96
  97
  98
  99
 100
 101
 102
 103
 104
 105
 106
 107
 108
 109
 110
 111
 112
 113
 114
 115
 116
 117
 118
 119
 120
 121
 122
 123
 124
 125
 126
 127
 128
 129
 130
 131
 132
 133
 134
 135
 136
 137
 138
 139
 140
 141
 142
 143
 144
 145
 146
 147
 148
 149
 150
 151
 152
 153
 154
 155
 156
 157
 158
 159
 160
 161
 162
 163
 164
 165
 166
 167
 168
 169
 170
 171
 172
 173
 174
 175
 176
 177
 178
 179
 180
 181
 182
 183
 184
 185
 186
 187
 188
 189
 190
 191
 192
 193
 194
 195
 196
 197
 198
 199
 200
 201
 202
 203
 204
 205
 206
 207
 208
 209
 210
 211
 212
 213
 214
 215
 216
 217
 218
 219
 220
 221
 222
 223
 224
 225
 226
 227
 228
 229
 230
 231
 232
 233
 234
 235
 236
 237
 238
 239
 240
 241
 242
 243
 244
 245
 246
 247
 248
 249
 250
 251
 252
 253
 254
 255
 256
 257
 258
 259
 260
 261
 262
 263
 264
 265
 266
 267
 268
 269
 270
 271
 272
 273
 274
 275
 276
 277
 278
 279
 280
 281
 282
 283
 284
 285
 286
 287
 288
 289
 290
 291
 292
 293
 294
 295
 296
 297
 298
 299
 300
 301
 302
 303
 304
 305
 306
 307
 308
 309
 310
 311
 312
 313
 314
 315
 316
 317
 318
 319
 320
 321
 322
 323
 324
 325
 326
 327
 328
 329
 330
 331
 332
 333
 334
 335
 336
 337
 338
 339
 340
 341
 342
 343
 344
 345
 346
 347
 348
 349
 350
 351
 352
 353
 354
 355
 356
 357
 358
 359
 360
 361
 362
 363
 364
 365
 366
 367
 368
 369
 370
 371
 372
 373
 374
 375
 376
 377
 378
 379
 380
 381
 382
 383
 384
 385
 386
 387
 388
 389
 390
 391
 392
 393
 394
 395
 396
 397
 398
 399
 400
 401
 402
 403
 404
 405
 406
 407
 408
 409
 410
 411
 412
 413
 414
 415
 416
 417
 418
 419
 420
 421
 422
 423
 424
 425
 426
 427
 428
 429
 430
 431
 432
 433
 434
 435
 436
 437
 438
 439
 440
 441
 442
 443
 444
 445
 446
 447
 448
 449
 450
 451
 452
 453
 454
 455
 456
 457
 458
 459
 460
 461
 462
 463
 464
 465
 466
 467
 468
 469
 470
 471
 472
 473
 474
 475
 476
 477
 478
 479
 480
 481
 482
 483
 484
 485
 486
 487
 488
 489
 490
 491
 492
 493
 494
 495
 496
 497
 498
 499
 500
 501
 502
 503
 504
 505
 506
 507
 508
 509
 510
 511
 512
 513
 514
 515
 516
 517
 518
 519
 520
 521
 522
 523
 524
 525
 526
 527
 528
 529
 530
 531
 532
 533
 534
 535
 536
 537
 538
 539
 540
 541
 542
 543
 544
 545
 546
 547
 548
 549
 550
 551
 552
 553
 554
 555
 556
 557
 558
 559
 560
 561
 562
 563
 564
 565
 566
 567
 568
 569
 570
 571
 572
 573
 574
 575
 576
 577
 578
 579
 580
 581
 582
 583
 584
 585
 586
 587
 588
 589
 590
 591
 592
 593
 594
 595
 596
 597
 598
 599
 600
 601
 602
 603
 604
 605
 606
 607
 608
 609
 610
 611
 612
 613
 614
 615
 616
 617
 618
 619
 620
 621
 622
 623
 624
 625
 626
 627
 628
 629
 630
 631
 632
 633
 634
 635
 636
 637
 638
 639
 640
 641
 642
 643
 644
 645
 646
 647
 648
 649
 650
 651
 652
 653
 654
 655
 656
 657
 658
 659
 660
 661
 662
 663
 664
 665
 666
 667
 668
 669
 670
 671
 672
 673
 674
 675
 676
 677
 678
 679
 680
 681
 682
 683
 684
 685
 686
 687
 688
 689
 690
 691
 692
 693
 694
 695
 696
 697
 698
 699
 700
 701
 702
 703
 704
 705
 706
 707
 708
 709
 710
 711
 712
 713
 714
 715
 716
 717
 718
 719
 720
 721
 722
 723
 724
 725
 726
 727
 728
 729
 730
 731
 732
 733
 734
 735
 736
 737
 738
 739
 740
 741
 742
 743
 744
 745
 746
 747
 748
 749
 750
 751
 752
 753
 754
 755
 756
 757
 758
 759
 760
 761
 762
 763
 764
 765
 766
 767
 768
 769
 770
 771
 772
 773
 774
 775
 776
 777
 778
 779
 780
 781
 782
 783
 784
 785
 786
 787
 788
 789
 790
 791
 792
 793
 794
 795
 796
 797
 798
 799
 800
 801
 802
 803
 804
 805
 806
 807
 808
 809
 810
 811
 812
 813
 814
 815
 816
 817
 818
 819
 820
 821
 822
 823
 824
 825
 826
 827
 828
 829
 830
 831
 832
 833
 834
 835
 836
 837
 838
 839
 840
 841
 842
 843
 844
 845
 846
 847
 848
 849
 850
 851
 852
 853
 854
 855
 856
 857
 858
 859
 860
 861
 862
 863
 864
 865
 866
 867
 868
 869
 870
 871
 872
 873
 874
 875
 876
 877
 878
 879
 880
 881
 882
 883
 884
 885
 886
 887
 888
 889
 890
 891
 892
 893
 894
 895
 896
 897
 898
 899
 900
 901
 902
 903
 904
 905
 906
 907
 908
 909
 910
 911
 912
 913
 914
 915
 916
 917
 918
 919
 920
 921
 922
 923
 924
 925
 926
 927
 928
 929
 930
 931
 932
 933
 934
 935
 936
 937
 938
 939
 940
 941
 942
 943
 944
 945
 946
 947
 948
 949
 950
 951
 952
 953
 954
 955
 956
 957
 958
 959
 960
 961
 962
 963
 964
 965
 966
 967
 968
 969
 970
 971
 972
 973
 974
 975
 976
 977
 978
 979
 980
 981
 982
 983
 984
 985
 986
 987
 988
 989
 990
 991
 992
 993
 994
 995
 996
 997
 998
 999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
#/*****************************************************************************/
# *
# *  Elmer, A Finite Element Software for Multiphysical Problems
# *
# *  Copyright 1st April 1995 - , CSC - IT Center for Science Ltd., Finland
# * 
# *  This program is free software; you can redistribute it and/or
# *  modify it under the terms of the GNU General Public License
# *  as published by the Free Software Foundation; either version 2
# *  of the License, or (at your option) any later version.
# * 
# *  This program is distributed in the hope that it will be useful,
# *  but WITHOUT ANY WARRANTY; without even the implied warranty of
# *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# *  GNU General Public License for more details.
# *
# *  You should have received a copy of the GNU General Public License
# *  along with this program (in file fem/GPL-2); if not, write to the 
# *  Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 
# *  Boston, MA 02110-1301, USA.
# *
# *****************************************************************************/
 
#***********************************************************************
#Program:   ELMER Front 
#Module:    ecif_tk_procsPanelCheck.tcl
#Language:  Tcl
#Date:      05.10.98
#Version:   1.00
#Author(s): Martti Verho
#Revisions: 
#
#Abstract:  Panel checking procedures.
#
#************************************************************************


##############################
### Field values checking ####
##############################


# Check one field
#
# NOTE: This is a "stand alone" function, which gives
# its own error msg boxes etc.
# Do NOT call it from PanelCheck::checkFields !!!
#
proc PanelCheck::checkField {globArray fld} {
  global Info
  upvar #0 $globArray theArray


  if { !$theArray($fld,act) } {
    return ""
  }

  set msg [PanelCheck::checkFieldValue $globArray $fld]

  #-Possible Error messages
  if {$msg != ""} {
    set label [DataField::getFieldProperty $globArray $fld Label]
    lappend totmsg [string toupper $label]
    lappend totmsg "\n\n$msg"

    set Info(messageIcon) error
    Message::dispOkMessage $totmsg  "$Info(FRONT_NAME) message!" $theArray(winName)

    set theArray($fld,err) 1
    return $msg
  }

  set theArray($fld,err) 0

  return ""
}


# Starts data checking in the panel referred by globArray.
# Each field should have a field-type indicator like InitialCondition(TEMP,"S")
# for: a scalar field in the TEMP-variable field in the init cond panel.
#NOTE: Checking of vectors should be more general (length as param. etc)
#
proc PanelCheck::checkFields {globArray {fields  ""} } {
  global Common Info
  upvar #0 $globArray theArray

  set totmsg ""

  if { $fields == "" } {
    set fields $theArray(allFields)
  }

  #-Check each field
  foreach fld $fields {

    if { !$theArray($fld,act) } {
      continue
    }

    set msg [PanelCheck::checkFieldValue $globArray $fld]

    #-Field error messages are collected!
    if { $msg != "" } {

      set theArray($fld,err) 1

      set label [DataField::getFieldProperty $globArray $fld Label]
      lappend totmsg "\n"
      lappend totmsg [string toupper "$label"]
      lappend totmsg "\n$msg\n"
    
    #-Field Ok
    } else {
      set theArray($fld,err) 0
    }
  }

  #-Ok (no msg-variable was created!)
  if { $totmsg == "" } {
    return 1

  #-Error message is displayed
  } else {
    set totmsg [linsert $totmsg 0 $Info(fieldMsg)]
    set Info(messageIcon) error
    Message::dispOkMessage $totmsg  \
                 "$Info(FRONT_NAME) message" \
                  $theArray(winName)

    return 0
  }
}


# Check data value for one field
#
proc PanelCheck::checkFieldValue {globArray fld} {
  global Common Info
  upvar #0 $globArray theArray

  # If not screen field, just run possible check proc for the field
  #
  if { ![Panel::isCheckableDataField $globArray $fld] } {
    set msg [PanelCheck::evalFieldCheckProc $globArray $fld]
    return $msg
  }

  set theArray($fld) [string trim $theArray($fld)]

  # Update data type if scalar value
  if { ( ![info exists theArray($fld,proc)] || !$theArray($fld,proc) ) &&
       ( ![info exists theArray($fld,table)] || !$theArray($fld,table) )
     } {
    set theArray($fld,valueData) $theArray($fld)
  }

  set theArray($fld,matc) ""
	
  # Find field properties
  # =====================
  set fvtype [DataField::getFieldProperty $globArray $fld FieldValueType]
  set frmt [DataField::getFieldProperty $globArray $fld FieldFormat]

  set min_max_sizes ""
  lappend min_max_sizes [DataField::getFieldProperty $globArray $fld MinDataSize1]
  lappend min_max_sizes [DataField::getFieldProperty $globArray $fld MaxDataSize1]
  lappend min_max_sizes [DataField::getFieldProperty $globArray $fld MinDataSize2]
  lappend min_max_sizes [DataField::getFieldProperty $globArray $fld MaxDataSize2]

  set needed_level [Panel::getFieldNeededLevel $globArray $fld]

  set range ""
  set valueset ""
  set tmp [DataField::getFieldProperty $globArray $fld Limits]

  if { "Interval" == [lindex $tmp 0] } {
    set range [lindex $tmp 1]
  } elseif { "Set" == [lindex $tmp 0] } {
    set valueset [lindex $tmp 1]
  }

  set accept_scalar 1
  set fdtype [DataField::getFieldProperty $globArray $fld FieldDataType]
  if { $fdtype == "Array" } {
    set accept_scalar 0
  }

  # Default value type is numeric
  set value_type "nbr"

	#-A Matc-script
  if { "$" == [string index $theArray($fld) 0] } {
    
    #-If second character is $, send field to Sif as it is
    #
		if { "$" == [string index [string trim [string range $theArray($fld) 1 end] ] 0] } {
			set msg ""
			return

    #-If next four non-blank characters are MATC, send field to Sif as it is
    #
    } elseif { "MATC" == [string toupper [string range [string trim [string range $theArray($fld) 1 end] ] 0 3 ] ] } {
      set mc_val [string trim [string range $theArray($fld) 1 end]]
      set mc_val [string trim [string range $mc_val 4 end]]
      if { "\"" == [string index $mc_val 0] } {
        set mc_val [string replace $mc_val 0 0 "\'"]
      }
      if { "\"" == [string index $mc_val end] } {
        set mc_val [string replace $mc_val end end "\'"]
      }
      
      # Format $MATC-field
      set theArray($fld) "\$MATC "
      append theArray($fld) $mc_val
			set msg ""
			return
    
    #-Otherwise send field to be evaluated by Front
    #
		} else {
			set theArray($fld,matc) $theArray($fld)
			set theArray($fld)  [string range $theArray($fld) 1 end]
			set value_type "matc"
		}

  #-File name
  } elseif { $fvtype == "File" ||
             ( [info exists theArray($fld,file)] &&
               $theArray($fld,file)
             )
           } {
    set value_type "file"

  #-Directory name
  } elseif { $fvtype == "Directory" } {
    set value_type "dir"

  #-String
  } elseif { $fvtype == "String" } {
    set value_type "str"

  #-Procedure name
  } elseif { $fvtype == "Procedure" ||
             ( [info exists theArray($fld,proc)] &&
               $theArray($fld,proc)
             )
           } {
    set value_type "proc"

  #-Library name
  } elseif { $fvtype == "Library" } {
    set value_type "lib"

  #-Function name
  } elseif { $fvtype == "Function" } {
    set value_type "func"

  #-Variable name
  } elseif { $fvtype == "Variable" } {
    set value_type "var"
  }

  # If field need special handling to read the data
  if { [info exists Common($globArray,$fld,widget2DataProc)] } {
    Util::execArrayProc $globArray $fld,widget2DataProc
  }

  # Start checking
  # ==============
  set msg ""
  set value $theArray($fld)

  # Pick possible variable and size description
  set description [DataField::extractVariableAndSizeDescription cleaned $value]
  set theArray($fld) $cleaned

  set check 1
  set dtype ""
  set msg [DataField::setVariableAndSizeValues $globArray $fld $dtype $description $check]

  # If error in description
  if { $msg != "" } {
    set theArray($fld,variables) $description
    set theArray($fld,dataSize) ""
    lappend totmsg "$msg"
  }

  # Possible variable values size in one entry
  if { [info exist theArray($fld,variables)] } {
    set var_size [llength [split $theArray($fld,variables) $Info(dataListSeparator)]]
  } else {
    set var_size 0
  }

  # Data item size in one entry
  # NOTE: Use this call, because it converts DIM-like defs into
  # numeric values
  set data_size [DataField::getFieldSize $globArray $fld]

  # Call check proc for the field
  # =============================
  set res_value ""
  set msg [DataField::checkValue res_value res_size $theArray($fld) $frmt $value_type    \
                      $needed_level $range $valueset $var_size $data_size $accept_scalar \
                      $min_max_sizes]

  set res_value [string trim $res_value]

  # If ok
  # =====
  if {$msg == ""} {

    set msg [PanelCheck::evalFieldCheckProc $globArray $fld]

    #--Finally data is Ok and can be stored to the field!!!
    #
    if { $msg == "" } {
      set theArray($fld) $res_value

			#set s1 [lindex [lindex $res_size 0] end]
			#set s2 [lindex [lindex $res_size 1] end]
      #set theArray($fld,dataSize) [list $s1 $s2]
			set theArray($fld,dataSize) [lindex [lindex $res_size 0] end]

      set theArray($fld,nofEntries) [lindex $res_size end]
    }
  }

  return $msg
}


# Run possible field-specific check-proc
#
proc PanelCheck::evalFieldCheckProc {globArray fld} {

  set pn $globArray
  append pn "($fld,checkProc)"

  if { "" != [namespace eval :: info procs $pn] } {
    set msg [eval $pn]
  }

  return ""
}


#-Procedure checks vector-type group field data
#
proc Common(VectorGroup,checkProc) {globArray var} {
  upvar #0 $globArray theArray
  global Common Info

  set result ""
  set glist $Common($globArray,$var,group)
  set frmt [DataField::getFieldProperty $globArray $var FieldFormat]
  set ndl [DataField::getFieldProperty $globArray $var NeededLevel]

  set procedure 0
  if { [info exist theArray($var,proc)] } {
      set procedure $theArray($var,proc)
  }

  #--Data is for a procedure name 
  #  It is put to the first field(index 0), like BoundaryCondition(VELOCITY,VELX)
  if {$procedure} {
    set fn_fld [lindex $glist 0]

    set msg [DataField::checkValue res_val res_size $theArray($fn_fld) "" "proc" $ndl]

    if {$msg == ""} {
      set theArray($fn_fld) $res_val
      set theArray($var,proc) 1
    }

    set result $msg

  #--All velocity fields are read as numbers
  #  NOTE: currently fields are supposed to be scalar-valued
  } else {
    foreach v $glist {
      set ndl [DataField::getFieldProperty $globArray $var NeededLevel]
      set msg [DataField::checkValue res_val res_size $theArray($v) $frmt "nbr" $ndl]
      if {$msg == ""} {
        set theArray($v) $res_val
      } else {
        lappend result [append [append $v ": "] $msg]
      }
    }
  }

  return $result
}



# Runs field specific check procs (for cross checking, widget states etc.)
# which are called when a field is filled with data

# NOTE: These are not tied to any button, but they are "panel wide"
# Check procs are called in the format:
# BoundaryCondition(RADIATION,fillProc)
# These proc are mostly in StdPanelCheck-file
#
proc PanelCheck::execPanelFillProcs {globArray} {
  global Common
  upvar #0 $globArray theArray

  foreach fld $theArray(allFields) {  

    # Only active fields for the case must be
    # checked!
    if { ![info exists theArray($fld,trg)] || !$theArray($fld,trg) } {
      continue
    }

    PanelCheck::execFillProc $globArray $fld
  }
}


# Call check procs for group fields
#
proc PanelCheck::execPanelGroupEditProcs {globArray} {
  global Common  $globArray
  upvar #0 $globArray theArray

  foreach var $theArray(allFields) {  

    # Only problem fields are interesting
    if { ![info exists theArray($fld,prb)] || !$theArray($fld,prb) } {
      continue
    }

    if {"" != [array names $globArray "$var,groupEditProc"] } {

      set proc_name $globArray
      append proc_name "($var,editProc)"
      $proc_name $var $var
    }
  }
}


#####################################
### Panel widget check procedures ###
#####################################


# ====================================#
# Generic widget status check procs   #
#=====================================#

# A generic proc to  respond to option-menu selection
# NOTE: Define "check_proc_call" method if you want to do some special
# processing for your option menu
#
proc PanelCheck::checkOptionMenu { om wdg globArray fld check_proc_call event_info } {
  global Info
  upvar #0 $globArray theArray

  # If mouse is just moved, but not yet released!
  if { $event_info >= 256 } {
    return 0
  }

  # Let option menu widget to update
  Util::doWait 50

  # Compare current value to "panel in" value for
  # modification marking
  if { [info exists theArray($fld,old)] } {

    if { $theArray($fld) != $theArray($fld,old) } {

      set theArray($fld,mod) 1
      Panel::panelDataModified 1 $globArray

    } else {
      set theArray($fld,mod) 0
      if { ![Panel::panelHasModifiedStatus $globArray] } {
        Panel::panelDataModified 0 $globArray
      }
    }

    Widget::setOptionMenuStatus $globArray $fld $wdg

  }

  eval "$check_proc_call"

  return 1
}


# A generic proc to  respond to a selection-box selection
# NOTE: Define "check_proc_call" method if you want to do some special
# processing for your selection box
# event_mode: mouse action like Control-Button1
# local_x local_y: local widget coordinates for selection
#
proc PanelCheck::checkSelectionBox { wdg globArray fld check_proc_call event_mode {lb_x ""} {lb_y ""} } {
  global Info
  upvar #0 $globArray theArray

  set arguments {[list $event_mode $lb_x $lb_y]}

  eval "$check_proc_call $arguments"
}


# A generic proc to  respond to checkbox selection
#
proc PanelCheck::checkCheckBoxFieldStatus { globArray fld } {
  global Info
  upvar #0 $globArray theArray

  # Compare current value to "panel in" value for
  # modification marking
  if { [info exists theArray($fld,old)] } {

    set cur_val $theArray($fld)
    set old_val $theArray($fld,old)

    if {$cur_val == "" } {
      set cur_val "False"
    }

    if {$old_val == "" } {
      set old_val "False"
    }

    if { $cur_val != $old_val } {
      set theArray($fld,mod) 1
      Panel::panelDataModified 1 $globArray

    } else {
      set theArray($fld,mod) 0

      if { ![Panel::panelHasModifiedStatus $globArray] } {
        Panel::panelDataModified 0 $globArray
      }
    }

    Widget::setCheckBoxStatus $globArray $fld $theArray(allWidgets,$fld)
  }
}


# A generic proc to  respond to checkbutton (yes/no button) selection
#
proc PanelCheck::checkCheckButtonFieldStatus { globArray fld } {
  global Info
  upvar #0 $globArray theArray

  set cur_value $theArray($fld)

  # Compare current value to "panel in" value for
  # modification marking
  if { [info exists theArray($fld,old)] } {

    if { $cur_value != $theArray($fld,old) } {
      set theArray($fld,mod) 1
      Panel::panelDataModified 1 $globArray

    } else {
      set theArray($fld,mod) 0

      if { ![Panel::panelHasModifiedStatus $globArray] } {
        Panel::panelDataModified 0 $globArray
      }

    }
  }
}


# A generic proc to  respond to radibutton selection
#
proc PanelCheck::checkRadioButtonFieldStatus { globArray fld } {
  global Info
  upvar #0 $globArray theArray

  set cur_value $theArray($fld)

  # Compare current value to "panel in" value for
  # modification marking
  if { [info exists theArray($fld,old)] } {

    if { $cur_value != $theArray($fld,old) } {
      set theArray($fld,mod) 1
      Panel::panelDataModified 1 $globArray

    } else {
      set theArray($fld,mod) 0

      if { ![Panel::panelHasModifiedStatus $globArray] } {
        Panel::panelDataModified 0 $globArray
      }

    }
  }
}


# A generic proc to  respond to Abs checkbox selection
#
proc PanelCheck::checkAbsFieldStatus { globArray fld } {
  global Info
  upvar #0 $globArray theArray
}


# A generic proc to  respond to Use checkbox selection
#
proc PanelCheck::checkUseFieldStatus { globArray fld } {
  global Info
  upvar #0 $globArray theArray

  set cur_value $theArray($fld,Use)

  # Compare current value to "panel in" value for
  # modification marking
  if { [info exists theArray($fld,Use,old)] } {

    if { $cur_value != $theArray($fld,Use,old) } {
      set theArray($fld,Use,mod) 1

    } else {
      set theArray($fld,Use,mod) 0

      if { ![Panel::panelHasModifiedStatus $globArray] } {
        Panel::panelDataModified 0 $globArray
      }
    }
  }

  Widget::setFieldStatus $globArray $fld,Use "CheckBox"
}


# A generic proc to  respond to File checkbox selection
#
proc PanelCheck::checkFileFieldStatus { globArray fld } {
  global Info
  upvar #0 $globArray theArray

  set cur_value $theArray($fld,file)

  # Compare current value to "panel in" value for
  # modification marking
  if { [info exists theArray($fld,file,old)] } {

    if { $cur_value != $theArray($fld,file,old) } {
      set theArray($fld,file,mod) 1

    } else {
      set theArray($fld,file,mod) 0

      if { ![Panel::panelHasModifiedStatus $globArray] } {
        Panel::panelDataModified 0 $globArray
      }
    }
  }

  Widget::setFieldStatus $globArray $fld,file "CheckBox"
}


#===============================#
# Generic widget type fill procs
#===============================#

proc Common(CheckBox,fillProc) {arg} {

  set globArray [lindex $arg 0]
  set fld [lindex $arg 1]

  upvar #0 $globArray theArray

  if { [info exists theArray(targetMask)] } {
    DataField::checkActivitySlaves $globArray $fld $theArray(targetMask)
  } else {
    DataField::checkActivitySlaves $globArray $fld ""
  }
}


proc Common(BrowsableFile,fillProc) {arg} {

  set globArray [lindex $arg 0]
  set fld [lindex $arg 1]

  upvar #0 $globArray theArray

  if {1 == [DataField::getFieldProperty $globArray $fld HasUseCheckBox "" 0]} {
    if { $theArray($fld,act) && 
         $theArray($fld) != "" 
       } {
      set theArray($fld,Use) 1
    } else {
      set theArray($fld,Use) 0
    }
  }

  #-Set BrwosableFile-widget state
  Common(BrowsableFile,editProc) $arg
}


proc Common(IncludeFile,fillProc) {arg} {

  set globArray [lindex $arg 0]
  set fld [lindex $arg 1]

  upvar #0 $globArray theArray

  if { $theArray(INCLUDE,act) && 
       $theArray(INCLUDE) != "" 
     } {
    set theArray(INCLUDE,Use) 1
  } else {
    set theArray(INCLUDE,Use) 0
  }

  #-Set INCLUDE-widget state
  Common(IncludeFile,editProc) $arg
}


proc Common(OptionMenu,fillProc) {arg} {

  set globArray [lindex $arg 0]
  set fld [lindex $arg 1]

  upvar #0 $globArray theArray

  if { [info exists theArray(targetMask)] } {
    DataField::checkActivitySlaves $globArray $fld $theArray(targetMask)

  } else {
    DataField::checkActivitySlaves $globArray $fld ""
  }
}



#===============================#
# Generic widget type edit procs
#===============================#
#
# General proc activated from widget
#

proc Common(BrowsableFile,editProc) {arg} {
  global Info

  set globArray [lindex $arg 0]
  set fld [lindex $arg 1]

  upvar #0 $globArray theArray

  # Clean trailing quotes and white space
  set theArray($fld) [string trim $theArray($fld) " \"\t\n"]

  # If we have a use-checkbox which controls entry fields state
  #
  if {1 == [DataField::getFieldProperty $globArray $fld HasUseCheckBox "" 0]} {

    if { !$theArray($fld,Use) } {
      set theArray($fld,act) 0
    } else {
      set theArray($fld,act) 1
    }    

    Widget::configureField $globArray $fld
  }
 
  return
}


proc Common(IncludeFile,editProc) {arg} {
  global Info

  set globArray [lindex $arg 0]
  set fld [lindex $arg 1]
  set key [lindex $arg 2]

  upvar #0 $globArray theArray

  # Clean trailing quotes and white space
  set theArray($fld) [string trim $theArray($fld) " \"\t\n"]

  # If we have a use-checkbox which controls entry fields state
  #
  if { [info exists theArray($fld,Use)] } {

    if { !$theArray($fld,Use) } {
      set theArray($fld,act) 0
    } else {
      set theArray($fld,act) 1
    }    

    Widget::configureField $globArray $fld
  }

  if { $key == "Double-1" } {
    set fn $theArray($fld)

    if { $fn != "" && [file isfile $fn] } {
      FileBrowser::browse .winEdit$globArray$fld $fn 1 1 
    }
  }

  return
}


proc Common(OptionMenu,editProc) {arg} {

  set globArray [lindex $arg 0]
  set fld [lindex $arg 1]

  upvar #0 $globArray theArray

  if { [info exists theArray(targetMask)] } {
    DataField::checkActivitySlaves $globArray $fld $theArray(targetMask)

  } else {
    DataField::checkActivitySlaves $globArray $fld ""
  }
}




# ========================================================== # 
# Check procs attached to the panel widgets at creation time #
# ========================================================== # 


proc PanelCheck::execFillProc {globArray fld } {

  # NOTE: Call first generic fill proc for the field type
  #
  set wtype [DataField::getFieldProperty $globArray $fld WidgetType]
  Util::execArrayProc Common "$wtype,fillProc" [list $globArray $fld]

  # Then call possible array-field specific fill proc
  #
  if { 1 == [DataField::getFieldProperty $globArray $fld IsUserDefinedField "" 0] } {
    Util::execArrayProc $globArray "UserDefinedField,fillProc" $fld

  } else {
    Util::execArrayProc $globArray "$fld,fillProc"
  }

}


proc PanelCheck::execEditProc {globArray fld {arg ""}} {

  # NOTE: Call first generic edit proc for the field type
  #
  set wtype [DataField::getFieldProperty $globArray $fld WidgetType]
  Util::execArrayProc Common "$wtype,editProc" [list $globArray $fld $arg]

  # Then call possible array-field specific edit proc
  #
  if { 1 == [DataField::getFieldProperty $globArray $fld IsUserDefinedField "" 0] } {
    Util::execArrayProc $globArray "UserDefinedField,editProc" $fld

  } else {
    Util::execArrayProc $globArray "$fld,editProc" $arg
  }

}


# =====================
# Widget specific calls
# =====================

proc PanelCheck::singleButton {globArray fld } {
  PanelCheck::execEditProc $globArray $fld
}


proc PanelCheck::groupButton {globArray group fld } {
  PanelCheck::execEditProc $globArray $fld
}


proc PanelCheck::singleCheckButton {globArray fld } {
  PanelCheck::checkCheckButtonFieldStatus $globArray $fld
  PanelCheck::execEditProc $globArray $fld
}


proc PanelCheck::groupCheckButton {globArray group fld } {
  PanelCheck::checkCheckButtonFieldStatus $globArray $fld
  PanelCheck::execEditProc $globArray $fld
}


proc PanelCheck::singleCheckBox {globArray fld} {
  upvar #0 $globArray theArray

  if { [info exists theArray(targetMask)] } {
    DataField::checkActivitySlaves $globArray $fld $theArray(targetMask)
  } else {
    DataField::checkActivitySlaves $globArray $fld ""
  }

  PanelCheck::checkCheckBoxFieldStatus $globArray $fld
  PanelCheck::execEditProc $globArray $fld
}


proc PanelCheck::singleListBox {globArray fld arg} {
  PanelCheck::execEditProc $globArray $fld $arg
}


proc PanelCheck::singleOptionMenu {globArray fld } {
  PanelCheck::execEditProc $globArray $fld
}


proc PanelCheck::singleSelectionBox {globArray fld arg} {
  PanelCheck::execEditProc $globArray $fld $arg
}


proc PanelCheck::singleText {globArray fld } {
  PanelCheck::execEditProc $globArray $fld
}


proc PanelCheck::groupCheckBox {globArray group fld} {
  PanelCheck::checkCheckBoxFieldStatus $globArray $fld
  PanelCheck::execEditProc $globArray $fld
}


proc PanelCheck::singleRadioButton {globArray fld } {
  PanelCheck::checkRadioButtonFieldStatus $globArray $fld
  PanelCheck::execEditProc $globArray $fld
}


proc PanelCheck::groupRadioButton {globArray group fld} {
  PanelCheck::checkRadioButtonFieldStatus $globArray $group
  if { ![Util::execArrayProc $globArray "$group,groupEditProc" $fld] } {
    PanelCheck::singleRadioButton $globArray $fld
  }
}


proc PanelCheck::singleFileButton {globArray fld} {
  PanelCheck::checkFileFieldStatus $globArray $fld
  PanelCheck::execEditProc $globArray $fld
}


proc PanelCheck::singleProcedureButton {globArray fld} {
  PanelCheck::execEditProc $globArray $fld
}


proc PanelCheck::singleBrowsableDirectory {globArray fld} {
  PanelCheck::execEditProc $globArray $fld
}


proc PanelCheck::singleBrowsableFile {globArray fld} {
  PanelCheck::execEditProc $globArray $fld
}

proc PanelCheck::singleAbsButton {globArray fld} {
  PanelCheck::checkAbsFieldStatus $globArray $fld
  PanelCheck::execEditProc $globArray $fld
}


proc PanelCheck::singleIncludeFile {globArray fld arg} {
  PanelCheck::execEditProc $globArray $fld $arg
}

proc PanelCheck::singleUseButton {globArray fld} {
  PanelCheck::checkUseFieldStatus $globArray $fld
  PanelCheck::execEditProc $globArray $fld
}


proc PanelCheck::groupProcedureButton {globArray fld} {
  global Common 
  upvar #0 $globArray theArray

  PanelCheck::checkCheckBoxFieldStatus $globArray $fld

  set panel $theArray(parameterType)

  foreach FV [lrange $Common($panel,$fld,group) 1 end] {
    set m $entry_widget
    append m $FV
    if {1 == $theArray($fld,file)} {
      Widget::configureS $m disabled
    } else {
      Widget::configureS $m normal
    }
  }
}


# end ecif_tk_panelCheck.tcl
# ********************