Changeset 6372 for trunk/lang


Ignore:
Timestamp:
Jun 2, 2016 3:41:01 PM (8 years ago)
Author:
dkearney
Message:

adding multichoice widget from the multichoice branch

Location:
trunk
Files:
2 edited
3 copied

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/lang/tcl/scripts/Makefile.in

    r4209 r6372  
    5757                image \
    5858                integer \
     59                multichoice \
    5960                note \
    6061                number \
  • trunk/lang/tcl/scripts/objects/multichoice/multichoice.rp

    r6371 r6372  
    3535
    3636            # make sure that the default is really a choice
    37             set defval [string trim $attr(default)]
    3837            set found 0
    39             foreach rec $attr(options) {
    40                 set label [string trim [lindex $rec 0]]
    41                 set value [string trim [lindex $rec 1]]
    42                 if {$defval eq $label || $defval eq $value} {
    43                     set found 1
    44                     break
     38            set alldefvals [split $attr(default) ","]
     39            foreach defval $alldefvals {
     40                set defval [string trim $defval]
     41                foreach rec $attr(options) {
     42                    set label [string trim [lindex $rec 0]]
     43                    set value [string trim [lindex $rec 1]]
     44                    if {$defval eq $label || $defval eq $value} {
     45                        incr found
     46                        break
     47                    }
    4548                }
    4649            }
    47             if {!$found} {
    48                 return [list error "Default value must be a label or value for one of the current choices."]
     50            if {$found != [llength $alldefvals]} {
     51                return [list error "Default value must be labels or values from one of the current choices."]
    4952            }
    5053        }
Note: See TracChangeset for help on using the changeset viewer.